xiao-webcam-ap
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseXIAO ESP32S3 camera web apps — AP (hotspot) mode
XIAO ESP32S3 摄像头Web应用 — AP(热点)模式
The board becomes its own WiFi hotspot. Clients join the board's SSID and the
page is ALWAYS at http://192.168.4.1. No router, no internet needed.
Best for classrooms: one board per student/team, isolated networks.
Read the skill (same repo) first for base workflow and pitfalls
(especially: PSRAM flag mandatory, DTR reset-stuck recovery, no serial reads
while a demo must keep running).
xiao-esp32s3开发板会成为自身的WiFi热点。客户端连接开发板的SSID后,即可访问**http://192.168.4.1**页面。无需路由器,无需互联网。
非常适合课堂场景:每位学生/每个团队配备一块开发板,网络相互隔离。
请先阅读技能(同一仓库)了解基础工作流程和注意事项(尤其注意:PSRAM标记为必填项、DTR重置卡顿恢复方法、演示运行时无法进行串口读取)。
xiao-esp32s3Step 1 — ALWAYS ask the user first
步骤1 — 务必先询问用户
Never invent credentials. Ask the user for:
- AP 이름(SSID) — e.g. . For classroom fleets suggest numbered names (
XIAO_01..XIAO_01).XIAO_20 - AP 비밀번호 — 8+ chars (WPA2 minimum). If the user wants an open AP, confirm explicitly.
- 채널 (optional, default 1) — for MULTIPLE boards in one room, spread
across 1 / 6 / 11 (board N → channel ); 20 boards all on channel 1 will jam each other.
[1,6,11][N % 3] - Which app: collector, inference viewer, or both.
请勿自行设定参数。请向用户确认以下信息:
- AP名称(SSID) — 例如 。对于课堂批量部署,建议使用编号名称(
XIAO_01..XIAO_01)。XIAO_20 - AP密码 — 至少8个字符(WPA2最低要求)。如果用户需要开放AP,请明确确认。
- 信道(可选,默认值为1) — 若同一房间内有多块开发板,请将它们分散到信道1/6/11(第N块开发板对应信道);20块开发板都使用信道1会导致相互干扰。
[1,6,11][N % 3] - 需要部署的应用:数据集收集页、实时推理查看页,或两者都部署。
Step 2 — generate the sketch from the template
步骤2 — 从模板生成代码文件
Templates in are verified working code — do not rewrite them:
assets/- — dataset collector (gallery + delete + ZIP download)
assets/web_collect.ino.tpl - — live inference viewer (needs the
assets/web_infer.ino.tplEdge Impulse library installed in the sketchbook)<project>_inferencing
Copy the template to (folder = ino
name), then replace the placeholders literally:
<workspace>\<NN>_<name>\<NN>_<name>.ino| Placeholder | Meaning | Example |
|---|---|---|
| hotspot name | |
| hotspot password (8+ chars) | |
| WiFi channel (bare number, no quotes) | |
| inference app only — Edge Impulse project name, matching the installed | |
assets/- — 数据集收集器(包含图库、删除、ZIP下载功能)
assets/web_collect.ino.tpl - — 实时推理查看器(需要在代码库中安装
assets/web_infer.ino.tplEdge Impulse库)<project>_inferencing
将模板复制到(文件夹名称需与ino文件名一致),然后逐一替换占位符:
<workspace>\<NN>_<name>\<NN>_<name>.ino| 占位符 | 含义 | 示例 |
|---|---|---|
| 热点名称 | |
| 热点密码(至少8个字符) | |
| WiFi信道(纯数字,无需引号) | |
| 仅推理应用需填写 — Edge Impulse项目名称,需与已安装的 | |
Step 3 — compile, upload
步骤3 — 编译、上传
powershell
arduino-cli compile --fqbn esp32:esp32:XIAO_ESP32S3 --board-options PSRAM=opi <SKETCH_DIR>
arduino-cli upload -p COM4 --fqbn esp32:esp32:XIAO_ESP32S3 --board-options PSRAM=opi <SKETCH_DIR>PSRAM=opi--cleanpowershell
arduino-cli compile --fqbn esp32:esp32:XIAO_ESP32S3 --board-options PSRAM=opi <SKETCH_DIR>
arduino-cli upload -p COM4 --fqbn esp32:esp32:XIAO_ESP32S3 --board-options PSRAM=opi <SKETCH_DIR>PSRAM=opi--cleanStep 4 — verify
步骤4 — 验证
powershell
undefinedpowershell
undefinedthe AP should appear in a WiFi scan within ~15 s of flashing
烧录完成后约15秒,AP应出现在WiFi扫描结果中
netsh wlan show networks | Select-String "<AP_SSID>"
(netsh caches scans — retry after 20 s before concluding failure.)
**This check needs a WiFi adapter on the PC, and many desktops do not have
one.** If `netsh wlan show interfaces` reports that the Wireless AutoConfig
service is not running, or `Get-NetAdapter` lists only Ethernet, no amount of
retrying will show the AP — the machine physically cannot scan. Do not read
that as a failed flash. Fall back to serial (below), or have the user check
from their phone.netsh wlan show networks | Select-String "<AP_SSID>"
(netsh会缓存扫描结果 — 若未找到,请等待20秒后重试再判定失败。)
**此验证需要电脑配备WiFi适配器,很多台式机没有该硬件。** 如果`netsh wlan show interfaces`显示无线自动配置服务未运行,或`Get-NetAdapter`仅列出以太网,则无论重试多少次都无法扫描到AP — 该设备物理上不支持WiFi扫描。请勿将此判定为烧录失败。可改用串口验证(如下),或让用户用手机检查。Watching the board over serial
通过串口监控开发板状态
In AP mode the PC usually cannot reach the board at all, so serial is often
the only verification available to you. Use the skill.
xiao-serial-monitorpowershell
mon # interactive, port auto-detected
.\scripts\mon.ps1 -Seconds 15 # bounded, for your own debuggingExpected on success:
AP started. Open http://192.168.4.1
Collector readyCamera init failedTwo things worth knowing rather than avoiding:
- Opening the port resets the board via DTR, so the log restarts from boot. That is what you want here — these lines only print once at startup.
- If a board ends up stuck showing only the ROM banner afterwards
(pitfall 8 of ), re-running
xiao-esp32s3clears it, and leaves the sketch running for the demo.arduino-cli upload
When the user wants to watch it themselves, hand them the command rather than
launching the interactive monitor from a tool call — it never returns. In
Claude Code the prefix runs it in their session:
!! <path>\mon.ps1Full check: connect a device to the AP and open http://192.168.4.1 —
tell the user connecting from THEIR phone/PC will drop that device's
internet while connected; that is expected in AP mode.
在AP模式下,电脑通常无法直接连接开发板,因此串口往往是唯一可用的验证方式。请使用技能。
xiao-serial-monitorpowershell
mon # 交互式监控,自动检测端口
.\scripts\mon.ps1 -Seconds 15 # 限时监控,用于调试成功运行时的预期输出:
AP started. Open http://192.168.4.1
Collector ready若输出为,则表示代码在启动AP前就已停止运行 — 该开发板是不带Sense摄像头模块的普通XIAO ESP32S3,或摄像头模块未安装到位。此时持续扫描SSID永远无法发现问题,而一次串口读取就能排查原因。
Camera init failed需要了解的两个关键点:
- 打开串口会通过DTR重置开发板,因此日志会从开机重新开始。这正是我们需要的 — 上述信息仅在启动时打印一次。
- 如果开发板之后一直显示ROM启动信息(技能中的注意事项8),重新运行
xiao-esp32s3即可解决,并让代码保持运行状态用于演示。arduino-cli upload
当用户想要自行监控时,请将命令告知他们,而非直接启动交互式监控 — 该命令不会自动返回。在Claude Code中,前缀可让命令在用户会话中运行:
!! <path>\mon.ps1完整验证步骤:将设备连接到AP并打开http://192.168.4.1 — 告知用户,连接该AP期间,其设备会断开原有网络连接;这是AP模式下的正常现象。
Notes
注意事项
- Collector page: captures go to an in-browser gallery (label badges, per-shot
delete, "전체 ZIP 다운로드" produces files ready for Edge Impulse). Refreshing the page clears the gallery — download the ZIP first.
label.N.jpg - Inference page: whole-frame colored box + top label + per-class confidence bars (classification model — per-object location boxes need a FOMO model).
- The camera renders rotated 90°; the inference template already compensates (CW feature rotation, verified empirically).
- 数据集收集页:拍摄的图片会存入浏览器图库(带有标签标识,支持单张删除),点击“全部ZIP下载”可生成格式的文件,直接用于Edge Impulse。刷新页面会清空图库 — 请先下载ZIP文件。
label.N.jpg - 推理查看页:显示全帧彩色框+顶部标签+各类别置信度条形图(适用于分类模型 — 若需目标位置框则需使用FOMO模型)。
- 摄像头画面会旋转90°;推理模板已对此进行补偿(顺时针特征旋转,经验证有效)。