Add warning for unsupported NVME (#23972)
* Add warning for unsupported NVME * fix it up * fix typo Co-authored-by: Comma Device <device@comma.ai>pull/24013/head
parent
602cbfcba0
commit
a6d4bb5d01
|
@ -163,6 +163,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||||
{"ApiCache_DriveStats", PERSISTENT},
|
{"ApiCache_DriveStats", PERSISTENT},
|
||||||
{"ApiCache_NavDestinations", PERSISTENT},
|
{"ApiCache_NavDestinations", PERSISTENT},
|
||||||
{"ApiCache_Owner", PERSISTENT},
|
{"ApiCache_Owner", PERSISTENT},
|
||||||
|
{"Offroad_BadNvme", CLEAR_ON_MANAGER_START},
|
||||||
{"Offroad_CarUnrecognized", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
{"Offroad_CarUnrecognized", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||||
{"Offroad_ChargeDisabled", CLEAR_ON_MANAGER_START },
|
{"Offroad_ChargeDisabled", CLEAR_ON_MANAGER_START },
|
||||||
{"Offroad_ConnectivityNeeded", CLEAR_ON_MANAGER_START},
|
{"Offroad_ConnectivityNeeded", CLEAR_ON_MANAGER_START},
|
||||||
|
|
|
@ -41,6 +41,10 @@
|
||||||
"text": "NVMe drive not mounted.",
|
"text": "NVMe drive not mounted.",
|
||||||
"severity": 1
|
"severity": 1
|
||||||
},
|
},
|
||||||
|
"Offroad_BadNvme": {
|
||||||
|
"text": "Unsupported NVMe drive detected. Device may draw significantly more power and overheat due to the unsupported NVMe.",
|
||||||
|
"severity": 1
|
||||||
|
},
|
||||||
"Offroad_CarUnrecognized": {
|
"Offroad_CarUnrecognized": {
|
||||||
"text": "openpilot was unable to identify your car. Your car is either unsupported or its ECUs are not recognized. Please submit a pull request to add the firmware versions to the proper vehicle. Need help? Join discord.comma.ai.",
|
"text": "openpilot was unable to identify your car. Your car is either unsupported or its ECUs are not recognized. Please submit a pull request to add the firmware versions to the proper vehicle. Need help? Join discord.comma.ai.",
|
||||||
"severity": 0
|
"severity": 0
|
||||||
|
|
|
@ -278,9 +278,21 @@ def thermald_thread(end_event, hw_queue):
|
||||||
onroad_conditions["device_temp_good"] = thermal_status < ThermalStatus.danger
|
onroad_conditions["device_temp_good"] = thermal_status < ThermalStatus.danger
|
||||||
set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", (not onroad_conditions["device_temp_good"]))
|
set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", (not onroad_conditions["device_temp_good"]))
|
||||||
|
|
||||||
|
# TODO: this should move to TICI.initialize_hardware, but we currently can't import params there
|
||||||
if TICI:
|
if TICI:
|
||||||
missing = (not Path("/data/media").is_mount()) and (not os.path.isfile("/persist/comma/living-in-the-moment"))
|
if not os.path.isfile("/persist/comma/living-in-the-moment"):
|
||||||
set_offroad_alert_if_changed("Offroad_StorageMissing", missing)
|
if not Path("/data/media").is_mount():
|
||||||
|
set_offroad_alert_if_changed("Offroad_StorageMissing", True)
|
||||||
|
else:
|
||||||
|
# check for bad NVMe
|
||||||
|
try:
|
||||||
|
with open("/sys/block/nvme0n1/device/model") as f:
|
||||||
|
model = f.read().strip()
|
||||||
|
if not model.startswith("Samsung SSD 980") and params.get("Offroad_BadNvme") is None:
|
||||||
|
set_offroad_alert_if_changed("Offroad_BadNvme", True)
|
||||||
|
cloudlog.event("Unsupported NVMe", model=model, error=True)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
# Handle offroad/onroad transition
|
# Handle offroad/onroad transition
|
||||||
should_start = all(onroad_conditions.values())
|
should_start = all(onroad_conditions.values())
|
||||||
|
|
Loading…
Reference in New Issue