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:
1 parent
84e4136a84
commit
3c7d947887
3 files changed
+11
-7
No files matched your search
@@ -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
|
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
|
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:
|
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
|
`GPS_DUTY_SYNC_INTERVAL_SECS` (86400), `GPS_DUTY_MAX_AWAKE_SECS` (300, the cap on
|
||||||
one attempt) and `GPS_DUTY_RETRY_SECS` (3600, backoff after a window with no fix).
|
one attempt) and `GPS_DUTY_RETRY_SECS` (21600, backoff after a window with no fix).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,11 @@
|
|||||||
// biggest lever there is -- an L76K draws 25-35 mA, an order of magnitude more
|
// 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.
|
// than the whole radio + MCU budget it is being spent next to.
|
||||||
#ifndef GPS_DUTY_SYNC_INTERVAL_SECS
|
#ifndef GPS_DUTY_SYNC_INTERVAL_SECS
|
||||||
// Same cadence as MicroNMEALocationProvider::TIME_SYNC_INTERVAL, so clock
|
// Once a day. The LF crystal (USE_LFXO) is +-20 ppm, plus ~40 ppm at -10 C:
|
||||||
// accuracy is unchanged from `gps on` -- only the power in between differs.
|
// ~5 s/day, far below what the mesh notices (replay window, login
|
||||||
#define GPS_DUTY_SYNC_INTERVAL_SECS 1800
|
// 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
|
#endif
|
||||||
#ifndef GPS_DUTY_MAX_AWAKE_SECS
|
#ifndef GPS_DUTY_MAX_AWAKE_SECS
|
||||||
// Cap on one sync attempt: a blocked sky must not turn duty cycle back into
|
// Cap on one sync attempt: a blocked sky must not turn duty cycle back into
|
||||||
@@ -26,7 +28,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#ifndef GPS_DUTY_RETRY_SECS
|
#ifndef GPS_DUTY_RETRY_SECS
|
||||||
// Backoff after a window that produced no fix (antenna, snow, indoors).
|
// 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
|
#endif
|
||||||
|
|
||||||
class SensorManager {
|
class SensorManager {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ void T1000SensorManager::stop_gps() {
|
|||||||
// The off-state is stop_gps(), which (AirohaGpsDriver::stop() since the upstream
|
// 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,
|
// 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
|
// 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() {
|
void T1000SensorManager::gpsDutyLoop() {
|
||||||
if (!gps_duty) return;
|
if (!gps_duty) return;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user