From 092cb5a0219b5fdb30d41aaada33d500bee62875 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com> Date: Tue, 16 Jun 2020 12:21:41 -0700 Subject: [PATCH] NEOS update required alert (#1722) * NEOS update required * permanent alert * bump cereal old-commit-hash: 6c156d7f45ee21f77fbafcb9867fb0712adb53f5 --- cereal | 2 +- selfdrive/controls/controlsd.py | 5 +++++ selfdrive/controls/lib/events.py | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cereal b/cereal index 295cef4d78..c0c3cc16b2 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 295cef4d78b8795997723d8d55717c4c5e4b5865 +Subproject commit c0c3cc16b2ee2aafa7d13b67563463be663c240c diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index e03c2ed002..4f2ec6b3c4 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import os import gc +import subprocess from cereal import car, log from common.numpy_fast import clip from common.realtime import sec_since_boot, set_realtime_priority, set_core_affinity, Ratekeeper, DT_CTRL @@ -142,6 +143,10 @@ class Controls: if hw_type == HwType.whitePanda: self.events.add(EventName.whitePandaUnsupported, static=True) + uname = subprocess.check_output(["uname", "-v"], encoding='utf8').strip() + if uname == "#1 SMP PREEMPT Wed Jun 10 12:40:53 PDT 2020": + self.events.add(EventName.neosUpdateRequired, static=True) + # controlsd is driven by can recv, expected at 100Hz self.rk = Ratekeeper(100, print_delay_threshold=None) self.prof = Profiler(False) # off by default diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 7d1895e038..0c56c04bb2 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -517,6 +517,15 @@ EVENTS = { ET.NO_ENTRY: NoEntryAlert("Speed Too Low"), }, + EventName.neosUpdateRequired: { + ET.PERMANENT: Alert( + "NEOS Update Required", + "Please Wait for Update", + AlertStatus.normal, AlertSize.mid, + Priority.HIGHEST, VisualAlert.none, AudibleAlert.none, 0., 0., .2), + ET.NO_ENTRY: NoEntryAlert("NEOS Update Required"), + }, + EventName.sensorDataInvalid: { ET.PERMANENT: Alert( "No Data from Device Sensors",