From cd903dceb91c601984eeafa930f5267fa768775c Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 18 Jun 2020 11:14:25 -0700 Subject: [PATCH 1/3] Fix #187, Ublox GPS fixes, see below: This was a good one. Two problems 1) We've apparently always been using hte sparkfun API the wrong way, but but we mostly got lucky. 2) Changing to use the API correctly (asyncronously) exposed a bug in the library - fixed in a seperate commit --- docs/software/TODO.md | 8 +++----- src/gps/UBloxGPS.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/software/TODO.md b/docs/software/TODO.md index 0b52c70b..5159be83 100644 --- a/docs/software/TODO.md +++ b/docs/software/TODO.md @@ -6,14 +6,12 @@ You probably don't care about this section - skip to the next one. - make new android release - check in our modified arduino binaries - post bug on esp32-arduino +- router mode +- let users set arbitary params in android - encryption review findings writeup -- NRF52 BLE +- NRF52 BLE support - DSR -- turn on modem-sleep mode - https://github.com/espressif/arduino-esp32/issues/1142#issuecomment-512428852 - - - # Medium priority Items to complete before the first beta release. diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index cd400fe7..522b7843 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -86,14 +86,14 @@ void UBloxGPS::doTask() // If we don't have a fix (a quick check), don't try waiting for a solution) // Hmmm my fix type reading returns zeros for fix, which doesn't seem correct, because it is still sptting out positions // turn off for now - // fixtype = ublox.getFixType(); - // DEBUG_MSG("fix type %d\n", fixtype); + fixtype = ublox.getFixType(0); + DEBUG_MSG("GPS fix type %d\n", fixtype); // DEBUG_MSG("sec %d\n", ublox.getSecond()); // DEBUG_MSG("lat %d\n", ublox.getLatitude()); // any fix that has time - if (ublox.getT()) { + if (ublox.getT(0)) { /* Convert to unix time The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). @@ -109,7 +109,7 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s perhapsSetRTC(t); } - if ((fixtype >= 3 && fixtype <= 4) && ublox.getP()) // rd fixes only + if ((fixtype >= 3 && fixtype <= 4) && ublox.getP(0)) // rd fixes only { // we only notify if position has changed latitude = ublox.getLatitude(); From 35aae48932814fbd2a0675b303831b934bae9f55 Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 18 Jun 2020 11:18:53 -0700 Subject: [PATCH 2/3] 0.7.7 --- bin/version.sh | 2 +- docs/software/TODO.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/version.sh b/bin/version.sh index 1ff41ed0..c9bcc774 100644 --- a/bin/version.sh +++ b/bin/version.sh @@ -1,3 +1,3 @@ -export VERSION=0.7.6 \ No newline at end of file +export VERSION=0.7.7 \ No newline at end of file diff --git a/docs/software/TODO.md b/docs/software/TODO.md index 5159be83..5c80d8a6 100644 --- a/docs/software/TODO.md +++ b/docs/software/TODO.md @@ -2,7 +2,6 @@ You probably don't care about this section - skip to the next one. -- fix hasGPS bug - make new android release - check in our modified arduino binaries - post bug on esp32-arduino From c25d6e974f7b8f9f74fb1c95f2f6337372d22eaf Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 18 Jun 2020 11:22:38 -0700 Subject: [PATCH 3/3] sometimes first read might return 0 for EITHER lat or lon --- src/gps/UBloxGPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index 522b7843..472dba1c 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -117,7 +117,7 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s altitude = ublox.getAltitude() / 1000; // in mm convert to meters DEBUG_MSG("new gps pos lat=%f, lon=%f, alt=%d\n", latitude * 1e-7, longitude * 1e-7, altitude); - hasValidLocation = (latitude != 0) || (longitude != 0); // bogus lat lon is reported as 0,0 + hasValidLocation = (latitude != 0) && (longitude != 0); // bogus lat lon is reported as 0 or 0 (can be bogus just for one) if (hasValidLocation) { wantNewLocation = false; notifyObservers(NULL);