ESP32: add reset reason to boot event, CLI, and web panel
Implement getResetReason() and getResetReasonString() for ESP32Board, covering all esp_reset_reason_t values: power-on, external reset, software reset, panic/exception, interrupt watchdog, task watchdog, generic watchdog, deep sleep wake, brownout, and SDIO reset. Extend the pwrmgt.bootreason CLI command to support ESP32 alongside NRF52. On ESP32 only the reset reason is reported (no shutdown reason). Pass the reset reason as the value field when recording the HISTORY_EVENT_BOOT stats event so the reason is stored in the in-memory ring buffer and persisted to the archive events log. Add bootReasonLabel() to the web panel and update renderEventsSection() to annotate boot events with the human-readable reset reason string, e.g. "boot (panic/exception)", when a non-null value is present.
Этот коммит содержится в:
@@ -1331,7 +1331,7 @@ void MyMesh::begin(FILESYSTEM *fs, ArchiveStorage* archive) {
|
||||
next_archive_neighbours_flush_ms = millis() + kArchiveNeighboursFlushIntervalMs;
|
||||
}
|
||||
if (web.isWebStatsEnabled()) {
|
||||
recordStatsEvent(HISTORY_EVENT_BOOT);
|
||||
recordStatsEvent(HISTORY_EVENT_BOOT, board.getResetReason());
|
||||
if (_archive != nullptr) {
|
||||
recordStatsEvent(_archive->isMounted() ? HISTORY_EVENT_ARCHIVE_MOUNTED : HISTORY_EVENT_ARCHIVE_UNAVAILABLE);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user