From d1cb45aa5d5ad46103bfc1c054df7f27ffefaf66 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 4 Apr 2020 18:46:19 -0700 Subject: [PATCH 1/3] string typo --- src/MeshRadio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MeshRadio.cpp b/src/MeshRadio.cpp index 123cbb37d..1f7d20d43 100644 --- a/src/MeshRadio.cpp +++ b/src/MeshRadio.cpp @@ -138,7 +138,7 @@ void MeshRadio::loop() // into CustomRF95 uint32_t now = millis(); if (lastTxStart != 0 && (now - lastTxStart) > TX_WATCHDOG_TIMEOUT && radioIf.mode() == RHGenericDriver::RHModeTx) { - DEBUG_MSG("ERROR! Bug! Tx packet took too long to send, forcing radio into rx mode"); + DEBUG_MSG("ERROR! Bug! Tx packet took too long to send, forcing radio into rx mode\n"); radioIf.setModeRx(); if (radioIf.sendingPacket) { // There was probably a packet we were trying to send, free it radioIf.pool.release(radioIf.sendingPacket); From 07a8972aea39dc271dd42ed4216195a3871d005c Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 4 Apr 2020 18:47:41 -0700 Subject: [PATCH 2/3] NEO-6M gps with empty backup batteries give super invalid times --- src/GPS.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GPS.cpp b/src/GPS.cpp index 3265b9ddf..5312d97a5 100644 --- a/src/GPS.cpp +++ b/src/GPS.cpp @@ -176,8 +176,10 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s tv.tv_usec = 0; // time.centisecond() * (10 / 1000); DEBUG_MSG("Got time from GPS month=%d, year=%d, unixtime=%ld\n", t.tm_mon, t.tm_year, tv.tv_sec); - - perhapsSetRTC(&tv); + if (t.tm_year < 0 || t.tm_year >= 300) + DEBUG_MSG("Ignoring invalid GPS time\n"); + else + perhapsSetRTC(&tv); } if ((fixtype >= 3 && fixtype <= 4) && ublox.getP()) // rd fixes only From 63e1a3f47edc1251dff51276c73dd693720c0483 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 4 Apr 2020 19:16:30 -0700 Subject: [PATCH 3/3] always set time from GPS if we can --- src/GPS.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/GPS.cpp b/src/GPS.cpp index 5312d97a5..8ca8dd36b 100644 --- a/src/GPS.cpp +++ b/src/GPS.cpp @@ -6,8 +6,7 @@ HardwareSerial _serial_gps(GPS_SERIAL_NUM); -RTC_DATA_ATTR bool timeSetFromGPS; // We only reset our time once per _boot_ after that point just run from the internal clock - // (even across sleeps) +bool timeSetFromGPS; // We try to set our time from GPS each time we wake from sleep GPS gps;