mirror of
https://github.com/ruvnet/RuView.git
synced 2026-04-28 05:59:32 +00:00
Users on multi-node ESP32 deployments have been reporting for months
that their provisioned `node_id` reverts to the Kconfig default of `1`
in UDP frames and the `csi_collector` init log, despite boot showing:
nvs_config: NVS override: node_id=4
main: ESP32-S3 CSI Node (ADR-018) - Node ID: 4
csi_collector: CSI collection initialized (node_id=1, channel=11)
See #232, #375, #385, #386, #390. The root memory-corruption path for
the `g_nvs_config.node_id` byte has not been definitively isolated
(does not reproduce on my attached ESP32-S3 running current source
and the v0.6.0 release binary), but the UDP frame header can be made
tamper-proof regardless:
1. `csi_collector_init()` now captures `g_nvs_config.node_id` into a
module-local `static uint8_t s_node_id` at init time.
2. `csi_serialize_frame()` reads `buf[4]` from `s_node_id`, not from
the global - so any later corruption of `g_nvs_config` cannot
affect outgoing CSI frames.
3. All other consumers (`edge_processing.c` x3, `wasm_runtime.c`,
`display_ui.c`, `main.c swarm_bridge_init`) now go through a new
`csi_collector_get_node_id()` accessor instead of reading the
global directly.
4. A canary at end-of-init logs `WARN` if `g_nvs_config.node_id`
already diverges from the captured value - this will pinpoint
the corruption path if it happens on a user's device.
Hardware validation on attached ESP32-S3 (COM8):
- NVS loads node_id=2
- Boot log: `main: ... Node ID: 2`
- NEW log: `csi_collector: Captured node_id=2 at init (defensive
copy for #232/#375/#385/#390)`
- Init log: `csi_collector: CSI collection initialized (node_id=2)`
- UDP frame byte[4] = 2 (verified via socket sniffer, 15/15 packets)
This is defense in depth - it shields the UDP frame from whatever
upstream bug is clobbering the struct. When a user hits the original
bug, the canary WARN will help isolate the root cause.
Refs #232 #375 #385 #386 #390
Co-Authored-By: claude-flow <ruv@ruv.net>
|
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| csi_collector.c | ||
| csi_collector.h | ||
| display_hal.c | ||
| display_hal.h | ||
| display_task.c | ||
| display_task.h | ||
| display_ui.c | ||
| display_ui.h | ||
| edge_processing.c | ||
| edge_processing.h | ||
| idf_component.yml | ||
| Kconfig.projbuild | ||
| lv_conf.h | ||
| main.c | ||
| mmwave_sensor.c | ||
| mmwave_sensor.h | ||
| mock_csi.c | ||
| mock_csi.h | ||
| nvs_config.c | ||
| nvs_config.h | ||
| ota_update.c | ||
| ota_update.h | ||
| power_mgmt.c | ||
| power_mgmt.h | ||
| rvf_parser.c | ||
| rvf_parser.h | ||
| stream_sender.c | ||
| stream_sender.h | ||
| swarm_bridge.c | ||
| swarm_bridge.h | ||
| wasm_runtime.c | ||
| wasm_runtime.h | ||
| wasm_upload.c | ||
| wasm_upload.h | ||