Skip to content

Embedded client hardening: define and close the ESP32-S3 production gaps #60

Description

@jason-shen

Problem

The ESP32-S3 firmware at streamcoreai/esp32 connects to this server over WHIP and works on the bench. It is listed as not production-ready, and the roadmap says so without saying what that means, which makes it impossible for anyone else to help close the gap.

The firmware is a Rust SDK over Espressif's native esp_peer C library, running on ESP-IDF/FreeRTOS with no tokio and no full OS networking. It already has a fair surface: Agent handle with connect/disconnect, Capturer/Renderer traits with I2S default implementations, callbacks for state, transcripts, responses and errors, RPC registration so the agent can call device tools, plus camera, display and AFE modules.

What "not production-ready" needs to become is a list of specific, checkable gaps. From the code as it stands, the candidates are:

  • Recovery. The server ships an ICE-restart-then-resume ladder and every full SDK implements it. The ESP32 client is the one most likely to lose its network — battery, wifi, a device carried around a building — and the least able to recover by having the user click reconnect. If src/whip.rs does not implement PATCH ICE restart and resume redial, it is the highest-value gap on this list.
  • Memory. No documented heap or stack headroom figure. On an S3 with PSRAM the WebRTC stack plus Opus plus an audio pipeline is tight, and "works until it doesn't" is the failure mode. A soak test with a high-water mark is what turns this from a worry into a number.
  • Audio path. AEC/AGC/NS behaviour through the AFE pipeline, and how it interacts with server-side barge-in. Confirmed working with a specific mic and speaker pair, or documented as the caller's problem.
  • Long-run stability. Nothing establishes that a device stays connected for 24 hours, or what it does after the wifi AP reboots.
  • TLS and credentials. Certificate handling for https:// WHIP, and where a token lives on a device that a user can physically hold.
  • Provisioning and OTA. Wifi credentials are env!() macros in the example, meaning they are baked into the binary at build time. Fine for a demo, not shippable.
  • Board coverage. Which boards are actually verified, with pin maps, rather than one board and a hope.

Proposed change

Turn the list above into a checklist in the esp32 repo README, verify each item, and fix or document what fails. Concretely, for this repo's part:

  • A hardening tracking issue in streamcoreai/esp32 with one checkbox per gap, so contributors can take one.
  • The recovery ladder implemented and tested against a real drop (pull the AP, wait, restore), matching the behaviour documented in docs/protocol.md.
  • A published soak result: N hours connected, heap high-water mark, reconnects survived.
  • A verified-boards table with pin maps.
  • Wifi provisioning that is not compile-time, and a documented OTA path.
  • docs/ in this repo linking to that status honestly, so the capability table stays accurate either way.

This is a large, multi-PR effort and splitting it is expected. The immediate deliverable is the checklist and the verified answers — a firmware that says "24h soak, 41 KB free heap at the low-water mark, survives AP reboot" is production-ready in the only sense that matters, and one that cannot answer those questions is not, regardless of how it behaves on a desk.

Acceptance criteria

  • Tracking issue in streamcoreai/esp32 enumerating the gaps, each independently claimable.
  • ICE restart and resume implemented in the firmware and verified against a real network drop.
  • Published soak result with heap high-water mark.
  • Verified-boards table with pin maps.
  • Runtime wifi provisioning, and a documented OTA story.
  • docs/capabilities.md and the roadmap reflect the verified state, with zh-CN mirrors updated.

Pointers

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: esp32ESP32-S3 firmware and embedded clientseffort: largeDesign discussion needed before codeenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions