My recently acquired GPS unit worked fine… initially, but after a while, it started failing.
I’ve confirmed it is NOT cabling etc… the issue is more fundamental.
I was using the basic test sketch as shown in the getting-started guide. Read once per second, print the results. Basic UART test - checked. GPS test..hmmm…
The symptoms observed… for around 2 minutes - it all works perfectly. Then - things start to go bad. The output shows loss of fix… then goes into an odd state where every alternate read is bad. This is repeatable. It is not intermittent - it’s a systemic problem. Wait a little longer… and it gets back ‘in sync’.
My tests have confirmed the issue is about timing… and I suspect, UART buffer size. If I slow down the read rate to 1300 ms, not 1000 … it continues to work. Apparently, given enough time…AND enough found satellites… it seems the data returned eventually can’t be transmitted within the allocated window. Slowing the rate down resolves the issue. OK…so…
My app needs to get GPS data every second (at least). My question to the forum is: Has anyone hit this issue.. and has anyone overcome it via a better gps parser? What I have in mind is the following solution:.. Start an asyncio stream reader, which only returns after a complete block of NMEA data has been received, thus avoiding the possibility that the UART buffer and time window end up in conflict.
Increasing baud rate would help… but is more like a band-aid than a robust algorithm.
Maybe there are better solutions?
Cheers, T.