Skip to content

fix(gps): remember valid fixes across search cycle - #11697

Merged
caveman99 merged 2 commits into
meshtastic:developfrom
lnx13:fix/gps-search-cycle-valid-fix
Sep 2, 2026
Merged

fix(gps): remember valid fixes across search cycle#11697
caveman99 merged 2 commits into
meshtastic:developfrom
lnx13:fix/gps-search-cycle-valid-fix

Conversation

@lnx13

@lnx13 lnx13 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

fixes #11693

🤝 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)
      RAK WisMesh Tag

Summary by CodeRabbit

  • Bug Fixes
    • Improved GPS search-cycle tracking to reliably recognize when a valid location fix is acquired.
    • Improved coordination between GPS fix detection and update scheduling, helping ensure location updates are handled consistently.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@lnx13, Welcome to Meshtastic!

Thanks for opening your first pull request. We really appreciate it.

We discuss work as a team in discord, please join us in the #firmware channel.
There's a big backlog of patches at the moment. If you have time,
please help us with some code review and testing of other PRs!

Welcome to the team 😄

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 87d304e9-9353-4e29-949f-512f75c906da

📥 Commits

Reviewing files that changed from the base of the PR and between fca4fa8 and cb8e6ba.

📒 Files selected for processing (3)
  • src/gps/GPS.cpp
  • src/gps/GPSUpdateScheduling.cpp
  • src/gps/GPSUpdateScheduling.h

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

GPS scheduling records valid fixes during active search cycles and clears the state at search or scheduler reset. GPS acquisition reports fixes to the scheduler. Timeout and lock decisions use the scheduler’s search-scoped fix state.

Changes

GPS valid-fix tracking

Layer / File(s) Summary
Scheduling state tracking
src/gps/GPSUpdateScheduling.h, src/gps/GPSUpdateScheduling.cpp
GPSUpdateScheduling tracks valid fixes during active searches. It clears the state when searching or resetting, records fixes only while searching, and exposes a const query.
GPS fix and timeout integration
src/gps/GPS.cpp
GPS::runOnce() reports acquired fixes to the scheduler. GPS::runOnce() and GPS::down() use the scheduler’s valid-fix state for timeout and lock decisions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to cb8e6

This change remembers valid GPS fixes through a search cycle so successful locks are preserved, but disabling GPS during an active search can temporarily leave scheduler state out of sync with the powered-down hardware. The PR is mergeable with owner awareness or follow-up to explicitly reset or terminate the search state on disable.

Suggested reviewers: thebentern, caveman99, ndoo

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: retaining valid GPS fixes during a search cycle.
Description check ✅ Passed The description includes the issue reference, test confirmation, regression-test attestation, and tested hardware. The listed device checkboxes are not required because the author specified the tested…
Linked Issues check ✅ Passed The changes directly address issue #11693 [#11693] by recording valid fixes during the active search and using that state in GPS timeout decisions. The implementation supports retaining valid local an…
Out of Scope Changes check ✅ Passed All changes are limited to GPS search-state tracking and its integration with GPS fix handling. No unrelated changes are present.
Full details: Description check

Explanation

The description includes the issue reference, test confirmation, regression-test attestation, and tested hardware. The listed device checkboxes are not required because the author specified the tested RAK WisMesh Tag under Other.

Full details: Linked Issues check

Explanation

The changes directly address issue #11693 [#11693] by recording valid fixes during the active search and using that state in GPS timeout decisions. The implementation supports retaining valid local and remote fixes across the search cycle.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@caveman99
caveman99 enabled auto-merge September 2, 2026 07:53
@caveman99
caveman99 added this pull request to the merge queue Sep 2, 2026
Merged via the queue into meshtastic:develop with commit 4cb912f Sep 2, 2026
59 of 60 checks passed
Amoulier added a commit to Amoulier/meshtastic-superbase-firmware that referenced this pull request Sep 7, 2026
Separate one-time SoftDevice and service setup from runtime advertising. Restore TX power and pairing security, including NO_PIN MITM state, on enable; disable restart-on-disconnect before stopping links. Keep PowerFSM subject to the saved user preference.

Adapt the BLE security and nonblocking pairing fixes from upstream master b7e0dc3 (meshtastic#10859). Initial audit: local base 8515144 (firmware identical to validated cc704b8); upstream develop 5920d05, master 6d41e27. Preserve prior selective fixes meshtastic#11651, meshtastic#11659, meshtastic#11671, meshtastic#11676, meshtastic#11678, meshtastic#11686, meshtastic#11688, meshtastic#11697 and meshtastic#11709. No broad merge or dependency updates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: GPS search times out after 300s despite valid fixes with gps_update_interval <= 10s

3 participants