From 528074090bae3715e8928dba32a181199aaf83eb Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 14 Mar 2020 17:46:22 +0100 Subject: [PATCH] Fix intermittent watchdog on Options save --- tasmota/xdrv_01_webserver.ino | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index aea0d4c78..562f33697 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -1952,17 +1952,26 @@ void OtherSaveSettings(void) } AddLog_P(LOG_LEVEL_INFO, message); +/* + // This sometimes provides intermittent watchdog + bool template_activate = WebServer->hasArg("t2"); // Try this to tackle intermittent watchdog after execution of Template command WebGetArg("t1", tmp, sizeof(tmp)); if (strlen(tmp)) { // {"NAME":"12345678901234","GPIO":[255,255,255,255,255,255,255,255,255,255,255,255,255],"FLAG":255,"BASE":255} char svalue[128]; snprintf_P(svalue, sizeof(svalue), PSTR(D_CMND_TEMPLATE " %s"), tmp); ExecuteWebCommand(svalue, SRC_WEBGUI); - if (WebServer->hasArg("t2")) { + if (template_activate) { snprintf_P(svalue, sizeof(svalue), PSTR(D_CMND_MODULE " 0")); ExecuteWebCommand(svalue, SRC_WEBGUI); } - + } + // Try async execution of commands +*/ + WebGetArg("t1", tmp, sizeof(tmp)); + if (strlen(tmp)) { // {"NAME":"12345678901234","GPIO":[255,255,255,255,255,255,255,255,255,255,255,255,255],"FLAG":255,"BASE":255} + snprintf_P(message, sizeof(message), PSTR(D_CMND_BACKLOG " " D_CMND_TEMPLATE " %s%s"), tmp, (WebServer->hasArg("t2")) ? "; " D_CMND_MODULE " 0" : ""); + ExecuteWebCommand(message, SRC_WEBGUI); } }