-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(MQTT): Send first MapReport as soon as possible #8872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs) is used to maintain the map reporting interval, but because last_report_to_map has an initial value of 0, the map report routine does not start until the system millis() time has passed map_publish_interval_msecs. Fix this by adding a check that last_report_to_map is not 0. Signed-off-by: Andrew Yong <[email protected]>
Do not update last_report_to_map when Map Report is attempted without a valid location, as this results in waiting up to an hour (or configured Map Report interval). That usually happens because most nodes do not keep GPS warm, so GPS usually locks after the first attempt at Map Report. This change also results in the log WARNing message getting spammed until a location is obtained, so remove the message for now. Signed-off-by: Andrew Yong <[email protected]>
1b45418 to
c0ae01e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
|
After discussion with Ixitxachitl on Discord, it looks like Map Reporting does get sent, but only after the millis() timer has passed the first interval. I can't think of any good reason not to send the first possible map report instead of letting the clock tick up to the first interval. So, keeping the code the same, but re-wording the PR and commit to match the actual fix (at least, how I perceive it). Please help to request re-review. |
fifieldt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes logical sense to me
fix(MQTT): First MapReport does not get sent
Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs) is used to maintain the map reporting interval, but because last_report_to_map has an initial value of 0, the map report routine does not start until the system
millis() time has passed map_publish_interval_msecs.
Fix this by adding a check that last_report_to_map is not 0.
feat(MQTT): Send MapReporting immediately upon location fix
Do not update last_report_to_map when Map Report is attempted without a valid location, as this results in waiting up to an hour (or configured Map Report interval).
That usually happens because most nodes do not keep GPS warm, so GPS usually locks after the first attempt at Map Report.
This change also results in the log WARNing message getting spammed until a location is obtained, so remove the message for now.
🤝 Attestations