Skip to content

Conversation

fifieldt
Copy link
Member

After the recent patch, we hold lock for a bit before updating the position. The positions that come in after the hold are genuinely better positions
than what we've been doing before. However, they only come 20 seconds
after we've got lock.

Previously, we would update the local position as soon as we got a lock as well as at the end of the hold, since a hold was not always possible. With this patch, if the settings allow, we should skip that first local position update.

Fixes #8029

🤝 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:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

@fifieldt
Copy link
Member Author

(untested, and some code can be optimised, back on this in a couple days)

@fifieldt fifieldt added the enhancement New feature or request label Sep 21, 2025
@fifieldt fifieldt requested a review from Copilot September 22, 2025 00:39
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This PR optimizes GPS position updates by implementing a smart hold mechanism that waits for better GPS data before updating the local position, based on the configured update interval. When the GPS update interval is greater than 10 seconds, the system now holds for up to 20 seconds after acquiring a GPS lock to allow for ephemeris data download, resulting in more accurate position fixes.

Key changes:

  • Skip immediate position updates on GPS lock when update interval > 10 seconds
  • Implement conditional hold logic based on GPS update interval settings
  • Restructure GPS state machine logic with clearer documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

fifieldt and others added 4 commits September 22, 2025 10:56
After the recent patch, we hold lock for a bit before updating the position.
The positions that come in after the hold are genuinely better positions
 than what we've been doing before. However, they only come 20 seconds
 after we've got lock.

Previously, we would update the local position as soon as we got a lock as well
as at the end of the hold, since a hold was not always possible.
With this patch, if the settings allow, we should skip that first local position update.

Fixes meshtastic#8029
Co-authored-by: Copilot <[email protected]>
@fifieldt fifieldt requested a review from Copilot September 22, 2025 01:07
Copy link
Contributor

@Copilot 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.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

fifieldt and others added 2 commits September 22, 2025 11:13
@fifieldt fifieldt changed the title [WIP] Wait until after GPS lock hold before updating position, if we can. Wait until after GPS lock hold before updating position, if we can. Sep 27, 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.

Wait until after GPS lock hold before updating position, if we can.
1 participant