diff --git a/iot/GPSTest/GPSTest.ino b/iot/GPSTest/GPSTest.ino index 4d1f9a0..7f79dbd 100644 --- a/iot/GPSTest/GPSTest.ino +++ b/iot/GPSTest/GPSTest.ino @@ -2,8 +2,8 @@ #include // NOTE: RX and TX must be swapped with respect to the pin definitions on the NE-6M itself. -#define PIN_GPS_RX 4 -#define PIN_GPS_TX 3 +#define PIN_GPS_RX 5 +#define PIN_GPS_TX 4 #define BAUD_PC 115200 #define BAUD_GPS 9600 diff --git a/iot/main/gps.cpp b/iot/main/gps.cpp index 2d033ae..83684f2 100644 --- a/iot/main/gps.cpp +++ b/iot/main/gps.cpp @@ -16,7 +16,7 @@ TinyGPSLocation gps_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.")); + Serial.println(F("\n[error] Failed to initialise GPS device.")); while(true) { delay(1); } } @@ -31,7 +31,7 @@ TinyGPSLocation gps_location() { // If we haven't acquired a lock yet, go around again // Also go around again if the location is the same hasn't yet been updated (GPS devices are strange) - if(!gps.location.isValid() || gps.location.isUpdated()) { + if(!gps.location.isValid()) { Serial.print("."); delay(100); continue; diff --git a/iot/main/main.ino b/iot/main/main.ino index 7223915..54bca15 100644 --- a/iot/main/main.ino +++ b/iot/main/main.ino @@ -10,6 +10,7 @@ void setup() { Serial.begin(BAUD_PC); + Serial.println("[main] Beginning collection sequence."); random_begin(); @@ -18,7 +19,7 @@ void setup() { TinyGPSLocation loc = gps_location(); gps_end(); - Serial.print("[main] Location: ("); Serial.print(loc.lat()); Serial.print(", "); Serial.print(loc.lng()); Serial.println(); + Serial.print("[main] Location: ("); Serial.print(loc.lat()); Serial.print(", "); Serial.print(loc.lng()); Serial.println(")"); uint32_t id = random_get(); diff --git a/iot/main/settings.h b/iot/main/settings.h index f487a2b..be05b6e 100644 --- a/iot/main/settings.h +++ b/iot/main/settings.h @@ -16,11 +16,11 @@ // The *TX* gin of the GPS device. // This is swapped because we receive the GPS device's message on our side on the RX pin, and the GPS device transmits messages on the TX. -#define PIN_GPS_RX 4 +#define PIN_GPS_RX 5 // The *RX* pin on the GPS device. // This is swapped because where the GPs device is receiving, we aresending and vice versa. // The TX / RX here are according to *our* side, not the GPS device's side. -#define PIN_GPS_TX 3 +#define PIN_GPS_TX 4 // The speed at which we should talk to the GPS device. Some GPS devices require a certain speed in order to use certain commands, so it's important that you check the datasheets for the device you're using. // 9600 is the correct speed for a NEO-6M. #define BAUD_GPS 9600