OK, so I got rid of the delay() statements, and substituted a simple test to determine whether I have a good fix. I’m still puzzled by how it (doesn’t) work. Following is my test program
#include "AssetTracker/AssetTracker.h"
long lastPrint = 0;
AssetTracker t = AssetTracker();
void setup() {
t.begin();
t.gpsOn();
Serial.begin(9600);
}
void loop() {
t.updateGPS();
if(t.gpsFix())
if(millis()-lastPrint > 6000){
lastPrint = millis();
Serial.println(t.preNMEA());
}
}
and a portion of the output it generates.
6,3
$GPGGA,151145.000,4429.6503,N,06348.3967,W,1,10,0.83,27.1,M,-23.7,M,,*6S,02,3
$GPGGA,151152.000,4429.6503,N,06348.3967,W,1,10,0.83,27.1,M,-23.7,M,,*6S,02,3
$GPGGA,151152.000,4429.6503,N,06348.3967,W,1,10,0.83,27.1,M,-23.7,M,,*6S,02,3
$,,210*C0.6,96
$GPGGA,151208.000,4429.6500,N,06348.3964,W,1,10,0.83,27.1,M,,S,,2,3
$GPGGA,151211.000,4429.6498,N,06348.3964,W,1,10,0.83,27.1,M,-23.7,M,,*6S108,,.03
$GPGGA,151227.000,4429.6498,N,06348.3959,W,2,10,0.83,27.1,M,-23.7,M,000,02237G230634
$GPGGA,151227.000,4429.6498,N,06348.3959,W,2,10,0.83,27.1,M,-23.7,M,000,02237G230634
I seem to be having difficulty getting consistent transmissions of the NMEA sentence from the Adafruit GPS to the Electron.
Notice that the time difference between subsequent fixes is not always 6 seconds.
Any suggestions?