Repository navigation
fix: never start a scan window while MQTT is still sending - #12
Merged
Merged
Conversation
Raise the send window limit to 500 ms. When a send window has not drained by then, keep waiting and count an overrun instead of starting the next scan. Drained now also means the broker has acknowledged every TCP segment, so TCP has nothing left to resend during a scan. Firmware 0.1.1.
10 minutes in a crowded room on 0.1.1: MQTT no longer lands in scan windows, but send windows took up to 5 s and BLE latency p95 reached 4.6 s. The firmware docs describe the new send window rule.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What this changes
Firmware 0.1.1:
SEND_WINDOW_MAX_MSgoes from 300 to 500 ms.SEND_OVERRUN_GIVE_UP_MS) it hands back to the reconnect checks, and the main loop still only starts a scan once MQTT has drained.mqtt_link_drained()now also requires that TCP has no unacknowledged segments, so TCP has nothing it could resend during a scan.Plus
docs/results/2026-10-27-send-window-500/report.md, anddocs/firmware.mdupdated for the new rule.How it was tested
10 minutes on unit N1 in a crowded room (116 devices heard), see the report:
tx_in_scanwas 3 in 600 s, all at the same 5-minute rhythm seen yesterday, one of them in a 10 s stretch with no overrun. So they are network housekeeping (probably ARP), not MQTT. Before, on 0.1.0, it was 6 in 10 s.python -m pytest: 120 passed. The firmware builds locally. The firmware host tests run in CI (no host C compiler on this laptop).INVIGIL_DEBUG_RAW_ADDRis 0.Checklist
python -m pytestfeat:,fix:,docs:,test:,chore:)