From 6d764c1c5222cc2affef641f68f3a9a4b174d9dd Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 14 Dec 2025 07:21:37 -0500 Subject: [PATCH] Update gps_client.py add 1 second timeout --- gps_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gps_client.py b/gps_client.py index c5c93e9c..09afac43 100644 --- a/gps_client.py +++ b/gps_client.py @@ -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):