On Tue, 29 Nov 2022 17:23:31 +0530, KK CHN wrote:
> When I ran the program I am able to see the output of latitude and > longitude in the console of thony IDE. But between certain intervals > of a few seconds I am getting the latitude and longitude data ( its > printing GPS data not found ?? ) in the python console. I would guess the 8 seconds in timeout = time.time() + 8 is too short. Most GPS receivers repeat a sequence on NMEA sentences and the code is specifically looking for $GPGGA. Add print(buff) to see the sentences being received. I use the $GPRMC since I'm interested in the position, speed, and heading. It's a different format but if you only want lat/lon you could decode it in a similar fashion as the $GPGGA. -- https://mail.python.org/mailman/listinfo/python-list