firmware: fail closed occupancy and stabilize C6 temporal sensing - #1762
Merged
Conversation
github-actions Bot
pushed a commit
to sijank/RuView
that referenced
this pull request
Sep 1, 2026
…-aware-calibration firmware: fail closed occupancy and stabilize C6 temporal sensing e04f269
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.
Outcome
This change prevents ESP32 person count evidence from contradicting the debounced presence gate and gives temporal filters the measured sample clock they actually receive.
Changes
Enforce
presence=falseimpliesn_persons=0in firmware and repeat the invariant in the sensing server for older nodes.Expose person count validity to WebSocket and node inventory consumers instead of silently accepting contradictory evidence.
Replace the fixed edge sample rate assumption with timestamp window measurement and filter retuning.
Separate the raw CSI network cadence from the C6 Tier 2 DSP cadence. Raw delivery remains independent. C6 defaults to the physically sustained 8 Hz DSP rate. S3 remains at 20 Hz.
Make connected station probing configurable from 10 through 50 Hz with a hard 50 Hz safety ceiling.
Use the selected OTA partition size rather than a stale fixed image ceiling.
Add ADR 346, ADR 347, focused host tests, and two physical validation records.
Measured validation
Physical target: ESP32 C6 QFN40 revision 0.2, logical node 4, firmware 0.8.8.
Five minute serial burn in: 300 controller ticks, raw mean 34.92 pps, range 22 through 41 pps, DSP 8.00 Hz throughout.
Device stability: zero ENOMEM, UDP send failures, other steady state errors, watchdogs, panics, or reboots.
Five minute sensing WebSocket run: 26,786 frames, zero JSON parse errors, zero reconnects, 97.62 percent node 4 coverage, maximum node 4 age 176 ms, maximum frame gap 110 ms, and zero fused presence count contradictions.
Occupancy qualification: 242 edge packets, including 61 absent packets, with zero
presence=falseand nonzero person count contradictions after the fix.Firmware host tests: 59 assertions passed across rate estimation, occupancy evidence, ADR 110 encoding, and mmWave framing.
cargo test -p wifi-densepose-sensing-server: passed, including unit, integration, and documentation targets.ESP IDF 5.4 ARM64 builds: C6 passed at 1,051,552 bytes with 45 percent application headroom. S3 passed at 1,127,104 bytes with 46 percent headroom. The S3 result is compile only because no S3 was attached for runtime qualification.
Qualification boundary
This proves timing, transport stability, and fail closed logical consistency. It does not prove heartbeat, respiration, gesture, pose, identity, or multi person accuracy without synchronized held out labels.
The access point rejected optional iTWT parameters once during boot and firmware selected its documented opportunistic CSI fallback. No iTWT or other error recurred during steady state.
Repository wide
cargo fmt --all -- --checkstill reports extensive preexisting drift across unrelated crates and the sensing server package. No formatting rewrite is included here. The local Xcode toolchain also lackslibclang_rt.fuzzer_osx.a, so the libFuzzer aggregate was not rerun locally.Acceptance test
Repeat the five minute hardware and server capture after timing, WiFi, filtering, or task scheduling changes. Require raw yield of at least 20 pps, DSP within one hertz of configuration, zero device stability errors, zero parser errors or reconnects, fresh node evidence, and zero presence count contradictions.