How francescopace/espectre works
ESPectre is an on-device Wi-Fi motion-sensing platform with C++ and MicroPython runtimes, several firmware frontends, and host-side device and research tools. Its main workflow captures Wi-Fi CSI, evaluates motion locally, then exposes occupancy and diagnostics through a chosen integration. The graph preserves the documented firmware paths and research capabilities. Several subsystem links are supported by the README rather than sampled implementation; unsampled wiring is not inferred.
Main entry points: native_frontend.cpp Native frontend · csi_pipeline.cpp CSI acquisition · runtime_frontend_controller.cpp Runtime control · app.py ESPectre CLI
Components 20
Sensing runtime
- CSI acquisition
src/cpp/runtime/esp_idf/csi_pipeline.cpp - Runtime control
src/cpp/runtime/esp_idf/runtime_frontend_controller.cpp
Detection algorithms
- Runtime policy
tools/lib/runtime_policy.py - C++ detectors
src/cpp/core/base_detector.cpp - MicroPython detector
src/python/micro_espectre/lightweight_detector.py
Firmware frontends
- Native frontend
src/cpp/frontend/native/espectre/native_frontend.cpp - MQTT integration
src/cpp/frontend/native/espectre/native_mqtt_frontend.cpp - Direct HTTP API
src/cpp/runtime/direct_http_protocol.cpp - ESPHome entities
src/cpp/frontend/esphome/components/espectre/espectre.cpp - Matter frontend
src/cpp/frontend/matter/espectre/matter_frontend.cpp - Micro-ESPectre
src/python/micro_espectre/runtime_main.py - HTTPS updates
src/cpp/frontend/ota_service_https.cpp
Host tools
- ESPectre CLI
src/python/espectre_cli/app.py - Device discovery
src/python/espectre_cli/device_discovery.py
Research workflow
- CSI collection
tools/lib/csi_io.py - Dataset metadata
tools/lib/dataset_metadata.py - Model training
tools/lib/ml_training/training.py - Temporal replay
tools/lib/temporal_replay.py - Detector analysis
tools/compare_detection_methods.py
Other components
- Device operator
Connections 18
- Device operator → CSI acquisition: senses motion
- CSI acquisition → C++ detectors: evaluates CSI
- Device operator → Runtime control: configures device
- Runtime control → Native frontend: serves frontend
- Native frontend → MQTT integration: offers MQTT
- Native frontend → Direct HTTP API: offers HTTP API
- Device operator → ESPHome entities: uses ESPHome
- Device operator → Matter frontend: commissions sensor
- Device operator → Micro-ESPectre: runs MicroPython
- Device operator → HTTPS updates: updates firmware
src/cpp/frontend/ota_service_https.cpp - Device operator → ESPectre CLI: controls device
- ESPectre CLI → Device discovery: discovers devices
src/python/espectre_cli/app.py - Device operator → CSI collection: collects CSI
- CSI collection → Dataset metadata: loads metadata
tools/lib/csi_io.py - Device operator → Model training: trains models
- Device operator → Temporal replay: replays captures
- Device operator → Detector analysis: compares detectors
- MicroPython detector → Runtime policy: shares policy