Last active
September 6, 2020 21:38
-
-
Save tinti/6415130 to your computer and use it in GitHub Desktop.
Get lat/long from gpsd with python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install gpsd gps-clients and python | |
import gps | |
gpsd = gps.gps() | |
gpsd.stream(gps.WATCH_ENABLE|gps.WATCH_NEWSTYLE) | |
for report in gpsd: | |
if report['class'] == 'TPV': | |
print report['lat'] | |
print report['lon'] | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment