offroad alert for missing nvme (#20931)

* offroad alert for missing nvme

* remove that

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 313741062e
commatwo_master
Adeeb Shihadeh 4 years ago committed by GitHub
parent dec3b1c58a
commit 29a2bef998
  1. 1
      selfdrive/common/params.cc
  2. 4
      selfdrive/controls/lib/alerts_offroad.json
  3. 5
      selfdrive/thermald/thermald.py

@ -214,6 +214,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"Offroad_UpdateFailed", CLEAR_ON_MANAGER_START}, {"Offroad_UpdateFailed", CLEAR_ON_MANAGER_START},
{"Offroad_HardwareUnsupported", CLEAR_ON_MANAGER_START}, {"Offroad_HardwareUnsupported", CLEAR_ON_MANAGER_START},
{"Offroad_UnofficialHardware", CLEAR_ON_MANAGER_START}, {"Offroad_UnofficialHardware", CLEAR_ON_MANAGER_START},
{"Offroad_NvmeMissing", CLEAR_ON_MANAGER_START},
{"ForcePowerDown", CLEAR_ON_MANAGER_START}, {"ForcePowerDown", CLEAR_ON_MANAGER_START},
}; };

@ -44,5 +44,9 @@
"Offroad_UnofficialHardware": { "Offroad_UnofficialHardware": {
"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, contact support@comma.ai.", "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, contact support@comma.ai.",
"severity": 1 "severity": 1
},
"Offroad_NvmeMissing": {
"text": "NVME drive not mounted.",
"severity": 1
} }
} }

@ -350,6 +350,11 @@ def thermald_thread():
startup_conditions["device_temp_good"] = thermal_status < ThermalStatus.danger startup_conditions["device_temp_good"] = thermal_status < ThermalStatus.danger
set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", (not startup_conditions["device_temp_good"])) set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", (not startup_conditions["device_temp_good"]))
if TICI:
nvme_path = Path("/data/media")
startup_conditions["nvme_mounted"] = nvme_path.is_mount()
set_offroad_alert_if_changed("Offroad_NvmeMissing", (not startup_conditions["nvme_mounted"]))
# Handle offroad/onroad transition # Handle offroad/onroad transition
should_start = all(startup_conditions.values()) should_start = all(startup_conditions.values())
if should_start != should_start_prev or (count == 0): if should_start != should_start_prev or (count == 0):

Loading…
Cancel
Save