Skip to content

feat(gps): Do not start gps if lora region is unset#10386

Merged
jp-bennett merged 7 commits into
meshtastic:developfrom
webgeek1234:develop
Jun 28, 2026
Merged

feat(gps): Do not start gps if lora region is unset#10386
jp-bennett merged 7 commits into
meshtastic:developfrom
webgeek1234:develop

Conversation

@webgeek1234

Copy link
Copy Markdown
Contributor

There is little reason to waste battery on the gps if the data cannot yet be used.

🤝 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
      • Seeed Studio Wio Tracker L1 Pro

@CLAassistant

CLAassistant commented May 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added needs-review Needs human review enhancement New feature or request labels May 4, 2026
@jp-bennett jp-bennett requested a review from thebentern May 6, 2026 18:03
@thebentern thebentern requested a review from Copilot May 6, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aims to reduce unnecessary power usage by preventing the GPS subsystem from being initialized when the device’s LoRa region is still UNSET (since radio operation is blocked until a valid region is configured).

Changes:

  • Gate GPS creation during boot on config.lora.region != UNSET.
  • Add logic to create/attach GPS when a region is set later via Admin config updates.
  • Add logic to create/attach GPS when a region is set via the on-device region picker UI.

Reviewed changes

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

File Description
src/main.cpp Prevents GPS initialization at boot when LoRa region is UNSET.
src/modules/AdminModule.cpp Attempts to start GPS after a LoRa region is configured via Admin set-config flow.
src/graphics/draw/MenuHandler.cpp Attempts to start GPS after a LoRa region is selected in the device UI.

Comment thread src/modules/AdminModule.cpp Outdated
Comment thread src/graphics/draw/MenuHandler.cpp Outdated
There is little reason to waste battery on the gps if the data cannot
yet be used.
@webgeek1234

Copy link
Copy Markdown
Contributor Author

I have changed the concept of this change a bit, to avoid the ai reported concerns. Instead of not creating the gps object at all, this now does not stop object creation, but will disable the thread if the lora region is unset.

@webgeek1234

Copy link
Copy Markdown
Contributor Author

@thebentern Any thoughts on this revision?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/modules/AdminModule.cpp
Comment thread src/gps/GPS.h
Comment thread src/gps/GPS.cpp
@webgeek1234

Copy link
Copy Markdown
Contributor Author

It's been another three weeks since any response. Is there any further concerns? If not, this appears to have necessary approvals, so can it be merged?

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Firmware Size Report

22 targets | vs develop: 22 increased, net +175,468 (+171.4 KB)

Target Size vs develop
heltec-vision-master-e213-inkhud 2,227,360 📈 +11,232 (+11.0 KB)
heltec-v4 2,277,296 📈 +9,680 (+9.5 KB)
t-eth-elite 2,491,488 📈 +9,600 (+9.4 KB)
elecrow-adv-35-tft 3,416,624 📈 +9,536 (+9.3 KB)
heltec-v3 2,264,080 📈 +8,864 (+8.7 KB)
Show 17 more target(s)
Target Size vs develop
heltec-ht62-esp32c3-sx1262 2,134,992 📈 +8,848 (+8.6 KB)
tlora-c6 2,368,304 📈 +8,752 (+8.5 KB)
rak11200 1,860,608 📈 +8,624 (+8.4 KB)
seeed-xiao-s3 2,276,144 📈 +8,400 (+8.2 KB)
rak3312 2,272,240 📈 +8,336 (+8.1 KB)
station-g2 2,266,352 📈 +8,160 (+8.0 KB)
station-g3 2,266,352 📈 +8,144 (+8.0 KB)
picow 1,244,880 📈 +7,880 (+7.7 KB)
t-deck-tft 3,810,672 📈 +7,504 (+7.3 KB)
pico2w 1,220,516 📈 +7,448 (+7.3 KB)
seeed_xiao_rp2040 780,904 📈 +7,440 (+7.3 KB)
pico 782,688 📈 +7,424 (+7.2 KB)
rak11310 805,424 📈 +7,256 (+7.1 KB)
seeed_xiao_rp2350 767,936 📈 +7,000 (+6.8 KB)
pico2 769,776 📈 +6,984 (+6.8 KB)
rak3172 186,296 📈 +4,188 (+4.1 KB)
wio-e5 238,628 📈 +4,168 (+4.1 KB)

Updated for a128563

@jp-bennett jp-bennett merged commit 9cef69a into meshtastic:develop Jun 28, 2026
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants