Log android system shutdown to param (#23520)
* Log android system shutdown to param * comment Co-authored-by: Comma Device <device@comma.ai>pull/23521/head
parent
8c53adf4ab
commit
610b99fd68
|
@ -255,6 +255,7 @@ selfdrive/hardware/base.py
|
||||||
selfdrive/hardware/hw.h
|
selfdrive/hardware/hw.h
|
||||||
selfdrive/hardware/eon/__init__.py
|
selfdrive/hardware/eon/__init__.py
|
||||||
selfdrive/hardware/eon/androidd.py
|
selfdrive/hardware/eon/androidd.py
|
||||||
|
selfdrive/hardware/eon/shutdownd.py
|
||||||
selfdrive/hardware/eon/hardware.h
|
selfdrive/hardware/eon/hardware.h
|
||||||
selfdrive/hardware/eon/hardware.py
|
selfdrive/hardware/eon/hardware.py
|
||||||
selfdrive/hardware/eon/neos.py
|
selfdrive/hardware/eon/neos.py
|
||||||
|
|
|
@ -133,6 +133,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||||
{"LastGPSPosition", PERSISTENT},
|
{"LastGPSPosition", PERSISTENT},
|
||||||
{"LastPeripheralPandaType", PERSISTENT},
|
{"LastPeripheralPandaType", PERSISTENT},
|
||||||
{"LastPowerDropDetected", CLEAR_ON_MANAGER_START},
|
{"LastPowerDropDetected", CLEAR_ON_MANAGER_START},
|
||||||
|
{"LastSystemShutdown", CLEAR_ON_MANAGER_START},
|
||||||
{"LastUpdateException", PERSISTENT},
|
{"LastUpdateException", PERSISTENT},
|
||||||
{"LastUpdateTime", PERSISTENT},
|
{"LastUpdateTime", PERSISTENT},
|
||||||
{"LiveParameters", PERSISTENT},
|
{"LiveParameters", PERSISTENT},
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
from common.params import Params
|
||||||
|
from selfdrive.hardware.eon.hardware import getprop
|
||||||
|
from selfdrive.swaglog import cloudlog
|
||||||
|
|
||||||
|
def main():
|
||||||
|
params = Params()
|
||||||
|
while True:
|
||||||
|
# 0 for shutdown, 1 for reboot
|
||||||
|
prop = getprop("sys.shutdown.requested")
|
||||||
|
if prop is not None and len(prop) > 0:
|
||||||
|
os.system("pkill -9 loggerd")
|
||||||
|
params.put("LastSystemShutdown", f"'{prop}' {datetime.datetime.now()}")
|
||||||
|
print("shutdown detected", repr(prop))
|
||||||
|
|
||||||
|
time.sleep(120)
|
||||||
|
cloudlog.error('shutdown false positive')
|
||||||
|
break
|
||||||
|
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
|
@ -1,7 +1,7 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess
|
|
||||||
from selfdrive.hardware import EON, TICI, PC
|
from selfdrive.hardware import EON, TICI, PC
|
||||||
|
from selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess
|
||||||
|
|
||||||
WEBCAM = os.getenv("USE_WEBCAM") is not None
|
WEBCAM = os.getenv("USE_WEBCAM") is not None
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ procs = [
|
||||||
|
|
||||||
# EON only
|
# EON only
|
||||||
PythonProcess("rtshield", "selfdrive.rtshield", enabled=EON),
|
PythonProcess("rtshield", "selfdrive.rtshield", enabled=EON),
|
||||||
|
PythonProcess("shutdownd", "selfdrive.hardware.eon.shutdownd", enabled=EON),
|
||||||
PythonProcess("androidd", "selfdrive.hardware.eon.androidd", enabled=EON, persistent=True),
|
PythonProcess("androidd", "selfdrive.hardware.eon.androidd", enabled=EON, persistent=True),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue