From 4e1b62ab4f71de4b3aebe0dd8cff74c31cc20c9c Mon Sep 17 00:00:00 2001 From: ruv Date: Sat, 23 May 2026 12:41:19 -0400 Subject: [PATCH] =?UTF-8?q?release(firmware):=20v0.6.9-esp32=20=E2=80=94?= =?UTF-8?q?=20sync-packet=20wired,=20CONFIG=5FC6=5FSYNC=5FEVERY=5FN=5FFRAM?= =?UTF-8?q?ES=20tunable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bundles the iter 8 + iter 9 sync-packet work (§A0.11 + §A0.12) into a shipped release. v0.6.8 didn't carry the sync emission; v0.6.9 closes the loop. What ships: - csi_collector emits a 32-byte UDP sync packet (magic 0xC511A110) every CONFIG_C6_SYNC_EVERY_N_FRAMES CSI callbacks (default 20). - New Kconfig knob lets operators tune cadence from ~0.1 Hz (N=1000) to ~10 Hz (N=1) without rebuilding — sensible defaults for mainstream multistatic at ~2 s sync interval. - Backwards-compatible at the wire level: old aggregators drop the new magic on existing parser mismatch path. Build artifacts (both green on IDF v5.4): - S3 8 MB: 1094 KB, 47% partition slack - C6 4 MB: 1019 KB, 45% partition slack The macro define was renamed from SYNC_EVERY_N_FRAMES to CONFIG_C6_SYNC_EVERY_N_FRAMES so the Kconfig generator wires through. Header guard preserves the default for builds without the kconfig applied. Co-Authored-By: claude-flow --- firmware/esp32-csi-node/main/Kconfig.projbuild | 14 ++++++++++++++ firmware/esp32-csi-node/main/csi_collector.c | 15 +++++++++++---- firmware/esp32-csi-node/version.txt | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/firmware/esp32-csi-node/main/Kconfig.projbuild b/firmware/esp32-csi-node/main/Kconfig.projbuild index 18d7ed1e..18c32ebf 100644 --- a/firmware/esp32-csi-node/main/Kconfig.projbuild +++ b/firmware/esp32-csi-node/main/Kconfig.projbuild @@ -402,6 +402,20 @@ menu "ESP32-C6 capabilities (ADR-110)" range 1 13 depends on C6_SOFTAP_HE_ENABLE + config C6_SYNC_EVERY_N_FRAMES + int "Sync-packet emission cadence (CSI frames per sync)" + default 20 + range 1 1000 + help + How many CSI callbacks fire before csi_collector emits one + ADR-110 §A0.11 sync packet (magic 0xC511A110) carrying the + mesh-aligned epoch + sequence high-water for the host + aggregator to pair against incoming CSI frames. + + Default 20 = ~2 s between sync packets at the bench's + observed 10 fps CSI rate. Raise for less wire overhead; + lower for tighter multistatic alignment windows. + endmenu menu "ADR-018 frame extensions (ADR-110)" diff --git a/firmware/esp32-csi-node/main/csi_collector.c b/firmware/esp32-csi-node/main/csi_collector.c index 96daf67f..48279e0d 100644 --- a/firmware/esp32-csi-node/main/csi_collector.c +++ b/firmware/esp32-csi-node/main/csi_collector.c @@ -296,14 +296,21 @@ static void wifi_csi_callback(void *ctx, wifi_csi_info_t *info) (int8_t)info->rx_ctrl.rssi, info->rx_ctrl.channel); } - /* ADR-110 §A0.11 — Emit a sync-packet every SYNC_EVERY_N CSI frames so the + /* ADR-110 §A0.11/§A0.12 — Emit a sync-packet every N CSI frames so the * host aggregator can pair node-local sequence numbers with the mesh-aligned * epoch coming out of c6_sync_espnow_get_epoch_us(). Backwards-compatible * with the ADR-018 frame format: new packet uses a distinct magic so the - * existing CSI parser can dispatch by first 4 bytes. */ + * existing CSI parser can dispatch by first 4 bytes. + * + * Cadence is operator-tunable via CONFIG_C6_SYNC_EVERY_N_FRAMES (default 20). + * At 10 Hz observed CSI rate that's ~2 s between sync packets; raise to 50 + * for ~5 s (less overhead, slower convergence), lower to 5 for ~0.5 s + * (heavier wire, tighter ADR-029/030 multistatic alignment window). */ { - #define SYNC_EVERY_N_FRAMES 20 /* ~1 Hz at the 20 Hz send-rate gate */ - if ((s_cb_count % SYNC_EVERY_N_FRAMES) == 0) { +#ifndef CONFIG_C6_SYNC_EVERY_N_FRAMES +#define CONFIG_C6_SYNC_EVERY_N_FRAMES 20 +#endif + if ((s_cb_count % CONFIG_C6_SYNC_EVERY_N_FRAMES) == 0) { uint8_t sync[32]; uint32_t sync_magic = 0xC511A110u; /* CSI-ADR-110 sync packet */ uint64_t local_us = (uint64_t)esp_timer_get_time(); diff --git a/firmware/esp32-csi-node/version.txt b/firmware/esp32-csi-node/version.txt index fae59cac..1a5ac0d4 100644 --- a/firmware/esp32-csi-node/version.txt +++ b/firmware/esp32-csi-node/version.txt @@ -1 +1 @@ -0.6.8 +0.6.9