diff --git a/firmware/lib/event_log/event_log.h b/firmware/lib/event_log/event_log.h index 470f45a..6f68978 100644 --- a/firmware/lib/event_log/event_log.h +++ b/firmware/lib/event_log/event_log.h @@ -19,6 +19,8 @@ enum RebootReason : uint8_t { REBOOT_FACTORY_RESET = 2, REBOOT_OTA = 3, REBOOT_WIFI_REPROV = 4, + REBOOT_FATAL_CONFIG = 5, + REBOOT_FATAL_CAMERA = 6, }; struct EventLogEntry { diff --git a/firmware/src/main.cpp b/firmware/src/main.cpp index 9767a87..6f5576c 100644 --- a/firmware/src/main.cpp +++ b/firmware/src/main.cpp @@ -169,6 +169,7 @@ void setup() { if (!config_load(g_cfg)) { Serial.println("FATAL: device_id/location_id/hmac_secret not provisioned"); + event_log_write(EVT_REBOOT, REBOOT_FATAL_CONFIG, 0); while (true) { delay(500); led_set(!digitalRead(LED_PIN)); } // fast blink } @@ -203,6 +204,7 @@ void setup() { if (!camera_init()) { Serial.println("FATAL: camera init failed"); + event_log_write(EVT_REBOOT, REBOOT_FATAL_CAMERA, 0); while (true) delay(1000); } diff --git a/server/heartbeat_diagnostics_stub.py b/server/heartbeat_diagnostics_stub.py index ea2a714..30e7943 100644 --- a/server/heartbeat_diagnostics_stub.py +++ b/server/heartbeat_diagnostics_stub.py @@ -122,4 +122,6 @@ REBOOT_REASON_DECODER = { 2: "FACTORY_RESET", 3: "OTA", 4: "WIFI_REPROV", + 5: "FATAL_CONFIG", + 6: "FATAL_CAMERA", }