feat(server): per-link CSI metrics keyed by (receiver, transmitter) - #1828
Open
clonea1 wants to merge 2 commits into
Open
feat(server): per-link CSI metrics keyed by (receiver, transmitter)#1828clonea1 wants to merge 2 commits into
clonea1 wants to merge 2 commits into
Conversation
The frame parser accepts one magic (0xC5110001) and a fixed 20-byte header, so
a frame carrying transmitter or transmission identity is rejected outright.
That makes it impossible for a node to tell the server anything about WHICH
link a measurement belongs to, or WHICH transmission produced it.
Adds named constants for the three wire versions and dispatches on the magic:
v1 0xC5110001 20-byte header, unchanged
v2 0xC5110008 + transmitter MAC (addr2) at bytes 20..25
v3 0xC511000A + 802.11 rx_seq (u16 LE) at bytes 26..27
Esp32Frame gains source_mac and rx_seq, both Option, both None for a v1 frame.
A mixed fleet therefore keeps working: older firmware parses exactly as before
and newer firmware simply carries more.
This is the receiver half of the wire change and should land BEFORE any
firmware starts emitting v2/v3, so there is never a moment where a node sends
something the server rejects.
It is also a prerequisite for two follow-on changes that cannot work without
per-frame identity: per-link CSI state keyed on (receiver, transmitter), and
cross-node pairing keyed on (transmitter, rx_seq).
Co-Authored-By: claude-flow <ruv@ruv.net>
Adds a LinkTable that accumulates CSI per (rx_node, tx_mac) pair, and runs it BEFORE the existing per-node subcarrier-grid gate. The gate locks each node to the densest grid it has seen. A node associates with one AP and receives HE-SU data from it at 256 bins, while everything else it merely overhears sends beacons and management frames at 64. The lock therefore always settles on the associated AP's format, and every non-associated transmitter is sparser BY CONSTRUCTION -- dropped by a bare continue before it can become a link. Grid consistency is a property of the TRANSMITTER, so it belongs on the link rather than the node. LinkTable applies the same densest-wins policy per (rx_node, tx_mac). The existing gate is NOT modified. The per-node feature path behaves exactly as before; the link path simply runs ahead of the continue, so a frame the node path cannot use stays available to consumers that can. MEASURED 2026-09-01, before -> after: links 31 -> 137 transmitters 10 -> 32 renderable 29 -> 88 grids in use 256 only -> 64:97, 256:33, 128:7 illuminators with two or more receivers: 1 -> 24 97 of the 137 recovered links are 64-bin: precisely the population being discarded. No firmware, hardware or network change -- the frames were always arriving. Adds GET /api/v1/links and GET /api/v1/links/inventory. The inventory endpoint reports the table's full contents including links the metrics view omits, with the reason for each, because that filter_map dropped links silently. Co-Authored-By: claude-flow <ruv@ruv.net>
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.
Adds a LinkTable that accumulates CSI per (rx_node, tx_mac) pair, and runs it
BEFORE the existing per-node subcarrier-grid gate.
The gate locks each node to the densest grid it has seen. A node associates
with one AP and receives HE-SU data from it at 256 bins, while everything else
it merely overhears sends beacons and management frames at 64. The lock
therefore always settles on the associated AP's format, and every
non-associated transmitter is sparser BY CONSTRUCTION -- dropped by a bare
continue before it can become a link.
Grid consistency is a property of the TRANSMITTER, so it belongs on the link
rather than the node. LinkTable applies the same densest-wins policy per
(rx_node, tx_mac).
The existing gate is NOT modified. The per-node feature path behaves exactly
as before; the link path simply runs ahead of the continue, so a frame the
node path cannot use stays available to consumers that can.
MEASURED 2026-09-01, before -> after:
links 31 -> 137 transmitters 10 -> 32
renderable 29 -> 88 grids in use 256 only -> 64:97, 256:33, 128:7
illuminators with two or more receivers: 1 -> 24
97 of the 137 recovered links are 64-bin: precisely the population being
discarded. No firmware, hardware or network change -- the frames were always
arriving.
Adds GET /api/v1/links and GET /api/v1/links/inventory. The inventory endpoint
reports the table's full contents including links the metrics view omits, with
the reason for each, because that filter_map dropped links silently.
Rebased onto current
main. Two conflicts inmain.rs, both purely additive and resolved by keeping both sides:mainhas since gained the room-debounce fields (#1793) where this branch addslink_table. Compiles clean and the server test suite passes.