fix(firmware): recover the ESP-NOW send path instead of wedging on it - #1820
Open
clonea1 wants to merge 1 commit into
Open
fix(firmware): recover the ESP-NOW send path instead of wedging on it#1820clonea1 wants to merge 1 commit into
clonea1 wants to merge 1 commit into
Conversation
esp_now_send() failures were counted and otherwise ignored, and a send whose
completion callback never fires leaves the in-flight counter permanently above
its limit. Once that happens the node stops beaconing for the rest of its boot:
every subsequent send is refused by its own back-pressure check, nothing ever
decrements the counter, and there is no path back. The node looks alive, keeps
capturing CSI, and silently stops participating in mesh time sync.
Three guards, all bounded:
ESPNOW_STALL_US a send in flight with no callback for a second is
treated as lost rather than waited on forever
ESPNOW_MAX_INFLIGHT back-pressure, so a stalled peer cannot queue
without limit
ESPNOW_FAIL_BEFORE_RECOVERY consecutive hard failures trigger a deinit/init
cycle rather than an unbounded retry loop
espnow_recover() takes a reason string and logs it, because a node that
recovers silently is indistinguishable from one that never had a problem, and
the distinction matters when deciding whether a site has an RF issue.
Deliberately excluded: deriving the beacon period from the provisioned fleet
size is a separate concern that happened to land in the same commit locally.
This branch keeps the fixed BEACON_PERIOD_MS.
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.
esp_now_send() failures were counted and otherwise ignored, and a send whose
completion callback never fires leaves the in-flight counter permanently above
its limit. Once that happens the node stops beaconing for the rest of its boot:
every subsequent send is refused by its own back-pressure check, nothing ever
decrements the counter, and there is no path back. The node looks alive, keeps
capturing CSI, and silently stops participating in mesh time sync.
Three guards, all bounded:
ESPNOW_STALL_US a send in flight with no callback for a second is
treated as lost rather than waited on forever
ESPNOW_MAX_INFLIGHT back-pressure, so a stalled peer cannot queue
without limit
ESPNOW_FAIL_BEFORE_RECOVERY consecutive hard failures trigger a deinit/init
cycle rather than an unbounded retry loop
espnow_recover() takes a reason string and logs it, because a node that
recovers silently is indistinguishable from one that never had a problem, and
the distinction matters when deciding whether a site has an RF issue.
Deliberately excluded: deriving the beacon period from the provisioned fleet
size is a separate concern that happened to land in the same commit locally.
This branch keeps the fixed BEACON_PERIOD_MS.
Rebased onto current
mainbefore opening: staged before today's seven merges, so it needed replaying to avoid reading as a revert of them. Clean rebase, no files deleted.