Check for ntp clock shift when scheduling next beacon. #301
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.
See #206 for details and logs.
According to beacon.c, if the system clock shifts forward, direwolf will emit all the pbeacons it missed during that interval all at once, until it's caught up. For example, if the internet is unavailable during boot, ntp cannot update the system time. Direwolf then starts, the internet becomes available, and ntp shifts the clock foward three hours. If direwolf is configured to send a pbeacon every 20 minutes, it will quickly send nine consecutive pbeacons (observed).
beacon.c is where the bug exists. Pbeacons should, in fact, be relative to "now" if the system clock shifted forward. If the next scheduled beacon is in the past, then set it relative to the new now. This prevents all the catchup beacons after a system time change.
On a raspberry pi with a read-only filesystem, the NTP jump can be months, effectively jamming the transmitter on for hours. (observed)