Skip to content

Conversation

@ndoo
Copy link
Contributor

@ndoo ndoo commented Dec 5, 2025

  1. 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.

  2. 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

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Other: Heltec T114v2
    • Other: Lilygo T3-S3

@ndoo ndoo changed the title Mapreporting fixes fix(MQTT): Map Reporting fixes Dec 5, 2025
@thebentern thebentern requested a review from Copilot December 5, 2025 17:15
ndoo added 2 commits December 6, 2025 01:27
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]>
Copy link
Contributor

Copilot AI left a 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.

@ndoo
Copy link
Contributor Author

ndoo commented Dec 5, 2025

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.

@ndoo ndoo changed the title fix(MQTT): Map Reporting fixes fix(MQTT): Send first MapReport as soon as possible Dec 5, 2025
Copy link
Member

@fifieldt fifieldt left a 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

@fifieldt fifieldt added the enhancement New feature or request label Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants