Read the Environment count from AngryOxide's capture file, not its database #108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/environment-from-capture-file"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this PR does
Fixes the dashboard's Environment card going to "Unknown – Scanning the area…" in a busy area while capture keeps working. The collector now reads the in-range count from the tail of AngryOxide's pcapng capture file instead of AngryOxide's kismet database.
Why. AngryOxide v0.9.3 inserts and commits one kismet-database row per frame. On a Pi 5's SD card, with about 600 radios in range, that topped out around 66 rows/s while about 220 frames/s arrived. Over a 17.5-minute capture the database held only the first 5.4 minutes of frames. The collector read the database's newest data, so the reading fell further behind every minute and aged out to "Unknown", while capture itself (handshakes are separate files) never missed a beat. The pcapng is a plain append and keeps up.
Change (
capture-collect.py):*.pcapng(the current launch's and, across an agent relaunch, the previous one's). Every poll it parses only the blocks added since: SHB/IDB/EPB, little- or big-endian, honouringif_tsresol. It counts each frame's 802.11 transmitter address (addr2: management and data frames, plus BlockAckReq/BlockAck/PS-Poll/RTS; group and null addresses excluded).radios_recentanddata_tskeep the same shape and meaning, so the daemon, dashboard, e-ink face and capture interface (contract v3) are unchanged.capture-interface.md(howradios_recentis derived),agent-interface.md, and comments inconfig.toml,capture-launch.sh,capture.py,daemon.pyandweb.py. The deferred entry "Confirm the collector can still read the Kismet database" is removed: this resolves it (the cause was the database's lag, not WAL mode).Validated on the device
The new parser was run on the real capture file from the run where the card went "Unknown" (counts only, no addresses leaving the device):
Checklist
make lintpasses locally.make test: the full suite passed on the branch before the rebase (1,451; the one failure,test_gps_serial_reader_recovers_from_a_stalled_link, fails the same way onmain). After rebasing, the collector, capture, daemon and web tests pass (345).test_capture_collect.pyis rewritten around invented pcapng files: counts in the window, only new frames per poll, a partial block, catching up over several polls, the previous run's file, at most two files, a replaced file, big-endian and nanosecond timestamps, a non-pcapng file, the carried reading, and a test that fails if the collector ever opens the kismet database again.piand only reads root's run dir (root:pi 0750); it writes nothing there.Release impact
capture-collect.pyandcapture-launch.share in the engine'sLIB_SCRIPTS; the rest is thekestrel_pipackage and docs. Theconfig.tomlchange is comments only, so updated devices keep their file with no effect.Notes for review
🤖 Generated with Claude Code