ESPectre C++ SDK

Add Wi-Fi motion sensing to your ESP-IDF product. Your firmware stays in charge of everything else.

START HERE

Embed the full runtime in your product firmware.

ESPectre handles CSI capture, calibration, detection, and events. Add it as a source component, run it from one task, and use its motion events in your application.

PRODUCT FIT

Confirm the integration boundary first.

The SDK is for ESP-IDF products that compile its sources together with their own firmware.

Toolchain
ESP-IDF 5.5.3 or later and C++17 or later. CI builds the code as C++17, C++20, and C++23. Checked builds are 5.5.3, 5.5.4, 5.5.5, 6.0.3, and 6.1.0. The project's own firmware builds with ESP-IDF 5.5.5. Hardware checks on ESP-IDF 6.x are still pending.
Hardware
ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C5, and ESP32-C6 with standard single-antenna Wi-Fi.
Validated sensing
Detector results are measured on 2.4 GHz HT20 CSI. By default (AUTO), the runtime picks lltf20 for its own raw Wi-Fi traffic, vht20 on 5 GHz, and ht20 otherwise; the device resource reports it as csi_profile. Detection quality on 5 GHz is not measured yet.
Delivery model
A versioned C++ source component, installed with the ESP-IDF Component Manager and compiled with your firmware. Source archives are also available if you prefer to copy it into your project.
Compatibility
Final releases follow Semantic Versioning for the stable C++ API. The core-only detector interface may change in minor releases until stationary presence ships; see the compatibility rules. There is no stable binary interface (ABI).
Licensing
GPLv3 for open-source firmware. Commercial terms are available for eligible closed-source products. Review licensing.
QUICK START

Install from the ESP Component Registry.

Add francescopace/espectre to an existing ESP-IDF project, or create the complete Wi-Fi example to try sensing on a board.

RegistryVersionsWebsite channel
ProductionTagged releases, including prereleasesRelease
StagingBranch snapshotsPreview (main) and Develop (develop)

The website's Release channel may contain a release candidate.

1. Add the SDK

Activate ESP-IDF, open your project folder, and add the latest stable release:

idf.py add-dependency "francescopace/espectre"

For a prerelease or a specific version, replace VERSION_FROM_REGISTRY with a version from the registry. For a branch snapshot, use its version and the staging URL https://components-staging.espressif.com:

idf.py add-dependency --registry-url "https://components.espressif.com" "francescopace/espectre=VERSION_FROM_REGISTRY"

The dependency is saved in main/idf_component.yml, and the exact version in dependencies.lock. Snapshot versions end in .main or .develop; copy them from the registry, not from the website's download labels.

Set CONFIG_ESP_WIFI_CSI_ENABLED=y in your project configuration. Sensing is always included; turn on optional services in menuconfig. See the recommended project configuration for the other options and the public headers for your integration.

2. Drive the runtime

Call setup() after creating the Wi-Fi station and the default event loop, ideally before connecting to Wi-Fi; an existing connection is also picked up. Then call loop() continuously, and queue the events your product needs:

#include "espectre_sdk.h"

class ProductFrontend : public espectre::IRuntimeListener {
 public:
  bool setup() {
    runtime_.set_config(
        espectre::make_runtime_sensing_config_from_kconfig());
    return runtime_.setup(this);
  }

  void loop() { runtime_.loop(); }

  void on_motion_state_changed(
      const espectre::RuntimeSnapshot& snapshot) override {
    if (!snapshot.ready_to_publish) return;
    enqueue_motion(snapshot.motion_state == espectre::MotionState::MOTION);
  }

 private:
  void enqueue_motion(bool motion);
  espectre::RuntimeFrontendController runtime_;
};

Logging is optional. To see SDK messages, register an espectre::LogSink before runtime_.setup(); otherwise the SDK logs nothing.

3. Follow the runtime rules

  • Publish only when snapshot.ready_to_publish is true.
  • Run setup(), loop(), and shutdown() on one task.
  • Keep listener callbacks short and non-blocking; do network and storage work elsewhere.
  • Check capabilities() before offering optional controls.
INTEGRATION PATHS

Choose the highest layer that fits.

Lower layers give more control, but leave lifecycle, timing, and sensing work to your firmware.

Advanced

Core only

Only if your firmware already captures and prepares CSI. Your firmware must then also handle timing, readiness, gaps in the data, and filtering of short spikes.

Portable C++17 or later
Platform port

New runtime

Build on the core SDK to bring ESPectre to another platform that captures CSI its own way, reusing the shared detection code and events.

Arduino or Linux · not shipped today
ALTERNATIVE RUNTIME

Micro-ESPectre for research on the device.

Micro-ESPectre uses the CSI support ESPectre added to MicroPython. It runs Lightweight detection, offers read-only monitoring, and is where detector changes are tested against the C++ version. It is a research tool, not a stable SDK.

TECHNICAL REFERENCES

Go deeper.

PRODUCT TEAMS

Evaluating ESPectre for proprietary firmware?

Commercial terms are available for eligible core, runtime, Native, and Matter code. Integration support and maintenance are agreed separately.