RuView icon indicating copy to clipboard operation
RuView copied to clipboard

[Feature Request/Bug] Cannot provision WiFi Channel manually; CSI Channel Mismatch on managed networks

Open austinjs471 opened this issue 8 months ago • 3 comments

Hardware: ESP32-S3 Firmware Version: v0.4.1-esp32 CSI Build Fix Desktop App Version: v0.4.1

I am experiencing a communication issue where the nodes are "undiscoverable" in the Desktop App due to a WiFi channel mismatch. My router (managed) is locked to Channel 11, but the ESP32 sensing engine defaults to Channel 6.

Because I am on a managed network, I cannot change the router's channel. The current provision.py script does not support a --channel argument, making it impossible to align the node with the router.

Logs My Serial Monitor shows that the WiFi connects to the router on Channel 11, but the CSI collector initializes on Channel 6:

I (616) wifi:connected with SingleDigits-533, aid = 2, channel 11 I (1676) csi_collector: CSI collection initialized (node_id=1, channel=6)

Thanks

austinjs471 avatar Mar 12 '26 22:03 austinjs471

Good catch — this is a real gap. The CSI collector currently hardcodes channel 6 in csi_collector.c regardless of the WiFi connection's actual channel.

Workaround (now)

You can add a --channel value to your NVS provisioning. Edit provision.py and add a csi_channel key to the NVS namespace, then read it in csi_collector_init() instead of the hardcoded 6.

Alternatively, you can modify csi_collector.c line ~210 to use the connected AP's channel:

wifi_ap_record_t ap_info;
esp_wifi_sta_get_ap_info(&ap_info);
csi_config.channel = ap_info.primary;  // use actual connected channel

Fix (planned)

We'll add --channel support to provision.py and have the firmware auto-detect the AP channel after WiFi connection. This should be in the next firmware release.

Thanks for the detailed report with logs — that made the root cause immediately clear.

ruvnet avatar Mar 13 '26 02:03 ruvnet

Update on NVS Workaround I attempted to manually inject the channel using a custom NVS binary flashed to 0x9000, but the firmware is failing to recognize it.

The boot log shows: I (396) nvs_config: No NVS config found, using compiled defaults.

The node then ignores the provisioned SSID and falls back to wifi-densepose on Channel 6.

It appears the v0.4.1 partition table or the expected NVS namespace is preventing the manual nvs_fix.bin from being read correctly by the nvs_config component.

austinjs471 avatar Mar 13 '26 03:03 austinjs471

Fixed in v0.4.2-esp32

The channel mismatch bug is resolved in v0.4.2-esp32 via ADR-060:

Auto-channel detection: After WiFi connect, firmware now calls esp_wifi_sta_get_ap_info() to detect the AP's primary channel and configures CSI collection on that channel. No more hardcoded channel.

Explicit override: If you need to force a specific channel:

python provision.py --port COM7 --channel 6

The fix is in csi_collector.c:csi_collector_init() — channel is resolved at init time from NVS override → AP auto-detect → Kconfig default.

Firmware binaries attached to the release. Flash with:

python -m esptool --chip esp32s3 --port COM7 --baud 460800 write_flash \
  0x0 bootloader.bin 0x8000 partition-table.bin 0x20000 esp32-csi-node.bin

ruvnet avatar Mar 13 '26 12:03 ruvnet