Small things because fuck sd cards
Build, push image, and notify Watchtower / build-image (push) Successful in 3m22s
Build, push image, and notify Watchtower / notify (push) Successful in 1m24s

This commit is contained in:
2026-08-25 19:16:50 +02:00
parent 688fd26db8
commit 3753f57041
12 changed files with 139 additions and 94 deletions
+7 -3
View File
@@ -2,7 +2,7 @@ import serial
import time
import threading
from shared.logging import log
from sensors.lock import serial_lock
from sensors.lock import safe_serial_access
def calculate_nmea_checksum(line: str) -> bool:
"""Validates standard NMEA 0183 sentence checksum ($...*HH)."""
@@ -35,7 +35,12 @@ class GROVEGPS:
def read(self):
"""Reads the freshest GGA sentence from serial, thread-safely."""
with serial_lock:
# Allow sufficient time for the serial reads (readline can block up to timeout=1s per line)
with safe_serial_access(timeout=2.0) as acquired:
if not acquired:
log("GPS: Serial lock acquisition timed out")
return False
# 1. Flush accumulated stale buffer data
self.ser.reset_input_buffer()
@@ -115,5 +120,4 @@ def get_gps_data():
else:
log(f"GPS: No valid fix or data available. Satellites: {gps.satellites}, Quality: {gps.quality}")
# Return None so main.py doesn't process or log empty GPS data
return None