Ordered-scan validator for QR puzzle sequences with host-based
Unity test harness. Tests cover: correct order acceptance, reset on
wrong scan, and duplicate-of-last handling.
The project depended on espressif/esp-box (first-gen BOX: ST7789 +
TT21100 touch), which mis-initialises a real ESP32-S3-BOX-3 (ILI9341 +
GT911) and leaves the screen black. Switch the dependency to
espressif/esp-box-3 and use the generic bsp/esp-bsp.h header.
Also: the voice app started the display but never lit the backlight
("LCD backlight must be enabled separately" per the BSP). plip_ui_init
now calls bsp_display_brightness_init()/set(100) and uses a dark-blue
background with white text so the UI is actually visible.
Resolves clean (esp-box-3 3.2.0, esp_lcd_ili9341 2.0.2,
esp_lcd_touch_gt911 1.2.0); build green.
plip_ui.{h,c}: LVGL phone on the BOX-3 LCD driven by the plip_virtual
hook state. Idle/ringing shows a phone glyph + status ("Appel
entrant…"); off-hook shows a 3x4 dial keypad (1-9,*,0,#) with a live
number field. A fixed bottom touch button toggles the hook —
"Décrocher" (green) while ringing, "Raccrocher" (red) off-hook,
disabled when idle. Dialed digits are reported to the master
(reason "dial:<n>") and surfaced in GET /status.
plip_virtual gains the public pickup/hangup/dial API, a state
callback for the UI, and a state getter; enables Montserrat 24/48.
Build green; flashed and verified on a real ESP32-S3-BOX-3.
New main/plip_virtual.{h,c}: implements the PLIP REST contract on the
existing port-80 httpd (POST /ring {duration_ms} with French cadence
1.5s/3.5s 440 Hz on the speaker, POST /stop, GET /status, POST /play
501 — audio flows through the WS TTS path). The BOOT button becomes
the virtual hook switch when ringing/off-hook (falls back to the
streaming toggle otherwise) and every transition is reported to the
master POST <ZACUS_MASTER_URL>/voice/hook {state,reason}, the exact
zacus_hook_client contract — the master cannot tell the annexes apart.
New Kconfig ZACUS_MASTER_URL (default 10.2.5.42). scenario_server
exposes its httpd handle for co-registration.
Build green (zacus-box3-voice.bin).
HTTP management of the ESP-NOW relay peer registry — replaces the
desktop NvsConfigurator round-trip. POST {alias, mac} persists to the
NVS "peers" namespace (the exact format main.c seeds at boot) and
registers the peer live in the scenario_mesh table (no reboot). GET
lists the registry. Provisioning PLIP becomes:
curl -X POST master/game/peers -d '{"alias":"plip","mac":"..."}'
Build green (zacus_master.bin).
The component was vendored byte-identical in idf_zacus/components/ and
box3_voice/components/ (documented drift risk). Hoist the single copy
to lib/scenario_mesh, referenced from both projects via
EXTRA_COMPONENT_DIRS in their root CMakeLists. The two deliberate
frame-format reimplementations (puzzle demux in espnow_common, PLIP's
Arduino scenario_now) are now called out in the receiver-patch doc.
All 3 firmwares rebuilt green (p7_coffre, idf_zacus, box3_voice).
PLIP_FIRMWARE now has its own ESP-NOW receiver
(src/scenario_now.{h,cpp}); update the receiver-patch status and the
PLIP section accordingly. HTTP stays the recommended push path once
PLIP's REST server lands.
- scenario_mesh: ESP-NOW frame protocol component (master + box3_voice):
chunking, per-source reassembly, deferred apply off the Wi-Fi callback.
- game_endpoint: POST /game/scenario/relay (master) + shared scenario_apply.
- box3_voice: scenario receiver wiring (scenario_mesh_init).
- espnow_slave (shared by all puzzles): demux scenario frames inside the single
recv callback so a misrouted relay can't corrupt the MSG_* stream; reassemble
per source MAC; optional consumer hook (logs+drops by default, puzzles have no
scenario engine). Add missing esp_mac.h include for MACSTR/MAC2STR.
- CMakeLists (scenario_mesh + 4 puzzle mains): drop invalid `esp_now` REQUIRES;
the ESP-NOW API lives in esp_wifi. Fixes "Failed to resolve component esp_now".
- docs: scenario-mesh receiver patch note (puzzles done via defensive demux;
PLIP out of scope — Wi-Fi/HTTP-only, no ESP-NOW stack).
Builds green under ESP-IDF 5.4.4: idf_zacus, box3_voice, p7_coffre.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirrors the master's hot-load endpoint on the BOX-3 with a
self-contained httpd (no shared component) since box3_voice is
a separate IDF project. Storage uses the existing SPIFFS
partition; behaviour matches the master (validate, .bak rotate,
write, deferred restart).
main.c hooks scenario_server_start() after wifi_init_sta(); the
http server binds once the STA gets an IP.
Move idf_component.yml to main/ so the IDF Component Manager
actually fetches the managed dependencies. Pin button to 2.5.x
and esp_codec_dev to 1.2.0 to stay compatible with esp-box 1.x
legacy i2c. Set CONFIG_I2C_ENABLE_LEGACY_DRIVERS=y for the same
reason; a residual upstream BSP conflict still aborts boot on
hardware (esp-box 1.x vs driver_ng) - tracked separately.
sdkconfig.defaults documents that WiFi credentials must be set
via menuconfig and never committed.
game_endpoint gains a /game/scenario handler that accepts a Runtime 3
IR JSON (<=64 KiB), validates schema_version + non-empty steps array,
rotates the existing scenario to .bak, writes to LittleFS at
/littlefs/scenario.json on partition 'storage', and reboots after
the HTTP response flushes so the engine picks up the new IR.
ota_server bumps max_uri_handlers 8 -> 16 to fit the extra handlers
(/game/scenario plus headroom).
sdkconfig.qemu disables PSRAM + esp-sr so the firmware boots inside
qemu-system-xtensa without crashing on the unemulated octal PSRAM.
QEMU_HOWTO.md documents the workflow and the WiFi/Ethernet gap that
still blocks full HTTP smoke under emulation.
Bump factory + ota_0 + ota_1 from 0x180000 to 0x200000 (2 MB each)
to give voice_pipeline / STT / hints_client / esp-sr slices ~25% free
margin (was 7%). OTA dual-bank rollback symmetry preserved (all three
app slots same size). Storage (LittleFS) grows from 2 MB to 5 MB to
host MP3 cue pool; model (esp-sr SPIFFS) stays at 1 MB. Layout uses
12.1 MB of the 16 MB flash, leaves 3.87 MB unused for future growth.
idf.py build reports zacus_master.bin = 0x1639a0 (1.39 MB), 31% free
in 0x200000 partition. Reordered model before storage in CSV so auto
offsets cascade as planned (model at 0x620000, storage at 0x720000).
No sdkconfig change. Migration only requires erasing flash on first
deploy because partition table changed.
Context:
The PLIP retro-telephone annex (Si3210 SLIC + RJ9 combine) needs a
way to drive the master ESP32 voice pipeline directly from the hook
switch, so the escape-room narrative "le telephone sonne, decroche
pour parler a Zacus" works without relying on the wake-word.
Approach:
- Expose the existing ota_server httpd_handle_t via a new getter so a
second component can register routes on the same listener (port 80)
instead of standing up a parallel httpd.
- New voice_hook_endpoint component attaches POST /voice/hook +
GET /voice/hook/state to that shared handle. Off-hook arms the
pipeline (LISTENING + capture + WS streaming, bypassing wake-word);
on-hook tears it down (stop streaming + stop capture + IDLE).
- Enable enable_tts_playback so TTS frames received over the bridge
WS land on the MAX98357A DAC. Wake-word stays enabled (mixed mode:
hook is primary, "hi esp" is fallback).
Changes:
- ota_server: add ota_server_get_handle() returning the static
httpd_handle_t for late URI handler registration.
- voice_hook_endpoint: new component (CMakeLists, header, .c, README).
POST handler validates body (<=256 B), parses cJSON, dispatches
state on/off (idempotent), returns JSON status. GET state handler
exposes voice_state + wake_word_active + streaming for debugging.
Explicit GET on /voice/hook returns 405 with Allow: POST so PLIP
integrators see an actionable error instead of a 404.
- main.c: include header, init voice_hook_endpoint after ota_server
succeeds, flip voice_cfg.enable_tts_playback = true.
- main/CMakeLists.txt: add voice_hook_endpoint to REQUIRES.
- README.md: document the wire protocol PLIP must call (state values,
response codes, curl examples, mixed-mode behaviour).
Impact:
- PLIP firmware can now drive the Zacus voice loop over Wi-Fi via
REST without any code change on the master side beyond this slice.
- TTS replies from the MacStudio voice-bridge are audible on the
master speaker (slice 9 shipped the API; slice 10 turns it on).
- App size 0x1639a0 (1.39 MB) in 0x180000 partition — 7% headroom,
no partitions.csv resize needed.