Skip to content

feat: ESP32 CSI transmitter MAC address filtering#101

Merged
ruvnet merged 2 commits intomainfrom
fix/issue-98-csi-mac-filtering
Mar 2, 2026
Merged

feat: ESP32 CSI transmitter MAC address filtering#101
ruvnet merged 2 commits intomainfrom
fix/issue-98-csi-mac-filtering

Conversation

@ruvnet
Copy link
Owner

@ruvnet ruvnet commented Mar 2, 2026

Summary

  • Add MAC address filter to ESP32 CSI collector to prevent signal mixing in multi-AP environments
  • Filter by transmitter MAC in the wifi_csi_callback — non-matching frames are silently dropped
  • Configurable via Kconfig (CSI_FILTER_MAC) and NVS (filter_mac blob) for runtime flexibility
  • Log transmitter MAC in periodic CSI callback debug output for diagnostics
  • Default behavior unchanged: no filter = accept all transmitters (backward compatible)

Configuration

Compile-time (menuconfig):

CSI Node Configuration → CSI source MAC filter = "AA:BB:CC:DD:EE:FF"

Runtime (NVS, no reflash needed):

# Via provisioning script or esptool
nvs_set blob csi_cfg filter_mac "AA:BB:CC:DD:EE:FF"

Files Changed

  • firmware/esp32-csi-node/main/csi_collector.c — MAC filter logic in CSI callback
  • firmware/esp32-csi-node/main/csi_collector.hcsi_collector_set_filter_mac() API
  • firmware/esp32-csi-node/main/nvs_config.c — Parse Kconfig MAC string + NVS blob override
  • firmware/esp32-csi-node/main/nvs_config.hfilter_mac + filter_mac_enabled fields
  • firmware/esp32-csi-node/main/Kconfig.projbuildCSI_FILTER_MAC option
  • firmware/esp32-csi-node/main/main.c — Apply filter from config at boot

Test plan

  • Flash to ESP32-S3, verify default mode (no filter) works as before
  • Set CSI_FILTER_MAC to AP MAC, verify only that AP's CSI is processed
  • Set CSI_FILTER_MAC to wrong MAC, verify all CSI is dropped (s_filtered increments)
  • Test NVS override: flash without Kconfig MAC, set via NVS, reboot, verify filter active
  • Verify log output shows transmitter MAC in periodic CSI callback messages

Fixes #98

🤖 Generated with claude-flow

ruvnet added 2 commits March 2, 2026 16:43
In multi-AP environments, CSI frames from different access points get
mixed together, corrupting the sensing signal. Add transmitter MAC
filtering so only frames from a specified AP are processed.

Implementation:
- csi_collector: filter in wifi_csi_callback by comparing info->mac
  against configured MAC; log transmitter MAC in periodic debug output
- csi_collector_set_filter_mac(): runtime API to enable/disable filter
- Kconfig: CSI_FILTER_MAC option (format "AA:BB:CC:DD:EE:FF")
- NVS: "filter_mac" 6-byte blob overrides Kconfig at runtime
- nvs_config: parse Kconfig MAC string at boot, load NVS override
- main: apply filter from config after csi_collector_init()

When no filter is configured (default), behavior is unchanged —
all transmitter MACs are accepted for backward compatibility.

Fixes #98

Co-Authored-By: claude-flow <ruv@ruv.net>
Local machine configuration (ESP-IDF paths, COM port, build
instructions) should not be committed to the repository.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet
Copy link
Owner Author

ruvnet commented Mar 2, 2026

Firmware Build & Flash Verification ✅

Build method: Docker (espressif/idf:v5.2)
Target: ESP32-S3 (QFN56, rev v0.2)
MAC: 3c:0f:02:ec:c2:28
Port: COM7

Build

  • 961/961 compilation steps passed
  • Binary: esp32-csi-node.bin (788,832 bytes, 25% flash free)
  • Build command: docker run --rm -v ... espressif/idf:v5.2 bash -c "idf.py set-target esp32s3 && idf.py build"

Flash

  • All 3 partitions written and hash-verified:
    • bootloader.bin (21,056 bytes) at 0x0
    • partition-table.bin (3,072 bytes) at 0x8000
    • esp32-csi-node.bin (788,832 bytes) at 0x10000

Boot Verification

  • ESP-IDF v5.2, compile time Mar 2 2026
  • NVS config module loads correctly (falls back to compiled defaults)
  • MAC filter code compiled in (activated via NVS filter_mac blob or Kconfig CONFIG_CSI_FILTER_MAC)
  • WiFi STA mode initializes, CSI collection ready
  • Node ID: 1 (default)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESP32 CSI Collector mac filtering

1 participant