mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 00:43:54 +08:00
log on startup when panda heartbeat is lost (#21151)
* log when heartbeat lost
* bump panda
* bump panda
* add to pandaState
* move that
old-commit-hash: f04d6a9b3f
This commit is contained in:
2
cereal
2
cereal
Submodule cereal updated: 18f1e48244...85e1e2f79c
2
panda
2
panda
Submodule panda updated: f965146214...e99d41e6cf
@@ -379,6 +379,7 @@ void panda_state_thread(bool spoofing_started) {
|
||||
ps.setFanSpeedRpm(fan_speed_rpm);
|
||||
ps.setFaultStatus(cereal::PandaState::FaultStatus(pandaState.fault_status));
|
||||
ps.setPowerSaveEnabled((bool)(pandaState.power_save_enabled));
|
||||
ps.setHeartbeatLost((bool)(pandaState.heartbeat_lost));
|
||||
ps.setHarnessStatus(cereal::PandaState::HarnessStatus(pandaState.car_harness_status));
|
||||
|
||||
// Convert faults bitset to capnp list
|
||||
|
||||
@@ -36,6 +36,7 @@ struct __attribute__((packed)) health_t {
|
||||
int16_t safety_param;
|
||||
uint8_t fault_status;
|
||||
uint8_t power_save_enabled;
|
||||
uint8_t heartbeat_lost;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -77,13 +77,19 @@ def update_panda() -> None:
|
||||
cloudlog.info("Version mismatch after flashing, exiting")
|
||||
raise AssertionError
|
||||
|
||||
cloudlog.info("Resetting panda")
|
||||
panda.reset()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
update_panda()
|
||||
|
||||
# check heatlh for lost heartbeat
|
||||
panda = Panda()
|
||||
health = panda.health()
|
||||
if health["heartbeat_lost"]:
|
||||
cloudlog.event("heartbeat lost", deviceState=health)
|
||||
|
||||
cloudlog.info("Resetting panda")
|
||||
panda.reset()
|
||||
|
||||
os.chdir(os.path.join(BASEDIR, "selfdrive/boardd"))
|
||||
os.execvp("./boardd", ["./boardd"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user