diff --git a/gps_client.py b/gps_client.py index d33c8fde..66ba8c51 100644 --- a/gps_client.py +++ b/gps_client.py @@ -11,13 +11,13 @@ run this way: python3 example1.py.txt import gps # the gpsd interface module import time -mode = -1 -lat = 0 -lon = 0 -alt = 0 - try: - + + mode = -1 + lat = 0 + lon = 0 + alt = 0 + session = gps.gps(mode=gps.WATCH_ENABLE) start = time.perf_counter() @@ -64,6 +64,6 @@ try: exit(0) except: - print("%d %.6f %.6f %.1f" % (mode, lat, lon, alt)) + print("-1 0 0 0) exit(0)