github francescopace/espectre 2.1.0
v2.1.0 - "Made for ESPHome" Compliance

latest releases: 2.3.0, 2.2.0
22 days ago

All example configurations now meet "Made for ESPHome" requirements

WiFi Provisioning

  • BLE provisioning: esp32_improv for easy setup via ESPHome/HA Companion app
  • USB provisioning: improv_serial for web.esphome.io configuration (not yet supported on ESP32-C5)
  • Captive Portal: Fallback AP "ESPectre Fallback" for WiFi configuration
  • No hardcoded credentials: Removed YOUR_WIFI_SSID placeholders

Dashboard Adoption

  • dashboard_import: One-click adoption from ESPHome Dashboard
  • project metadata: Version tracking for firmware updates

Code Cleanup

  • Renamed espectre_component.cpp/.hespectre.cpp/.h
  • Component ID standardized to espectre_csi
  • Updated me CLI: erase_flasherase-flash (esptool deprecation fix)

⚡ Performance Optimization

Unified variance algorithm and optimized Hampel filter across both platforms

This release focuses on code uniformity between MicroPython and C++ implementations, improving numerical stability and performance.

Algorithm Uniformity

  • Two-pass variance: Both platforms now use the same numerically stable algorithm
    • Formula: Var(X) = Σ(x - μ)² / n (more stable than E[X²] - E[X]²)
    • Eliminates catastrophic cancellation risk with float32
    • Identical behavior between MicroPython and C++

Hampel Filter Optimization

  • C++ (ESPHome): Eliminated dynamic memory allocation

    • Pre-allocated static buffers in hampel_turbulence_state_t
    • Insertion sort replaces qsort() for small arrays (N=3-11)
    • ~20-25μs saved per packet (no malloc/free overhead)
  • MicroPython: Pre-allocated buffers and circular buffer

    • Eliminated list creation per call
    • Insertion sort for small arrays
    • ~120μs saved per packet

Validation

  • New test script 16_test_optimization_equivalence.py using real CSI data
  • Verified with 2000 real CSI packets (baseline + movement)
  • Maximum variance difference: 9.41e-14 (effectively zero)
Change C++ Impact MicroPython Impact
Two-pass variance Unchanged (already used) +25μs (acceptable)
Hampel optimization -20-25μs -120μs
Net improvement -20-25μs/pkt -95μs/pkt

🧪 Test Suite & Code Coverage

  • 140 test cases (+72 from 2.0.0) with real CSI data
  • Full device testing: All tests run on both native and ESP32-C6 via IWiFiCSI dependency injection
  • Codecov integration: Coverage badge, PR comments, 80% threshold
  • 84% line coverage, 94% function coverage
  • Refactoring: Shared utilities in utils.h, configurable CalibrationManager

Don't miss a new espectre release

NewReleases is sending notifications on new releases.