From 3c623b52337fbb740023e35fcfb1c84ee85120d0 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 15 Feb 2021 16:51:13 +0100 Subject: [PATCH] Add autoexec failsafe --- tasmota/tasmota.ino | 2 ++ tasmota/xdrv_50_filesystem.ino | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 79c36def4..c0b7b4669 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -146,6 +146,7 @@ struct { bool restart_halt; // Do not restart but stay in wait loop bool module_changed; // Indicate module changed since last restart bool wifi_stay_asleep; // Allow sleep only incase of ESP32 BLE + bool no_autoexec; // Disable autoexec StateBitfield global_state; // Global states (currently Wifi and Mqtt) (8 bits) uint8_t spi_enabled; // SPI configured @@ -303,6 +304,7 @@ void setup(void) { } if (RtcReboot.fast_reboot_count > Settings.param[P_BOOT_LOOP_OFFSET] +2) { // Restarted 4 times Settings.rule_enabled = 0; // Disable all rules + TasmotaGlobal.no_autoexec = true; } if (RtcReboot.fast_reboot_count > Settings.param[P_BOOT_LOOP_OFFSET] +3) { // Restarted 5 times for (uint32_t i = 0; i < ARRAY_SIZE(Settings.my_gp.io); i++) { diff --git a/tasmota/xdrv_50_filesystem.ino b/tasmota/xdrv_50_filesystem.ino index fddccb214..08c7f18c8 100644 --- a/tasmota/xdrv_50_filesystem.ino +++ b/tasmota/xdrv_50_filesystem.ino @@ -798,7 +798,7 @@ bool Xdrv50(uint8_t function) { if (UfsData.autoexec) { // Safe to execute autoexec commands here UfsData.autoexec = false; - UfsAutoexec(); + if (!TasmotaGlobal.no_autoexec) { UfsAutoexec(); } } break; case FUNC_MQTT_INIT: