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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sdkconfig.old
runtime/dist/
logs/
tmp/
out/
server/
site-experience/
__pycache__/
Expand All @@ -33,3 +34,10 @@ services/weclawbot-agent/out/
# Local research archive from the pre-open-source workspace.
# Keep it locally for investigation, but do not publish it without a secrets audit.
history/

# The Kindle poll adapter is a reviewed, dependency-free public reference
# implementation. Keep its generated per-device images out of Git.
!integrations/kindle/server/
!integrations/kindle/server/poll-server.mjs
!integrations/kindle/server/data/
!integrations/kindle/server/data/.gitignore
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.83")
set(PROJECT_VER "0.1.89")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(weclawbot)
2 changes: 1 addition & 1 deletion dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ direct_dependencies:
- espressif/mqtt
- idf
- lvgl/lvgl
manifest_hash: 932c1aedb7e766664220d75c09f64907db12aeb4629a82f286de269eea192fe3
manifest_hash: 84ebef8642f676ca94d52ab6c48e6434542a77bad5cb9b6de65d4facad369669
target: esp32s3
version: 2.0.0
109 changes: 108 additions & 1 deletion docs/current-progress.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WeClawBot 当前进展记录

记录日期:2026-07-17
记录日期:2026-07-18

这份文档用于交接当前项目状态。它不是最终产品说明,而是把已经形成的
产品判断、实现边界、已验证路径和待处理问题集中放在一个入口,方便后续
Expand Down Expand Up @@ -1181,3 +1181,110 @@ weclawbotctl clear
本轮首次读取直接成功,因此“读取失败后每 2 秒重试”只标记为代码与回归检查通过,
未标记为故障注入真机验证。开发版标题的构建配置和标题映射已验证,最终屏幕实拍
仍由用户目视确认。

## 2026-07-18 双硬件绑定码提示统一

- BYOA 未接管页统一使用“绑定码”术语。绑定卡片在两款硬件上都显示十分钟有效期,
并把实体操作写清为“按上下键切换”(Note 4)或“按左右键切换”(微雪 RLCD),
不再使用含糊且不一致的“上下循环 / 左右循环”。绑定码刷新期间也保留同一按键提示。
- 底部引导统一为“请为智能体安装 weclawbotctl 插件,输入上方绑定码”,明确安装位置
是用户自己的智能体,并直接指向当前屏幕上的六位绑定码。绑定卡片改为两行详情布局,
两款硬件共用同一渲染路径,只有真实按键方向由硬件适配常量决定。
- 开发版本提升到 `0.1.84`。固件回归检查通过;ESP-IDF 5.5.2 隔离开发构建结果为
Note 4 `0x633530`(应用分区余 22%)、微雪 `0x622e50`(余 23%)。两台真机均已
保留 NVS 刷入且全部镜像通过 esptool 哈希校验;启动串口分别确认 Note 4 的
`ZectrixEpd`、微雪的 `RlcdDisplay`,两台均运行 `0.1.84`,联网后均成功进入
`BYOA code shown`。具体字形、换行和边界是否理想仍待用户目视真机确认。

## 2026-07-18 接管页与留言页按键提示、码区局部刷新

- 开发版 `0.1.85` 继续按真实键位适配文案。官方二维码页底部固定为 Note 4
“微信扫码接入微笺智能体 按上/下键切换智能体”、微雪 RLCD
“微信扫码接入微笺智能体 按左/右键切换智能体”。绑定卡片沿用相同的带斜杠方向
和“切换智能体”语义。接管后的留言页改为 Note 4“按上/下键切换屏幕”、微雪
“按左/右键切换屏幕”,并保留微信端或智能体可更新/清除的来源提示。
- 微信二维码到期不再显示“二维码已过期”错误页,也不等待 1.2 秒;登录任务直接请求
新码,UI 在现有二维码图像对象上替换资源。绑定码更新同样不再清屏重建,只修改
六位数字和详情标签。两条路径都把失效范围收敛到码区,最终物理刷新窗口仍由显示
适配层根据像素差确定。
- 固件回归检查与 ESP-IDF 5.5.2 双目标隔离开发构建通过:微雪 `0x623110`
(应用分区余 23%),Note 4 `0x6337e0`(余 22%)。两台真机均保留 NVS 刷入
`0.1.85`,全部镜像哈希校验通过,启动日志确认正确板型与版本。两台都实际跨过
一轮微信二维码有效期并直接请求新码;Note 4 新码的物理脏区为
`x=40, y=131, 128×123`,没有出现独立失效页或整屏刷新。绑定码的对象级局部
替换已通过双目标编译和契约检查,本轮未等待十分钟做真机超时计时。

## 2026-07-24 Note 4 长按全清后绑定码恢复

- 用户报告 Note 4 长按前面板大键全清后停在“已全清,正在准备智能体绑定码”的启动页。
该动作已经完成本地清除,但按钮路径只依赖 BYOA 主循环随后观察到状态变化并重新
bootstrap,没有像接管方式切换那样把重置后的启动链明确收束到一次干净重启。
- 开发版 `0.1.86` 将全清动作统一为“清文本/照片/登录和绑定凭据、显示重置页、提交
当前帧、等待显示空闲、重启”。按钮路径调用 `ClearAgentCredentials(false)`,避免
在即将重启时再次被 `esp_mqtt_client_stop()` 的无界等待拖住;旧 MQTT 连接交给重启
回收。Note 4 仍额外请求 SSD2683 整屏刷新,微雪 RLCD 同步提交当前帧,两款硬件保持
相同产品语义:重置后回到当前接管模式的官方二维码或 BYOA 绑定码入口。
- 同版还补齐 `lv_image_cache_drop()` 所需的 LVGL cache 头,并把 `esp_tinyusb` 写入
`dependencies.lock`,修复公开 CI 干净构建中二维码资源释放路径的编译失败。
- 固件回归检查通过;ESP-IDF 5.5.2 双目标隔离公开构建通过:微雪 `0x6364a0`
(应用分区余 22%),Note 4 `0x6469f0`(余 22%)。两台真机均保留 NVS 刷入
`0.1.86` 且全部镜像哈希校验通过。串口 `WEC:GET` 确认微雪运行
`Waveshare ESP32-S3-RLCD-4.2` / `0.1.86`,Note 4 运行 `Zectrix Note 4` /
`0.1.86`;Note 4 当前为 `dashboard_view=byoa_takeover`、
`agent_transport_state=awaiting_pairing`,已经拿到新的六位绑定码。实体长按大键
的最终目视复测仍需用户现场操作确认。

## 2026-07-25 Note 4 电池态长时间停画面自恢复

- 用户报告 Note 4 未插 USB 供电一段时间后停在 BYOA 绑定码页,屏幕时钟和日历与真实
时间相差约 18 小时。局域网检查显示设备仍可 ping 通,但固件没有 HTTP 状态服务,
因此 IP 在线只能证明网络栈仍活着,不能证明运行时 UI 或墨水屏物理刷新仍在推进。
- 开发版 `0.1.87` 把运行时 UI 心跳提前到 60 秒电池/校时块与云天气轮询之前,并在
非板载温湿度硬件上校时后立即补一次 UI tick,避免 Note 4 的网络天气或校时路径把
屏幕刷新长期排在后面。日历页新增本地日期 key,跨天时会重绘右侧月历和当天高亮,
不再只更新左侧时间文字。
- BYOA 绑定码页新增本地刷新桶:微雪 RLCD 仍按秒更新有效期,Note 4 按分钟更新有效期,
降低墨水屏无意义刷新压力;绑定码到期后继续在当前码区换新码,不进入单独失效页。
墨水屏物理刷新若在转场或 `DisplayFrame` 阶段失败,会在 15 秒后调度一次整屏恢复
刷新,避免一次 busy/供电瞬态故障把待显示帧静默丢掉。
- 固件回归检查与 ESP-IDF 5.5.2 双目标隔离公开构建通过:微雪 `0x6365c0`
(应用分区余 22%),Note 4 `0x646c20`(余 22%)。本轮尚未刷入长时间电池态复测;
后续若要不插 USB 远程判断“进程活着但屏未刷新”,需要新增不暴露凭据的只读 LAN
健康状态端点。

## 2026-07-26 真机自动刷机引导

- 用户要求两台真机后续开发版刷新不再依赖人工按键配合。开发版 `0.1.88` 在串口
`WEC:*` 协议中新增 `WEC:BOOTLOADER` / `WEC:DOWNLOAD_MODE`,ESP32-S3 目标通过
`RTC_CNTL_FORCE_DOWNLOAD_BOOT` 标记重启后进入 ROM 下载模式;不支持该路径的目标会
返回 `bootloader_unsupported`。这为已经运行 `0.1.88+` 的设备提供“从应用态自动进入
刷机态”的主路径。
- 新增 `scripts/flash_via_serial.py`:扫描 USB CDC 端口、用 `WEC:GET` 识别
`Waveshare ESP32-S3-RLCD-4.2` / `Zectrix Note 4`,映射到对应构建目录,发送
`WEC:BOOTLOADER` 后按构建目录的 `flash_args` 刷入,保留 NVS。脚本同时处理旧固件
兼容:串口交互保持 DTR=true、周期性重发 `WEC:GET`,若 bootloader 命令不可用则
尝试 CDC line toggle 和 esptool `default-reset`,单台失败不会阻断后续设备,最终汇总
失败列表。
- 固件回归检查通过;ESP-IDF 5.5.2 双目标隔离开发构建通过:Note 4 `0x633c60`
(应用分区余 22%),微雪开发配置 `0x6233e0`(余 23%)。本轮尝试直接给两台仍运行
`0.1.86` 的真机刷入 `0.1.88`,但旧固件没有 bootloader 串口命令;esptool
`default-reset` / `usb-reset` 均报 ROM 连接无串口数据,OpenOCD 也未发现
ESP32-S3 USB-JTAG 设备。结论:这两台 `0.1.86` 真机需要先完成一次可进入 ROM
下载模式的引导升级;升级到 `0.1.88+` 后,后续开发版刷新可走脚本自动化路径。

## 2026-07-26 开发源码统一公开与取消 USB MSC

- 按 2026-07-26 更新的公开发布边界,开发版固件、脱敏后的官方 Agent、确定性测试/证明用例、
Kindle KUAL 客户端和明确标注为非生产的轮询参考服务统一进入公开源码。`out/`、
Kindle 生成图片、运行日志、候选账本、真实设备数据、凭据和生产部署配置继续排除。
Kindle 讨论稿移除了真实主机信息,参考服务也限制 `device_id` 格式,避免图片路径
被构造为目录穿越。
- 开发版提升到 `0.1.89`,完全移除 USB MSC 产品盘:删除产品盘源码与设计文档、
`usbdrive` FAT 分区、TinyUSB MSC 依赖和发布 defaults,同时清除屏幕与帮助文案中的
U 盘入口。USB Serial/JTAG、`WEC:*` 配置协议和串口自动刷机能力继续保留;设备连接
用户电脑后不再挂载 WeClawBot U 盘。
- 固件回归契约、Kindle Node/Shell 语法、Agent Python 编译、离线 e2e 和 SkillRepo
display shadow proof 均通过。ESP-IDF 5.5.2 两款公开配置隔离构建通过:微雪
`0x6233a0`(应用分区余 23%),Note 4 `0x633bb0`(余 22%)。两份生成的分区表
都只含 NVS、OTA、PHY、factory 和 SPIFFS,且都保留 USB Serial/JTAG;本轮没有刷写
真机,也没有创建 `0.1.89` GitHub Release 或更新安装页固件资产。
30 changes: 30 additions & 0 deletions docs/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ content is skipped, and a multi-page message keeps its page order. Cached
message/photo content is never exposed by navigation while the device is
unclaimed.

The unclaimed takeover screens make the physical control explicit. The WeChat
QR footer is `微信扫码接入微笺智能体 按上/下键切换智能体` on Note 4 and
`微信扫码接入微笺智能体 按左/右键切换智能体` on the Waveshare RLCD. The
BYOA screen names the six-digit value a binding code and uses the same
board-specific switch hint. Both targets share the binding-card layout and
footer guidance to install the `weclawbotctl` plugin in the user's agent and
enter the binding code; only the real button direction differs.

After takeover, note footers use `按上/下键切换屏幕` on Note 4 and
`按左/右键切换屏幕` on the Waveshare RLCD. QR and binding-code expiry replace
the code object in place instead of showing an expiry page or rebuilding the
whole screen, allowing the display adapter to refresh only the changed region.

RLCD pins used by the driver:

| Signal | GPIO |
Expand Down Expand Up @@ -63,3 +76,20 @@ Battery sensing:
| Signal | GPIO / ADC | Notes | WeClawBot use |
| --- | --- | --- | --- |
| Battery voltage | GPIO4 / ADC1_CH3 | Board example documents battery voltage through a 3x divider. USB power can still make this rail look like a lithium cell, so `CONFIG_WEC_BATTERY_INSTALLED` gates whether the UI treats it as a real battery. | Top status battery/no-battery icon |

Development flashing:

Once a board is running firmware with the serial bootloader command, the host
can refresh both hardware targets without physical button timing:

```sh
./scripts/flash_via_serial.py \
--waveshare-build build-dev-waveshare \
--note4-build build-dev-note4
```

The helper identifies each USB CDC port with `WEC:GET`, enters ROM download
mode with `WEC:BOOTLOADER`, and flashes the matching build directory using
`flash_args` without erasing NVS. For pre-bootloader-command firmware, the
script can try CDC line toggles and esptool `default-reset`, but those paths
depend on the board exposing host-controlled reset/boot straps.
Loading
Loading