This is sort of the second half to an earlier discussion I started about problems with software serial that I was having with the Arduino. I didn't like the fact that the SoftwareSerial library would hang if serial input was abruptly cut off, so somebody recommended ladyada's AFSoftSerial library (originally posted about
here). I hate to post about a similar topic twice, but after much experimentation, I realized that I probably don't have the technical knowledge yet to be able to understand the problem...
What's happening is basically that the AFSoftSerial library is reading junk, just random characters, from the GPS module. However, I know that the GPS module is outputting correctly, because using the SoftwareSerial library, I get the output I want. Also, I know that it is indeed trying to read from the GPS module and not just floating because when I disconnect the wire from the GPS module to the Arduino, the junk stops. Also, I know that hyperterminal and the connection from my computer to the Arduino is formatted correctly because the Arduino sends a "hello" message when it boots, which is coming through perfectly.
I did notice a pattern in the junk though. The GPS strings that the module is outputting look like:
$GPVTG,...[other stuff]
...and here's some sample output from AFSoftSerial, with line breaks placed at strategic points:
D;jK¤;¹Ìcs¦3\£9Ëc3¹ÌdcÆ:Ë`sf3››S¦³Sü
D;jK¤;¹Æ2esF3\£9Ëc39ÌacÆ
D;jK¤;9
D;jK¤;9Æ
This made me think at first that it was just a matter of shifting ascii codes, but shifted so that "D" becomes "$", the rest of the message is still unintelligible. It also sort of looks like a timing issue, but I tried changing the bit delay everywhere from 188 to 270 microseconds (the GPS module is outputting at 4800 baud) with no avail.
I would welcome any thoughts on this -- I know it's sort of a complex issue, but I really don't know where to go from here...