diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 53f4601a8..397d60f30 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -334,7 +334,7 @@ void CmndStatus(void) if ((!Settings.flag.mqtt_enabled) && (6 == payload)) { payload = 99; } // SetOption3 - Enable MQTT if (!energy_flg && (9 == payload)) { payload = 99; } - bool exception_flg = (ResetReason() == REASON_EXCEPTION_RST); + bool exception_flg = (ResetReason() == REASON_EXCEPTION_RST) || (ResetReason() == REASON_SOFT_WDT_RST); if (!exception_flg && (12 == payload)) { payload = 99; } if ((0 == payload) || (99 == payload)) { @@ -575,6 +575,9 @@ void CmndRestart(void) case -1: CmndCrash(); // force a crash break; + case -2: + CmndWDT(); + break; case 99: AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING)); EspRestart(); diff --git a/tasmota/support_crash_recorder.ino b/tasmota/support_crash_recorder.ino index 87009bbc5..d354adb3b 100644 --- a/tasmota/support_crash_recorder.ino +++ b/tasmota/support_crash_recorder.ino @@ -50,6 +50,15 @@ void CmndCrash(void) dummy = *((uint32_t*) 0x00000000); } +// do an infinite loop to trigger WDT watchdog +void CmndWDT(void) +{ + volatile uint32_t dummy = 0; + while (1) { + dummy++; + } +} + // Clear the RTC dump counter when we do a normal reboot, this avoids garbage data to stay in RTC void CrashDumpClear(void) {