Skip to content

Commit f4b017a

Browse files
committed
registration required to go onroad
1 parent d1922ef commit f4b017a

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

common/params_keys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ inline static std::unordered_map<std::string, uint32_t> keys = {
9191
{"Offroad_Recalibration", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION},
9292
{"Offroad_StorageMissing", CLEAR_ON_MANAGER_START},
9393
{"Offroad_TemperatureTooHigh", CLEAR_ON_MANAGER_START},
94-
{"Offroad_UnofficialHardware", CLEAR_ON_MANAGER_START},
94+
{"Offroad_UnregisteredHardware", CLEAR_ON_MANAGER_START},
9595
{"Offroad_UpdateFailed", CLEAR_ON_MANAGER_START},
9696
{"OnroadCycleRequested", CLEAR_ON_MANAGER_START},
9797
{"OpenpilotEnabledToggle", PERSISTENT},

selfdrive/selfdrived/alerts_offroad.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"text": "An update to your device's operating system is downloading in the background. You will be prompted to update when it's ready to install.",
2626
"severity": 0
2727
},
28-
"Offroad_UnofficialHardware": {
29-
"text": "Device failed to register. It will not connect to or upload to comma.ai servers, and receives no support from comma.ai. If this is an official device, visit https://comma.ai/support.",
28+
"Offroad_UnregisteredHardware": {
29+
"text": "Device failed to register with the comma.ai backend. It will not connect or upload to comma.ai servers, and receives no support from comma.ai. If this is a device purchased at comma.ai/shop, open a ticket at https://comma.ai/support.",
3030
"severity": 1
3131
},
3232
"Offroad_StorageMissing": {

system/athena/registration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def register(show_spinner=False) -> str | None:
9797

9898
if dongle_id:
9999
params.put("DongleId", dongle_id)
100-
set_offroad_alert("Offroad_UnofficialHardware", (dongle_id == UNREGISTERED_DONGLE_ID) and not PC)
100+
set_offroad_alert("Offroad_UnregisteredHardware", (dongle_id == UNREGISTERED_DONGLE_ID) and not PC)
101101
return dongle_id
102102

103103

system/hardware/hardwared.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
from openpilot.common.params import Params
2020
from openpilot.common.realtime import DT_HW
2121
from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert
22-
from openpilot.system.hardware import HARDWARE, TICI, AGNOS
22+
from openpilot.system.hardware import HARDWARE, TICI, AGNOS, PC
2323
from openpilot.system.loggerd.config import get_available_percent
2424
from openpilot.system.statsd import statlog
2525
from openpilot.common.swaglog import cloudlog
2626
from openpilot.system.hardware.power_monitoring import PowerMonitoring
2727
from openpilot.system.hardware.fan_controller import TiciFanController
2828
from openpilot.system.version import terms_version, training_version
29+
from openpilot.system.athena.registration import UNREGISTERED_DONGLE_ID
2930

3031
ThermalStatus = log.DeviceState.ThermalStatus
3132
NetworkType = log.DeviceState.NetworkType
@@ -325,6 +326,12 @@ def hardware_thread(end_event, hw_queue) -> None:
325326
show_alert = (not onroad_conditions["device_temp_good"] or not startup_conditions["device_temp_engageable"]) and onroad_conditions["ignition"]
326327
set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", show_alert, extra_text=extra_text)
327328

329+
# *** registration check ***
330+
if not PC:
331+
# we enforce this for our software, but you are welcome
332+
# to make a different decision in your software
333+
startup_conditions["registered_device"] = PC or (params.get("DongleId") != UNREGISTERED_DONGLE_ID)
334+
328335
# TODO: this should move to TICI.initialize_hardware, but we currently can't import params there
329336
if TICI and HARDWARE.get_device_type() == "tici":
330337
if not os.path.isfile("/persist/comma/living-in-the-moment"):

0 commit comments

Comments
 (0)