The output I originally posted was from using adafruits GPS library with the example file code I posted above as well. What I was working on when the errors started occuring was adding parsing for GSV NMEA sentences with the following changes in the following files of the adafruit ultimate GPS library if it helps.
GPS.h:
Added a struct and two global variables to hold the GSV data
Code: Select all
struct activeSatallite {
uint8_t satalliteId;
uint8_t elevation;
uint8_t azimuth;
uint8_t SNR;
};
activeSatallite activeSatallites[12];
uint8_t satellitesInView;
NMEA_parse.cpp:
added the parsing code to the str compare else if's and moved it from under NMEA_EXTENSIONS up to the other strcmp statements that handle the "Normal" NMEA senteces like GGA and RMC.
Code: Select all
} else if (!strcmp(thisSentence, "GSV")) { //*****************************GSV
// from Actisense NGW-1
// Serial.println(F("inside GSV"));
uint8_t messageNumber = 0;
uint8_t satalliteMulitplier;
// Serial.println(F("inside GSV 1"));
// if (!isEmpty(p))
// uint8_t numberOfMessages = atoi(p);
p = strchr(p, ',') + 1;
// Serial.println(F("inside GSV 2"));
if (!isEmpty(p))
messageNumber = atoi(p);
// Serial.print(F("messageNumber")); Serial.println(messageNumber);
satalliteMulitplier = (messageNumber-1) * 4;
p = strchr(p, ',') + 1;
// Serial.println(F("inside GSV 3"));
if (!isEmpty(p))
satellitesInView = atoi(p);
p = strchr(p, ',') + 1;
// skip 12 Satellite PDNs without interpreting them
// Serial.println(F("inside GSV 4"));
uint8_t endPoint;
if (satalliteMulitplier + 4 > satellitesInView) {
endPoint = satellitesInView;
} else {
endPoint = satalliteMulitplier + 4;
}
for (int i = satalliteMulitplier; i < endPoint; i++) {
// Serial.print(F("inside GSV 4.")); Serial.print(i); Serial.println(".0");
if (!isEmpty(p)) {
// Serial.print(F("inside GSV 4.")); Serial.print(i); Serial.println(".0.0");
activeSatallites[i].satalliteId = atoi(p);
} else {
// Serial.print(F("inside GSV 4.")); Serial.print(i); Serial.println(".0.1");
activeSatallites[i].satalliteId = 0;
}
// Serial.print(F("inside GSV 4.")); Serial.print(i); Serial.println(".1");
p = strchr(p, ',') + 1;
if (!isEmpty(p)) {
activeSatallites[i].elevation = atoi(p);
} else {
activeSatallites[i].elevation = 0;
}
// Serial.print(F("inside GSV 4.")); Serial.print(i); Serial.println(".2");
p = strchr(p, ',') + 1;
if (!isEmpty(p)) {
activeSatallites[i].azimuth = atoi(p);
} else {
activeSatallites[i].azimuth = 0;
}
// Serial.print(F("inside GSV 4.")); Serial.print(i); Serial.println(".3");
p = strchr(p, ',') + 1;
if (!isEmpty(p)) {
activeSatallites[i].SNR = atoi(p);
} else {
activeSatallites[i].SNR = 0;
}
// Serial.print(F("inside GSV 4.")); Serial.print(i); Serial.println(".4");
p = strchr(p, ',') + 1;
}
// Serial.println(F("inside GSV 5"));
// last before checksum
}
PMTK.h:
The last file I altered was PMTK.h to include the instruction that tells the GPS to output RMC, GGA, and GSV NMEA sentences
Code: Select all
#define PMTK_SET_NMEA_OUTPUT_RMCGGAGSAGSV \
"$PMTK314,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0*29" ///< turn on GPRMC, GPGGA,
///< GPGSA, GPGSV