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.
Этот коммит содержится в:
Valentin V. Bartenev
2026-05-31 02:41:57 +03:00
родитель e11d14e6cc
Коммит 9c8f884f11
4 изменённых файлов: 42 добавлений и 6 удалений
+1 -1
Просмотреть файл
@@ -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);
}