Write panda heartbeat lost in param (#21957)

old-commit-hash: 2abd288567
commatwo_master
Willem Melching 4 years ago committed by GitHub
parent 7d09945de3
commit 5bdd6a5165
  1. 1
      selfdrive/common/params.cc
  2. 2
      selfdrive/pandad.py

@ -194,6 +194,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"PandaFirmware", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT},
{"PandaFirmwareHex", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT},
{"PandaDongleId", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT},
{"PandaHeartbeatLost", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF},
{"Passive", PERSISTENT},
{"PrimeRedirected", PERSISTENT},
{"RecordFront", PERSISTENT},

@ -5,6 +5,7 @@ import time
from panda import BASEDIR as PANDA_BASEDIR, Panda, PandaDFU
from common.basedir import BASEDIR
from common.params import Params
from selfdrive.swaglog import cloudlog
PANDA_FW_FN = os.path.join(PANDA_BASEDIR, "board", "obj", "panda.bin.signed")
@ -86,6 +87,7 @@ def main() -> None:
# check health for lost heartbeat
health = panda.health()
if health["heartbeat_lost"]:
Params().put_bool("PandaHeartbeatLost", True)
cloudlog.event("heartbeat lost", deviceState=health)
cloudlog.info("Resetting panda")

Loading…
Cancel
Save