Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEOS update required alert #1725

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ struct CarEvent @0x9b1657f34caf3ad3 {
startupWhitePanda @82;
canErrorPersistent @83;
belowEngageSpeed @84;
noGps @85;
focusRecoverActive @86;
wrongCruiseMode @87;
neosUpdateRequired @88;
}
}

Expand Down
5 changes: 5 additions & 0 deletions selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
@@ -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, Ratekeeper, DT_CTRL
Expand Down Expand Up @@ -142,6 +143,10 @@ def __init__(self, sm=None, pm=None, can_sock=None):
# 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
Expand Down
10 changes: 10 additions & 0 deletions selfdrive/controls/lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,16 @@ def calibration_incomplete_alert(CP, sm, metric):
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",
Expand Down