diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 1bfd9e2d3..02e5f0044 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -58,3 +58,5 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Fix ESP32 PWM range - Add Zigbee better support for IKEA Motion Sensor - Add ESP32 Analog input support for GPIO32 to GPIO39 +- Add Zigbee options to ``ZbSend`` ``Config`` and ``ReadCondig`` +- Add command ``Restart 2`` to halt system. Needs hardware reset or power cycle to restart (#9046) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 2e9610d20..4d7cd944c 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -5,7 +5,8 @@ - Fix ESP32 PWM range - Add Zigbee better support for IKEA Motion Sensor - Add ESP32 Analog input support for GPIO32 to GPIO39 -- Add Zigbee add options to ``ZbSend`` ``Config`` and ``ReadCondig`` +- Add Zigbee options to ``ZbSend`` ``Config`` and ``ReadCondig`` +- Add command ``Restart 2`` to halt system. Needs hardware reset or power cycle to restart (#9046) ### 8.4.0 20200730 diff --git a/tasmota/i18n.h b/tasmota/i18n.h index 586bd470c..a1623fe14 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -81,6 +81,7 @@ #define D_JSON_GAS "Gas" #define D_JSON_GATEWAY "Gateway" #define D_JSON_GROUPS "Groups" +#define D_JSON_HALTING "Halting" #define D_JSON_HEAPSIZE "Heap" #define D_JSON_HIGH "High" #define D_JSON_HOST_NOT_FOUND "Host not found" @@ -286,7 +287,7 @@ #define D_CMND_INTERLOCK "Interlock" #define D_CMND_TELEPERIOD "TelePeriod" #define D_CMND_RESTART "Restart" - #define D_JSON_ONE_TO_RESTART "1 to restart" + #define D_JSON_ONE_TO_RESTART "1 to restart, 2 to halt" #define D_CMND_RESET "Reset" #define D_JSON_RESET_AND_RESTARTING "Reset and Restarting" #define D_JSON_ONE_TO_RESET "1 to reset" diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 49f554b18..e389bb64b 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -695,6 +695,11 @@ void CmndRestart(void) restart_flag = 2; ResponseCmndChar(D_JSON_RESTARTING); break; + case 2: + restart_flag = 2; + restart_halt = true; + ResponseCmndChar(D_JSON_HALTING); + break; case -1: CmndCrash(); // force a crash break; diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index d90217c10..25f1a4417 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -1143,7 +1143,7 @@ void Every250mSeconds(void) } restart_flag--; if (restart_flag <= 0) { - AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_RESTARTING)); + AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION "%s"), (restart_halt) ? "Halted" : D_RESTARTING); EspRestart(); } } diff --git a/tasmota/support_wifi.ino b/tasmota/support_wifi.ino index 3274cfc4b..8246539a7 100644 --- a/tasmota/support_wifi.ino +++ b/tasmota/support_wifi.ino @@ -640,7 +640,18 @@ void EspRestart(void) ResetPwm(); WifiShutdown(true); CrashDumpClear(); // Clear the stack dump in RTC - ESP_Restart(); + + if (restart_halt) { + while (1) { + OsWatchLoop(); // Feed OsWatch timer to prevent restart + SetLedLink(1); // Wifi led on + delay(200); // Satisfy SDK + SetLedLink(0); // Wifi led off + delay(800); // Satisfy SDK + } + } else { + ESP_Restart(); + } } // diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 0fca0cddc..9aa1eab63 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -168,6 +168,7 @@ bool soft_spi_flg = false; // Software SPI configured bool ntp_force_sync = false; // Force NTP sync bool is_8285 = false; // Hardware device ESP8266EX (0) or ESP8285 (1) bool skip_light_fade; // Temporarily skip light fading +bool restart_halt = false; // Do not restart but stay in wait loop myio my_module; // Active copy of Module GPIOs (17 x 8 bits) gpio_flag my_module_flag; // Active copy of Template GPIO flags StateBitfield global_state; // Global states (currently Wifi and Mqtt) (8 bits)