gps duty: sync once a day, retry a failed window after 6 h

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-12 09:49:46 +01:00
1 parent 84e4136a84
commit 3c7d947887
3 files changed
+11 -7

No files matched your search

+2 -2
View File
@@ -1143,8 +1143,8 @@ capped even before the first fix ever, so a node that never sees the sky does
not keep the receiver powered. It sets `gps period` to 0. The position still
comes from prefs (see `set advert.loc`), so duty mode does not affect what a repeater
advertises. `gps on` / `gps off` leave duty mode. Build-time knobs:
`GPS_DUTY_SYNC_INTERVAL_SECS` (1800), `GPS_DUTY_MAX_AWAKE_SECS` (300, the cap on
one attempt) and `GPS_DUTY_RETRY_SECS` (3600, backoff after a window with no fix).
`GPS_DUTY_SYNC_INTERVAL_SECS` (86400), `GPS_DUTY_MAX_AWAKE_SECS` (300, the cap on
one attempt) and `GPS_DUTY_RETRY_SECS` (21600, backoff after a window with no fix).
---
+8 -4
View File
@@ -15,9 +15,11 @@
// biggest lever there is -- an L76K draws 25-35 mA, an order of magnitude more
// than the whole radio + MCU budget it is being spent next to.
#ifndef GPS_DUTY_SYNC_INTERVAL_SECS
// Same cadence as MicroNMEALocationProvider::TIME_SYNC_INTERVAL, so clock
// accuracy is unchanged from `gps on` -- only the power in between differs.
#define GPS_DUTY_SYNC_INTERVAL_SECS 1800
// Once a day. The LF crystal (USE_LFXO) is +-20 ppm, plus ~40 ppm at -10 C:
// ~5 s/day, far below what the mesh notices (replay window, login
// timestamps). A reboot syncs at once regardless (setSettingValue "2").
// 30 min (upstream's TIME_SYNC_INTERVAL) cost 0.25-0.75 mA for nothing.
#define GPS_DUTY_SYNC_INTERVAL_SECS 86400
#endif
#ifndef GPS_DUTY_MAX_AWAKE_SECS
// Cap on one sync attempt: a blocked sky must not turn duty cycle back into
@@ -26,7 +28,9 @@
#endif
#ifndef GPS_DUTY_RETRY_SECS
// Backoff after a window that produced no fix (antenna, snow, indoors).
#define GPS_DUTY_RETRY_SECS 3600
// Each failed window is MAX_AWAKE at 46 mA: hourly that was 3.8 mA, ~16 %
// of a mast node, exactly when snow covers the dome; 6 h makes it 0.64 mA.
#define GPS_DUTY_RETRY_SECS 21600
#endif
class SensorManager {
+1 -1
View File
@@ -98,7 +98,7 @@ void T1000SensorManager::stop_gps() {
// The off-state is stop_gps(), which (AirohaGpsDriver::stop() since the upstream
// GPS refactor) keeps GPS_VRTC_EN asserted and puts the AG3335 into RTC backup sleep,
// so the receiver retains its almanac and the next window gets a warm fix
// instead of a cold start every 30 minutes.
// instead of a cold start in every window.
void T1000SensorManager::gpsDutyLoop() {
if (!gps_duty) return;