Set up the MicroGPS code with a 20031 to look at the data and found that sentences causing the exception contained no ‘*’, so the attempt to convert validChecksum was trying to convert stuff like “3$”, which doesn’t work. Thought it was the GC, but a lock on sentence inside IsValidChecksum didn’t help.
<edit: found the culprit on my system by printing the strings:
$GPGSV,3,2,1$GPGSV,3,1,12,08,80,086,15,05,67,252,22,07,49,059,26,42,286,247D
$GPGSV,3,2,12,10,39,165,28,30,150,13,11,095,02,08,221,357C
$GPGSV,3,3,12,15,07,283,15,21,06,335,03,04,032,06,02,020,74
$GPRMC,112951.600,A,4958.8371,N,00815.4093,E,0.07,84.64,1505$GPGGA,112951.800,4958.8371,N,00815.4093,E,1,5,1.90,192.6,M,47.9,M,5F
$GPGLL,4958.8371,N,00815.4093,E,112951.800,A,A51
$GPGSA,A,3,02,08,26,05,15,2.11,1.90,0.930D
$GPGSV,3,1,12,08,80,086,15,05,67,252,22,07,49,059,26,42,286,247D
$GPGSV,3,2,12,10,39,165,28,30,150,13,11,095,02,08,221,357C
$GPGSV,3,3,12,15,07,283,15,21,06,335,03,04,032,06,02,020,7,N,0.14,K,A01
the last line fails because it finds a ‘star’ in the string which doesn’t precede the checksum.
The convert routine tries to convert “7,” in this case, which causes exception.
Possibly due to 57600 baud rate. Should be OK with lower values.
- or -
reducing the sentences transmitted from the GPs with:
// Only send GGA and RMC sentences
byte tx_data = Encoding.UTF8.GetBytes(“$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n”);
GPSSerialHandle.Write(tx_data, 0, tx_data.Length);