pulkin / micropython

MicroPython implementation on Ai-Thinker GPRS module A9 (RDA8955)
https://micropython.org
MIT License
103 stars 30 forks source link

Providing a way to tell if gps.get_location() is the actual position #39

Open sebi5361 opened 4 years ago

sebi5361 commented 4 years ago

Currently gps.get_location() will return the latest location if it cannot get the current location. There should be a way to tell if gps.get_location() is the actual position.

Both time and location are from NMEA RMC sentence which probably means that they correspond to each other. I think about giving access to the timestamp of the last reported location (if there is any). Unfortunately, GPS does not really provide something on demand: it just spams UART2 with its messages

sebi5361 commented 4 years ago

I have noticed that at least one satellite needs to be tracked gps.get_satellites()[0] > 0 for gps.get_location() to give the actual location.

Regarding time, it is not that clear to me how many satellites need to be visible gps.get_satellites()[1] > 0 to get the actual time. But for sure gps.time() < 2525040000 to be valid.

bokolob commented 3 years ago

Now it can be checked with nmea_data() method. Just check if gps has fix and fix quality. I reckon this issue should be closed