Repository navigation
Dispatcher: skip the periodic AGC reset while packets are being received - #3752
Open
AlexandrTyshchenko wants to merge 1 commit into
Open
AlexandrTyshchenko wants to merge 1 commit into
AlexandrTyshchenko wants to merge 1 commit into
Conversation
A reset takes the radio off the air. As in Meshtastic (develop), skip the periodic reset if a packet was decoded within the last reset interval or a packet is queued for transmit; the gain is not stuck then. Still reset at least once per AGC_FORCED_RESET_MILLIS (default 24 h). Only matters when agc.reset.interval > 0.
This branch has not been 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.
Problem
With
agc.reset.interval> 0,Dispatcher::loop()callsresetAGC()on a fixed timer(restarted only after a TX). Each reset puts the radio into warm sleep, recalibrates and
re-arms RX, so the node is deaf for that time. On a busy channel this costs packets every
interval, although the gain cannot be stuck: packets are still being decoded.
Change
When the AGC timer fires:
(the gain is fine), or if a packet is queued for transmit;
AGC_FORCED_RESET_MILLIS(default 24 h, overridablebuild flag), and on the first tick after boot;
"Valid packet" means one that passed
tryParsePacket()(set right afterlogRx()), socorrupt/garbage receptions don't count as hearing.
This is the same logic Meshtastic uses on
develop(
RadioLibInterface::periodicRadioMaintenance(): check every 60 s, reset only if nothingwas decoded for
AGC_IDLE_RESET_MS= 60 s, forced everyAGC_FORCED_RESET_MS= 24 h,never with TX queued). Here the idle window is the configured
agc.reset.intervalitself.Nodes with
agc.reset.interval 0(the default) are not affected.MESH_DEBUGbuilds logeach decision (
AGC reset/AGC reset skipped, last rx N ms ago/... tx queued).Testing
ProMicro nRF52840 + E22-400M22S (SX1268), repeater,
MESH_DEBUG,agc.reset.interval 8:(
last rx 923 ms ago,last rx 1673 ms ago);agc.reset.interval 60.Builds:
ProMicro_repeater,RAK_4631_repeater,Heltec_v3_repeater.Not tested: the 24 h forced reset (logic only), and the "TX queued" branch was not hit
in the bench run.
Notes
forceResetAGC(); the two are independent and wouldmerge with a trivial conflict.
the reset).