Skip to content

Instantly share code, notes, and snippets.

@tinti
Last active September 6, 2020 21:38
Show Gist options
  • Save tinti/6415130 to your computer and use it in GitHub Desktop.
Save tinti/6415130 to your computer and use it in GitHub Desktop.
Get lat/long from gpsd with python
# 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