Open XiteHosting opened 3 years ago
Congratulations on getting the firmware to work with your GPS!
When I wrote the code, the Adafruit Ultimate GPS was what most people were using with the Adafruit Ice Tube Clock, and the Ultimate GPS used "GPRMC" to report time. Other users tried my firmware with other GPS units and had luck, so I--perhaps naively--assumed that this is how most GPS units behaved.
My firmware is also very picky about only setting time from what looks like a valid RMC message and even verifies the checksum. At least one clock user was broadcasting the NMEA data from his GPS over radio to his clock and needed corrupted RMC records to be discarded. For better or worse, this is why the firmware does not just search for the "RMC" string, but instead processes the entire RMC message.
Unfortunately, I'm not able to easily test modifications to the firmware at the moment, but you might try changing the source to accept any the two digit talker code as valid. This could probably be done by finding the following lines in gps.c:
const char *gprmc_str = "GPRMC";
if(gps.idx >= 5 || c != gprmc_str[gps.idx]) {
And changing them to something like
const char *rmc_str = "**RMC";
if(gps.idx >= 5 || (gps.idx >= 2 && c != rmc_str[gps.idx])) {
(I haven't tested this however...)
Hope that helps!
Hi, My clock is still laying on my desk without a case on (waiting for light sensor) so I could easily try it. Your code modification seems to be working fine :-)
thanks, Stijn
Hi, I've bought this GPS online "BN-220". After trying the Adafruit GPS firmware (which didn't work since they use 4800bps and the gps uses 9600bps) Trying your firmware and another one I found on the internet, and never getting any positive outcomes.
I linked the GPS to a raspberry pi to read what is coming in. This is an excerpt of the data: (44) $GNGSA,A,3,,,,,,,,,,,,,13.29,6.52,11.5819 (68) $GPGSV,3,1,12,02,42,253,13,04,14,075,15,05,22,303,,06,27,202,267F (66) $GPGSV,3,2,12,07,66,131,08,09,50,074,,11,46,240,25,13,07,253,7A (64) $GPGSV,3,3,12,16,15,040,,20,54,294,,29,08,317,,30,44,185,267C (18) $GLGSV,1,1,0065 (52) $GNGLL,5104.87634,N,00342.00064,E,140052.00,A,A7C (68) $GNRMC,140053.00,A,5104.87502,N,00341.99862,E,1.638,,101021,,,A60 (35) $GNVTG,,T,,M,1.638,N,3.033,K,A32 (74) $GNGGA,140053.00,5104.87502,N,00341.99862,E,1,04,6.51,-4.6,M,46.0,M,,68 (52) $GNGSA,A,3,02,06,07,30,,,,,,,,,13.27,6.51,11.561A (44) $GNGSA,A,3,,,,,,,,,,,,,13.27,6.51,11.561A (68) $GPGSV,3,1,12,02,42,253,12,04,14,075,15,05,22,303,,06,27,202,267E (66) $GPGSV,3,2,12,07,66,131,12,09,50,074,,11,46,240,25,13,07,253,71 (64) $GPGSV,3,3,12,16,15,040,,20,54,294,,29,08,317,,30,44,185,267C (18) $GLGSV,1,1,0065 (52) $GNGLL,5104.87502,N,00341.99862,E,140053.00,A,A76
Looking in your (and the other guy's) code, I see you search for "GPRMC" and not for "GNRMC" like mine is showing. I would think this is GPS vs Glonass?
I've changed this to GNRMC and my clock is working fine. I also tried changing it to RMC, so it could work for everyone, but that doesn't seem to work. Probably because you don't search for the string in the GPS output, but compare the first x characters.
I have no idea how to fix this in C code :-) But maybe someone else does.
regards, Stijn