I'm using one of the 406A GPS modules. I originally got it working via Adafruit's GPS Shield. Now I'm trying to "make it work" in different ways. I'm seeing a few odd issues, with and without TinyGPS, and any SoftwareSerial. I'll list things here, and hopfully someone can point me in the right direction on the various parts:
- I'm only ever seeing the GGA and RMC sentences. Even though I've (tried) sent the "$PSRF103" strings to include the others (GGL, GSA, GSV, VTG, DDM, WAAS), AFTER sending the $PSRF100 string to initialize. For example:
void setup() {
Serial.begin(4800);
Serial.print("$PSRF100,01,4800,08,01,00*0E\r\n");
Serial.print("$PSRF103,00,00,00,01*25\r\n"); //GGA
Serial.print("$PSRF103,01,00,01,01*26\r\n"); //GGL
Serial.print("$PSRF103,02,00,01,01*27\r\n"); //GSA
Serial.print("$PSRF103,03,00,01,01*26\r\n"); //GSV
Serial.print("$PSRF103,04,00,01,01*21\r\n"); //RMC
Serial.print("$PSRF103,05,00,01,01*20\r\n"); //VTG
Serial.write("$PSRF105,01*3E\r\n"); //DDM (Development Data Messages)
Serial.write("$PSRF151,01*3F\r\n"); //WAAS
}
Is Serial.print not sufficient for this? I've tried Serial.write() as well, with no difference.
- When using TinyGPS, I'm cannot get the crack_datetime() function to work quite right:
void loop() {
long lat, lon, alt;
unsigned long fix_age, time, date, speed, course, chars;
unsigned short sentances, failed;
byte month, day, hour, minute, second, decsec;
int year;
char c = Serial.read();
if (gps.encode(c))
{
alt = gps.altitude();
gps.get_datetime(&date, &time, &fix_age);
gps.get_position(&lat, &lon, &fix_age);
gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &decsec, &fix_age);
speed = gps.speed();
course= gps.course();
//dump our data
//Skipped - it's a bunch of Serial.print() and Serial.println() statements
}
}
// SAMPLE OUTPUT
******************************
Position (lat/long): 5092598, -11396980
Altitude (cm): 105450
Date/Time:280310 - 8220400
year: 2010, month:
, day:
, hour:
, minute:
, second:
.
Speed: 1
Course: 235
******************************
- The date/time parts are all non-printable characters/garbage - except for the year (all relevant parts should be on one line in the output...). Everything else seems to be right. (haven't looked at the floating point items yet though)
- If I use SoftwareSerial, I cannot get a valid GPS sentence. There seems to be a corrupt character someplace in the middle of each sentence, so checksums fail. My project is going to need three serial devices connected (GPS, OpenLog, and LCD). But until I can reliably receive and interpret the GPS signals, the rest is on hold. (I'm trying out NewSoftSerial now to see if I get the same issues). I've modified my code a fair bit since (falling back to hardware serial) so cannot easily post it here...
If it helps, I'm using version 0017 of the development environment. I've just installed 0018, so will be reconfirming things. Oh, and my skill level should be safely classified as "novice". While I'm an experienced developer, it is all with higher level languages. (Some C training 15ish years ago...)
Thanks for any tips