Add opt-in low power Sensor dog tracking

Acquire fresh GPS and validated UTC, check an authenticated owner Companion, and apply saved lost-status cadence with bounded awake windows. Persist request tags, routes, and six-hour flood reservations; preserve the four-day cutoff across sleep and restart.

Keep Dispatcher recovery active after a failed radio wake, honor denied flood retries after lost TxDone, and qualify GPS ownership and clock corrections. Add executable regression tests and nRF52/ESP32 Sensor build jobs.

Validation: six firmware builds, 1829 native test cases, sanitized tracker/storage/GPS/sleep/recovery tests, and strict documentation build. Bluetooth Find My advertising and automatic Room mailbox polling remain separate work.
This commit is contained in:
mikecarper committed 2026-10-10 20:08:58 -07:00
1 parent 90b12f6fa3
commit 1f1a499482
43 files changed
+4684 -17

No files matched your search

@@ -419,6 +419,7 @@ class RAK12500LocationProvider : public LocationProvider {
int _sats = 0;
long _epoch = 0;
bool _fix = false;
bool _fresh_position_requested = false;
mesh::RTCClock* _clock = NULL;
unsigned long _next_time_check = 0;
unsigned long _last_time_sync = 0;
@@ -436,6 +437,13 @@ public:
long getAltitude() override { return _alt; }
long satellitesCount() override { return _sats; }
bool isValid() override { return _fix; }
bool clearPositionFix() override {
_fix = false;
_fresh_position_requested = true;
_next_time_check = 0;
ublox_GNSS.flushPVT();
return true;
}
long getTimestamp() override { return _epoch; }
void sendSentence(const char * sentence) override { }
void reset() override {
@@ -448,6 +456,8 @@ public:
_sats = 0;
_epoch = 0;
_fix = false;
_fresh_position_requested = false;
_fresh_time_sync_required = false;
_next_time_check = 0;
_last_time_sync = 0;
_valid_time_samples = 0;
@@ -463,6 +473,18 @@ public:
if ((int32_t)(now - _next_time_check) >= 0) {
_next_time_check = now + 1000;
if (_fresh_position_requested || _fresh_time_sync_required) {
// The library's scalar getters can return retained data even when
// their implicit PVT poll fails. Require a successfully received PVT
// before exposing a position for this tracker acquisition.
ublox_GNSS.flushPVT();
if (!ublox_GNSS.getPVT(8)) {
_fix = false;
_valid_time_samples = 0;
return;
}
_fresh_position_requested = false;
}
if (ublox_GNSS.getGnssFixOk(8)) {
_fix = true;
_lat = ublox_GNSS.getLatitude(2) / 10;
@@ -1156,6 +1178,10 @@ void EnvironmentSensorManager::setPowerSavingEnabled(bool enabled) {
#if ENV_INCLUDE_GPS
if (!gps_detected) return;
if (isTrackerGpsModeEnabled()) {
_location->setGPSPowerSaving(false);
return;
}
bool gps_user_enabled = isGpsTelemetryUserEnabled();
#if defined(RAK_WISBLOCK_GPS) && defined(FORCE_GPS_ALIVE)
if (serialGPSFlag) {