ubloxd: update time validity check (#34103)

pull/34106/head
Adeeb Shihadeh 5 months ago committed by GitHub
parent 957d39a5b6
commit a58853e70e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      system/ubloxd/pigeond.py

@ -9,6 +9,7 @@ import urllib.parse
from datetime import datetime, UTC from datetime import datetime, UTC
from cereal import messaging from cereal import messaging
from openpilot.common.time import system_time_valid
from openpilot.common.params import Params from openpilot.common.params import Params
from openpilot.common.swaglog import cloudlog from openpilot.common.swaglog import cloudlog
from openpilot.system.hardware import TICI from openpilot.system.hardware import TICI
@ -196,8 +197,8 @@ def initialize_pigeon(pigeon: TTYPigeon) -> bool:
cloudlog.error(f"failed to restore almanac backup, status: {restore_status}") cloudlog.error(f"failed to restore almanac backup, status: {restore_status}")
# sending time to ublox # sending time to ublox
t_now = datetime.now(UTC).replace(tzinfo=None) if system_time_valid():
if t_now >= datetime(2021, 6, 1): t_now = datetime.now(UTC).replace(tzinfo=None)
cloudlog.warning("Sending current time to ublox") cloudlog.warning("Sending current time to ublox")
# UBX-MGA-INI-TIME_UTC # UBX-MGA-INI-TIME_UTC

Loading…
Cancel
Save