Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)

set(PROJECT_VER "0.1.89")
set(PROJECT_VER "0.1.90")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(weclawbot)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ BUILD_DIR="$PWD/build-waveshare" OUT_DIR="$PWD/web/firmware" ./scripts/prepare_w
BUILD_DIR="$PWD/build-note4" OUT_DIR="$PWD/web/firmware-note4" ./scripts/prepare_web_firmware.sh
```

The development build commands above enable `CONFIG_WEC_DEVELOPMENT_BUILD` for
both boards and show `微笺(开发版)`. Public firmware must keep it disabled
and show `微笺屏`.
Both hardware targets and both build channels render the same versioned
upper-left title, for example `微笺 v0.1.90`. The title is derived from
`WEC_FIRMWARE_VERSION`; there is no separate development-build label.

## Repository Map

Expand Down
29 changes: 17 additions & 12 deletions docs/current-progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,13 @@ WeClawBot / 微笺屏是基于 Waveshare ESP32-S3-RLCD-4.2 的开源固件项目

已知版本问题:

- 源码、CMake 和 firmware contract 当前公开版本为 `0.1.77`;Web 安装页
连接真机后显示设备上报版本
- 公开 `main` 的当前固件源码版本为 `0.1.90`,正式 Release/安装资产仍为
`v0.1.78`;Web 安装页连接真机后显示设备上报版本
- `scripts/prepare_web_firmware.sh` 已重新生成 `web/firmware/`。
- 下一次正式发布前仍必须核对 release 产物和安装页 manifest。
- 固件版本现在要按渠道看待:私有/本地开发版可以继续推进内部版本并显示
`微笺(开发版)`;公开版 release 必须关闭 `CONFIG_WEC_DEVELOPMENT_BUILD`,
显示 `微笺屏`,并以公开 tag/release 的 manifest 为准。公开配置页顶部不应
把私有开发固件号当产品文案承诺,连接真机后再显示设备上报版本。

开发版显示规则:

- 开发版左上角应显示 `微笺(开发版)`
- 公开版左上角应显示 `微笺屏`
- 当前曾出现右括号缺失问题,需要作为发布前 UI 检查项保留
- 固件左上角统一显示 `微笺 v<版本号>`,开发构建与公开构建不再使用不同标题。
正式发布状态仍以公开 tag/release 的 manifest 为准;屏幕显示源码版本不等于
该版本已经作为安装资产发布。

## 官方云端整理现状

Expand Down Expand Up @@ -1288,3 +1281,15 @@ weclawbotctl clear
`0x6233a0`(应用分区余 23%),Note 4 `0x633bb0`(余 22%)。两份生成的分区表
都只含 NVS、OTA、PHY、factory 和 SPIFFS,且都保留 USB Serial/JTAG;本轮没有刷写
真机,也没有创建 `0.1.89` GitHub Release 或更新安装页固件资产。

## 2026-07-26 左上标题统一显示固件版本

- `0.1.90` 取消按开发/公开渠道分叉的屏幕标题。所有页面、两款硬件和两种构建方式
均使用 `微笺 v<版本号>`,例如当前源码显示 `微笺 v0.1.90`。
- 删除仅用于标题的 `CONFIG_WEC_DEVELOPMENT_BUILD` Kconfig 与 defaults 配置,
回归契约改为检查 CMake 与固件版本一致、标题从 `WEC_FIRMWARE_VERSION` 生成,
并禁止旧的“开发版”标题分支重新出现。
- 固件回归与 ESP-IDF 5.5.2 双目标隔离公开构建通过:微雪 `0x6233a0`
(应用分区余 23%),Note 4 `0x633bb0`(余 22%);两份二进制均确认包含
`微笺 v0.1.90`,生成配置中不存在旧开发版标记。正式 Release/安装页资产和
真机目视验证仍需单独记录。
7 changes: 3 additions & 4 deletions docs/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ seconds; after the first success it returns to the normal 60-second cadence.
This startup retry rule is shared firmware behavior, while boards without an
SHTC3 continue to use their board-specific environment source.

Local development builds for both hardware targets enable
`CONFIG_WEC_DEVELOPMENT_BUILD` and render `微笺(开发版)` in the upper-left
header. Public release defaults explicitly disable that option and render
`微笺屏`.
Both hardware targets render the firmware version in the upper-left header,
for example `微笺 v0.1.90`. Development and public builds use the same title;
the visible version comes from `WEC_FIRMWARE_VERSION`.

Battery sensing:

Expand Down
6 changes: 3 additions & 3 deletions docs/official-site-firmware-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ GitHub,也不需要跨域权限。官网服务每十分钟刷新一次;拉
- 可复现演示:将 `FIRMWARE_CONTRACT_URL` 固定为某个 tag 对应的 release asset。
- 不兼容 schema:私有网站 CI 拒绝发布;运行中的站点继续使用最后一份兼容
契约并记录告警。
- 私有/本地开发固件可以显示 `微笺(开发版)` 并使用内部递增版本号;官网和
公开安装页只承诺公开仓库的 contract 与公开 release。不要把私有开发固件号
当成公开用户可安装版本写进官网文案
- 本地开发固件和公开固件都显示 `微笺 v<版本号>`,版本取自固件自身;官网和
公开安装页仍只承诺公开仓库的 contract 与公开 release。不要因为源码版本已
显示在设备上,就把尚未发布的版本写成用户已经可以安装的正式版本
7 changes: 5 additions & 2 deletions docs/project-release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,13 @@ VERSION=0.1.78
- [ ] `main/app_config.h` 版本与 `VERSION` 一致。
- [ ] `web/firmware-contract.json` 和 `web/firmware-contract.note4.json` 的
`firmware.version` 与 `VERSION` 一致。
- [ ] 公开版构建关闭 `CONFIG_WEC_DEVELOPMENT_BUILD`
- [ ] 左上标题由 `WEC_FIRMWARE_VERSION` 生成,且不存在开发/公开标题分叉

```sh
rg -n 'CONFIG_WEC_DEVELOPMENT_BUILD' sdkconfig.defaults sdkconfig.release.defaults main/Kconfig.projbuild
rg -n 'WEC_SCREEN_TITLE|WEC_FIRMWARE_VERSION' main/app_config.h
! rg -n 'CONFIG_WEC_DEVELOPMENT_BUILD|微笺(开发版)' \
main/app_config.h main/Kconfig.projbuild sdkconfig.defaults \
sdkconfig.zectrix.defaults sdkconfig.release.defaults
```

- [ ] release workflow 使用公开 defaults:
Expand Down
15 changes: 9 additions & 6 deletions docs/public-release-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ If a file is not clearly inside the public boundary, do not publish it.
`web/index.html`, `web/app.js`, `web/style.css`, per-board manifests such as
`web/manifest.json` and `web/manifest.note4.json`, and their matching public
firmware contracts.
- Public firmware release artifacts only when they were built for the public
channel with `CONFIG_WEC_DEVELOPMENT_BUILD` disabled. Prefer GitHub Release
assets generated by the release workflow over committing local binaries.
- Public firmware release artifacts only when they were built from the
intended public source/version and passed the release checks. Prefer GitHub
Release assets generated by the release workflow over committing local
binaries.
- User-facing documentation under `docs/`, including architecture, protocol,
privacy boundary, BYOA reliability notes, and open discussion records.
- Agent integration source and packaging metadata under `integrations/`, such
Expand Down Expand Up @@ -67,9 +68,11 @@ If a file is not clearly inside the public boundary, do not publish it.

## Firmware Channel Rules

- Public firmware shows `微笺屏`.
- Private/local development firmware may enable
`CONFIG_WEC_DEVELOPMENT_BUILD=y` and show `微笺(开发版)`.
- Development and public firmware both show `微笺 v<version>` in the
upper-left header, with `<version>` derived from `WEC_FIRMWARE_VERSION`.
- The screen title does not encode the build channel. Source merge, formal
release, installer assets, and true-device validation remain separate facts
and must be recorded separately.
- Public release builds must use:

```sh
Expand Down
7 changes: 0 additions & 7 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ config WEC_REPLY_ON_TEXT
bool "Reply to WeChat when a text note is posted"
default n

config WEC_DEVELOPMENT_BUILD
bool "Mark firmware as a local development build"
default n
help
Show the development label on the device header. Public firmware
releases should keep this disabled.

config WEC_BATTERY_INSTALLED
bool "Device has an installed 18650 battery"
default n
Expand Down
12 changes: 2 additions & 10 deletions main/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
#include <driver/gpio.h>
#include <driver/spi_common.h>

#define WEC_FIRMWARE_VERSION "0.1.89"
#define WEC_FIRMWARE_VERSION "0.1.90"
#define WEC_PRODUCT_URL "https://weclawbot.link"
#define WEC_PRODUCT_HOST "weclawbot.link"

#ifndef CONFIG_WEC_DEVELOPMENT_BUILD
#define CONFIG_WEC_DEVELOPMENT_BUILD 0
#endif

#ifndef CONFIG_WEC_BOARD_ZECTRIX_NOTE4
#define CONFIG_WEC_BOARD_ZECTRIX_NOTE4 0
#endif
Expand All @@ -19,11 +15,7 @@
#define CONFIG_WEC_BATTERY_INSTALLED 0
#endif

#if CONFIG_WEC_DEVELOPMENT_BUILD
#define WEC_SCREEN_TITLE "微笺(开发版)"
#else
#define WEC_SCREEN_TITLE "微笺屏"
#endif
#define WEC_SCREEN_TITLE "微笺 v" WEC_FIRMWARE_VERSION

#define WEC_I2C_HOST I2C_NUM_0
#if CONFIG_WEC_BOARD_ZECTRIX_NOTE4
Expand Down
39 changes: 31 additions & 8 deletions scripts/check_firmware_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,36 @@ def check_zectrix_power_contract() -> None:
fail(f"Zectrix power contract is missing {required}")


def check_development_build_contract() -> None:
development_defaults = read("sdkconfig.defaults")
release_defaults = read("sdkconfig.release.defaults")
if "CONFIG_WEC_DEVELOPMENT_BUILD=y" not in development_defaults:
fail("both local development board builds must show the development label")
if "# CONFIG_WEC_DEVELOPMENT_BUILD is not set" not in release_defaults:
fail("public release builds must hide the development label")
def check_screen_title_contract() -> None:
root_cmake = read("CMakeLists.txt")
config = read("main/app_config.h")
public_surface = "\n".join(
read(path)
for path in [
"main/app_config.h",
"main/Kconfig.projbuild",
"sdkconfig.defaults",
"sdkconfig.zectrix.defaults",
"sdkconfig.release.defaults",
]
)
cmake_match = re.search(r'set\(PROJECT_VER "([^"]+)"\)', root_cmake)
firmware_match = re.search(
r'#define WEC_FIRMWARE_VERSION "([^"]+)"', config
)
if not cmake_match or not firmware_match:
fail("firmware version definitions are missing")
if cmake_match.group(1) != firmware_match.group(1):
fail("CMake and screen firmware versions must match")
if '#define WEC_SCREEN_TITLE "微笺 v" WEC_FIRMWARE_VERSION' not in config:
fail("screen title must render 微笺 v followed by the firmware version")
for removed in [
"CONFIG_WEC_DEVELOPMENT_BUILD",
"微笺(开发版)",
'#define WEC_SCREEN_TITLE "微笺屏"',
]:
if removed in public_surface:
fail(f"screen title channel fork must remain removed: {removed}")


def check_no_usb_mass_storage_contract() -> None:
Expand Down Expand Up @@ -775,7 +798,7 @@ def main() -> None:
check_epd_pet_timer_contract()
check_weather_ui_contract()
check_zectrix_power_contract()
check_development_build_contract()
check_screen_title_contract()
check_no_usb_mass_storage_contract()
check_serial_bootloader_contract()
print("firmware regression checks passed")
Expand Down
2 changes: 0 additions & 2 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ CONFIG_MQTT_PROTOCOL_311=y
CONFIG_MQTT_TRANSPORT_SSL=y
CONFIG_MQTT_TRANSPORT_WEBSOCKET=y
CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y

CONFIG_WEC_DEVELOPMENT_BUILD=y
3 changes: 2 additions & 1 deletion sdkconfig.release.defaults
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# CONFIG_WEC_DEVELOPMENT_BUILD is not set
# Public release overrides belong in this file. The screen title always uses
# the firmware version and does not vary by build channel.
1 change: 0 additions & 1 deletion sdkconfig.zectrix.defaults
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CONFIG_WEC_BOARD_ZECTRIX_NOTE4=y
# CONFIG_WEC_BOARD_WAVESHARE_RLCD_4_2 is not set
CONFIG_WEC_DEVELOPMENT_BUILD=y
CONFIG_WEC_BATTERY_INSTALLED=y
Loading