fix(csi): filter by MAC before the early rate gate - #1734
Open
mikhaellerik4-alt wants to merge 1 commit into
Open
fix(csi): filter by MAC before the early rate gate#1734mikhaellerik4-alt wants to merge 1 commit into
mikhaellerik4-alt wants to merge 1 commit into
Conversation
The early rate gate stamps s_last_process_us before the ADR-060 MAC filter runs, so a frame from any foreign transmitter claims the 20 ms window and is then discarded by the filter -- starving the filtered stream. Measured on an ESP32-C6 locked to its associated AP: 1.7 CSI/s instead of the expected ~20 Hz. Moving the filter above the gate preserves the gate's crash protection (processing is still capped at 50 Hz) while letting the matched transmitter actually fill the slots. With no filter configured (s_filter_mac_set == false) the behaviour is byte-for-byte unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
csi_collector.cruns the ADR-060 MAC filter after the early rate gate. The gate stampss_last_process_usbefore the filter has a chance to run, so a frame from any transmitter claims the 20 ms window and is then dropped by the filter. The matched transmitter's next frame arrives inside the window that the foreign frame just consumed, and gets gated away.The net effect is that configuring
filter_macstarves the very stream it is meant to isolate.Measurement
On an ESP32-C6 (v0.8.4,
sdkconfig.defaults.esp32c6, node locked to its associated AP,--filter-macset to that AP's BSSID):Same board, same room, same channel (2447 MHz), only the ordering changed.
Fix
Move the
s_filter_mac_setcheck above the rate gate.wDev_ProcessFiq) — is preserved: every frame that reaches the gate is still gated.s_filter_mac_set == false) the code path is byte-for-byte unchanged.The filter keeps using the defensively-copied
s_filter_macrather thang_nvs_config, for the same reason as before (thewifi_init_staclobber).Testing
Built with ESP-IDF for
esp32c6and flashed to real hardware; CSI rate verified over a live UDP stream (ADR-0180xC5110001frames) for ~8 minutes of continuous capture. Vitals and sync frames are unaffected.