feat(t1000-e): gps duty cycle — deska ho neměla vůbec

9c033063 spravil persistenci prefs, jenže na T1000-E nebylo co
persistovat: tahle varianta má vlastní T1000SensorManager a celá duty
mašinérie žila jen v EnvironmentSensorManager, který nepoužívá. Slovo
"duty" se ve variants/t1000-e/ nevyskytovalo ani jednou.

Projevilo se to tiše, protože setSettingValue bral všechno nenulové jako
"zapni": `gps:2` tedy vrátilo OK a rozsvítilo GPS naplno. Ověřeno na
a-card — po nastavení i po rebootu hlásila `gps:1`.

Konstanty GPS_DUTY_* se stěhují do SensorManager.h, aby je viděly obě
implementace místo duplikátu.

Jeden záměrný rozdíl proti environment verzi: off-stavem je tady
sleep_gps(), ne stop_gps(). Sleep drží GPS_VRTC_EN, takže si přijímač
nechá almanach a další okno chytá teplý fix; stop shodí i VRTC a platil
by se studený start každých 30 minut — přesně to, čemu se duty vyhýbá.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pwhe5XoCuuEbBCNLvsJBPL
This commit is contained in:
tthandClaude Opus 5 committed 2026-08-31 22:54:07 +02:00
1 parent 29770f1732
commit 7ffb8d0b8f
4 files changed
+82 -20

No files matched your search

+20
View File
@@ -9,6 +9,26 @@
#define TELEM_CHANNEL_SELF 1 // LPP data channel for 'self' device
// GPS duty cycle (`gps duty`, gps_enabled == 2). A repeater that runs GPS only
// for the clock does not need a continuous fix: the receiver is powered just
// long enough to sync the RTC, then cut. On a solar node this is the single
// 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
#endif
#ifndef GPS_DUTY_MAX_AWAKE_SECS
// Cap on one sync attempt: a blocked sky must not turn duty cycle back into
// "always on". A cold fix is tens of seconds, so this is deliberately loose.
#define GPS_DUTY_MAX_AWAKE_SECS 300
#endif
#ifndef GPS_DUTY_RETRY_SECS
// Backoff after a window that produced no fix (antenna, snow, indoors).
#define GPS_DUTY_RETRY_SECS 3600
#endif
class SensorManager {
public:
double node_lat, node_lon; // modify these, if you want to affect Advert location
@@ -4,26 +4,6 @@
#include <helpers/SensorManager.h>
#include <helpers/sensors/LocationProvider.h>
// GPS duty cycle (`gps duty`, gps_enabled == 2). A repeater that runs GPS only
// for the clock does not need a continuous fix: the receiver is powered just
// long enough to sync the RTC, then cut. On a solar node this is the single
// 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
#endif
#ifndef GPS_DUTY_MAX_AWAKE_SECS
// Cap on one sync attempt: a blocked sky must not turn duty cycle back into
// "always on". A cold fix is tens of seconds, so this is deliberately loose.
#define GPS_DUTY_MAX_AWAKE_SECS 300
#endif
#ifndef GPS_DUTY_RETRY_SECS
// Backoff after a window that produced no fix (antenna, snow, indoors).
#define GPS_DUTY_RETRY_SECS 3600
#endif
class EnvironmentSensorManager : public SensorManager {
protected:
static const int MAX_ACTIVE_SENSORS = 16;