From e961d5461dab0c0141115b51dfed18d8cfa02204 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 12 Oct 2019 23:10:01 +0200 Subject: [PATCH 1/3] Avoid early GPS init failure When there is no serial input on first enter of loop(), the GPS was turned off. We can do better and wait some more time until the first measurement, as it might take up to 2s for the first GPS data to arrive. --- airrohr-firmware/airrohr-firmware.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index f805c5518..421fd967b 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -3328,7 +3328,7 @@ static void fetchSensorGPS(String& s) { add_Value2Json(s, F("GPS_time"), last_value_GPS_time); } - if ( gps.charsProcessed() < 10) { + if ( count_sends > 0 && gps.charsProcessed() < 10) { debug_outln_error(F("No GPS data received: check wiring")); gps_init_failed = true; } From 011ee31843406bbc5ccd6636655f81e6a13d458c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 12 Oct 2019 23:27:16 +0200 Subject: [PATCH 2/3] Also accept Si7072 for Htu21d This one has a different sensor id of 0x3A instead of 0x02, so we need to test successful sample reading until the HTU21D library has been fixed. --- airrohr-firmware/airrohr-firmware.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 421fd967b..9107b18ce 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -3934,7 +3934,9 @@ static void powerOnTestSensors() { if (cfg::htu21d_read) { debug_outln_info(F("Read HTU21D...")); - if (!htu21d.begin()) { + // begin() might return false when using Si7021 + // so validate reading via Humidity (will return 0.0 when failed) + if (!htu21d.begin() && htu21d.readHumidity() < 1.0f) { debug_outln_error(F("Check HTU21D wiring")); htu21d_init_failed = true; } From 40a679f2c10b688efa677ca1c2717e465c0f821b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 12 Oct 2019 23:29:49 +0200 Subject: [PATCH 3/3] Fix GPS and Si7021 regression (Fixes #513) --- airrohr-firmware/Versions.md | 4 ++++ airrohr-firmware/airrohr-firmware.ino | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/airrohr-firmware/Versions.md b/airrohr-firmware/Versions.md index 8efe03557..c4a4b5306 100644 --- a/airrohr-firmware/Versions.md +++ b/airrohr-firmware/Versions.md @@ -1,3 +1,7 @@ +NRZ-2019-124-B9 +* Handle Si7021 for HTU21d replacement +* Fix GPS regression + NRZ-2019-124-B8 * bug fixes * translation updates diff --git a/airrohr-firmware/airrohr-firmware.ino b/airrohr-firmware/airrohr-firmware.ino index 9107b18ce..28fc08ee9 100644 --- a/airrohr-firmware/airrohr-firmware.ino +++ b/airrohr-firmware/airrohr-firmware.ino @@ -105,7 +105,7 @@ * ************************************************************************/ // increment on change -#define SOFTWARE_VERSION_STR "NRZ-2019-124-B8" +#define SOFTWARE_VERSION_STR "NRZ-2019-124-B9" const String SOFTWARE_VERSION(SOFTWARE_VERSION_STR); /*****************************************************************