From 7dbfd5807b917d3a98c9d2113263ad76f5fe257a Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 13 Jun 2019 14:53:59 +0100 Subject: [PATCH] Tweak GPS, but we might have a loose cable somewhere, or a misconfiguration. --- iot/main/gps.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iot/main/gps.cpp b/iot/main/gps.cpp index 8b58f08..2d033ae 100644 --- a/iot/main/gps.cpp +++ b/iot/main/gps.cpp @@ -15,10 +15,13 @@ TinyGPSLocation gps_location() { Serial.print("[gps] Getting location: "); // We WILL discover our location - if it's the last thing we do! while(true) { + if(millis() > 5000 && gps.charsProcessed() < 10) { + Serial.print(F("\n[error] Failed to initialise GPS device.")); + while(true) { delay(1); } + } + // Make sure there's something to read if(serial_gps.available() <= 0) { - Serial.print("!"); - delay(100); continue; }