Architecture in three layers
Dependencies point in one direction: frontend → runtime → core. Put product integration at the top and sensing algorithms at the bottom.
runtime/esp_idf/.Runtime data flow
Where should new code go?
| If the code… | Put it in… |
|---|---|
| Changes CSI processing or detector behavior | core/, with matching Python behavior |
| Defines a reusable lifecycle, event, snapshot, or transport contract | runtime/ |
| Calls ESP-IDF, FreeRTOS, Wi-Fi, NVS, or lwIP | runtime/esp_idf/ |
| Maps sensing into Direct WebSocket, MQTT, Matter, ESPHome, or your product UI | frontend/ |
Building a runtime for another platform
Keep the shared contracts and replace the platform backend. A new runtime should:
Implement
IEspectreRuntimeOwn capture setup, the work loop, shutdown, controls, snapshots, diagnostics, and capability reporting.
Feed the shared detector core
Convert platform CSI into ESPectre's normalized format, reuse the core features and detectors, and preserve parity with the runtime's evaluation, readiness, and hit-filter behavior.
Deliver the shared events
Defer driver callbacks, and notify
IRuntimeListenerfrom the runtime's owning task.Add platform wiring
Place the implementation under a platform directory such as
runtime/arduino/orruntime/linux/, and provide its own controller or factory. The shippedRuntimeFrontendControllercurrently constructs ESP-IDF backends directly.
docs/adr/.