Be warned if you are using the 'NEW' Arduino 1.0 that the TinyGPS and SoftwareSerial will throw a fit with the LS20031 GPS.
I did the direct GPS dump to the monitor (using pin 0) like it says to do in the LS20031 GPS Assembly Guide {
http://www.sparkfun.com/tutorials/176}, and you get good clean GPS output (you can see this in my last example).
But using the following code >>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
Serial.begin(115200);// old 57600 New 115200
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(57600); // old 4800 new 57600
mySerial.println("Hello, world?");
}
void loop() // run over and over
{
if (mySerial.available()){
Serial.write(mySerial.read());
}
}
I get the extended characters mixed in with the GPS sentence when using SoftwareSerial >>
PG 6 A$GPGGA,182924.000,4751.6603,N,12142.3928,W,1,9,0.97,64.7,M,-16.9,M,,*5B
$GPGLL,4751.6603,N,12142.3928,W,182924.000,A,A*4F
$GPG 6 A±$GPGGA,182924.200,4751.6603,N,12142.3928,W,1,9,0.97,64.7,M,-16.9,M,,*59
$GPGLL,4751.6603,N,12142.3928,W,182924.200,A,A*4D
$GPG b¢r$GPGGA,182924.400,4751.6603,N,12142.3928,W,1,9,0.97,64.7,M,-16.9,M,,*5F
$GPGLL,4751.6603,N,12142.3928,W,182924.400,A,A*4B
$GPG42r±$GPGGA,182924.600,4751.6603,N,12142.3928,W,1,9,0.97,64.7,M,-16.9,M,,*5D
$GPGLL,4751.6603,N,12142.3928,W,182924.600,A,A*49
$GPG 5ºAr$GPGGA,182924.800,4751.6603,N,12142.3928,W,1,9,0.97,64.7,M,-16.9,M,,*53
$GPGLL,4751.6603,N,1214¦'&'éÅÂÊ¢rb
That is even before TinyGPS get’s a hold of the GPS sentences.
I have tried changing the baud rate both in the Arduino code, and for the serial monitor and still I get these “, &Rb¢*” characters in the stream.
I know the baud rate is not the problem because if you get it wrong you get nonsense. You don’t even get what you see up above.
Here is what it’s supposed to look like using the following code –
void setup() {
Serial.begin(57600);
}
void loop() {
if (Serial.available()) {
#if ARDUINO >= 100 //For Arduino v1.0+
Serial.write(Serial.read());
#else //For Arduino v0023 or earlier
Serial.print(Serial.read(), BYTE);
#endif
}
}
---- >>
$GPGSA,A,3,03,18,06,19,22,27,,,,,,,3.38,2.24,2.53*0B
$GPGSV,3,1,12,18,69,061,37,22,63,252,45,06,52,253,42,21,51,114,21*7F
$GPGSV,3,2,12,03,46,270,46,48,33,195,29,15,30,051,21,19,29,311,35*71
$GPGSV,3,3,12,14,19,186,16,27,16,069,22,09,13,095,,16,05,246,16*70
$GPRMC,183446.800,A,4751.6605,N,12142.3934,W,0.01,241.74,140212,,,A*72
$GPVTG,241.74,T,,M,0.01,N,0.03,K,A*3B
$GPGGA,183447.000,4751.6605,N,12142.3934,W,1,6,2.24,63.6,M,-16.9,M,,*5A
$GPGLL,4751.6605,N,12142.3934,W,183447.000,A,A*4D
$GPGSA,A,3,03,18,06,19,22,27,,,,,,,3.38,2.24,2.53*0B
$GPGSV,3,1,12,18,69,061,37,22,63,252,45,06,52,253,42,21,51,114,21*7F
$GPGSV,3,2,12,03,46,270,46,48,33,195,29,15,30,051,21,19,29,311,35*71
$GPGSV,3,3,12,14,19,186,16,27,16,069,22,09,13,095,,16,05,246,16*70
$GPRMC,183447.000,A,4751.6605,N,12142.3934,W,0.01,241.74,140212,,,A*7B
$GPVTG,241.74,T,,M,0.01,N,0.02,K,A*3A
So I am at lost what the problem is.
One note- SoftwareSerial – is the library that comes with the NEW Arduino 1.0 IDE. That’s the library that used to be call NewSoftSerial.
What kills me is I got his OLD tinyGPS to work with the Arduino .22 IDE.