Skip to content

Set the time from GPS every 30 minutes#10737

Merged
jp-bennett merged 1 commit into
masterfrom
tva-work
Jun 17, 2026
Merged

Set the time from GPS every 30 minutes#10737
jp-bennett merged 1 commit into
masterfrom
tva-work

Conversation

@jp-bennett

Copy link
Copy Markdown
Collaborator

Our security work with disallowing loopback to modules unintentionally meant that we were never updating time from GPS after first boot. This corrects that problem, and further decreases the update time to 30 minutes.

@jp-bennett jp-bennett added the bugfix Pull request that fixes bugs label Jun 17, 2026
@jp-bennett jp-bennett requested a review from Copilot June 17, 2026 21:34
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Flash this PR in the Web Flasher

firmware commit boards expires

Warning

This is an automated, unreviewed CI test build. Back up your device configuration
before flashing, and only flash devices you are able to recover.

Supported boards built by this PR (22)
Device Board Platform
Crowpanel Adv 3.5 TFT elecrow-adv-35-tft esp32-s3
Heltec HT62 heltec-ht62-esp32c3-sx1262 esp32-c3
Heltec Mesh Node 096 heltec-mesh-node-t096 nrf52840
Heltec Mesh Node T1 heltec-mesh-node-t1 nrf52840
Heltec Mesh Node T114 heltec-mesh-node-t114 nrf52840
Heltec V3 heltec-v3 esp32-s3
Raspberry Pi Pico pico rp2040
Raspberry Pi Pico W picow rp2040
RAK WisBlock 11200 rak11200 esp32
RAK WisBlock 11310 rak11310 rp2040
RAK3312 rak3312 esp32-s3
RAK WisBlock 4631 rak4631 nrf52840
Seeed Xiao NRF52840 Kit seeed_xiao_nrf52840_kit nrf52840
Seeed SenseCAP Indicator seeed-sensecap-indicator-tft esp32-s3
Seeed Xiao ESP32-S3 seeed-xiao-s3 esp32-s3
Station G2 station-g2 esp32-s3
Station G3 station-g3 esp32-s3
LILYGO T-Deck t-deck-tft esp32-s3
LILYGO T-Echo t-echo nrf52840
LILYGO T-Echo Plus t-echo-plus nrf52840
LILYGO T-Impulse Plus t-impulse-plus nrf52840
Seeed SenseCAP T1000-E tracker-t1000-e nrf52840

Build artifacts expire on 2026-07-17. Updated for db2e702.

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 restore periodic RTC time updates from GPS after a prior security change prevented re-updating time beyond first boot, and it reduces the external time (NTP/phone-provided) reapply interval to 30 minutes to better correct RTC drift.

Changes:

  • Reduced the NTP/phone “reapply external time” throttle window from 12 hours to 30 minutes in perhapsSetRTC().
  • Added a GPS::gotTime member and reset logic so GPS time acquisition can occur again after the initial boot-time set.
  • Adjusted GPS::setPowerState() and GPS::runOnce() flow to treat “got time” as a per-cycle state rather than a local, recomputed variable.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/gps/RTC.cpp Shortens the NTP/phone time reapply throttle from 12h to 30m.
src/gps/GPS.h Introduces gotTime state to persist “time acquired” across runOnce() iterations.
src/gps/GPS.cpp Resets/uses gotTime to allow GPS time setting beyond first boot.

Comment thread src/gps/GPS.cpp
Comment on lines +1148 to 1151
// 1. Got a time for the first time this cycle
if (!gotTime && lookForTime()) { // Note: we count on this && short-circuiting and not resetting the RTC time
gotTime = true;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it missed the stuff in rtc.cpp.

@jp-bennett jp-bennett requested a review from thebentern June 17, 2026 22:57
@jp-bennett jp-bennett merged commit 8ba9d0d into master Jun 17, 2026
87 of 88 checks passed
@jp-bennett jp-bennett deleted the tva-work branch June 17, 2026 23:52
raghumad pushed a commit to raghumad/mezulla-firmware that referenced this pull request Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants