Update gps_client.py add 1 second timeout

pi-sensors-auto-gps
Alan Johnston 3 days ago committed by GitHub
parent 12494ebb9f
commit 6d764c1c52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -9,11 +9,14 @@ run this way: python3 example1.py.txt
# this client is for the CubeSatSim Lite which does not have a Pico microcontroller
import gps # the gpsd interface module
import time
session = gps.gps(mode=gps.WATCH_ENABLE)
start = time.perf_timer()
try:
while 0 == session.read():
while session.read() == 0 and ((time.perf_timer(0 - start) < 1):
print(gps.MODE_SET)
print(session.valid)
if not (gps.MODE_SET & session.valid):

Loading…
Cancel
Save

Powered by TurnKey Linux.