diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index 09df2dd7d..a6c2a2a1c 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -95,7 +95,12 @@ const char HTTP_SCRIPT_WIFI[] PROGMEM = "}"; const char HTTP_SCRIPT_RELOAD[] PROGMEM = - "setTimeout(function(){location.href='.';},5000);" + "setTimeout(function(){location.href='.';},9000);" + ""; + +// Local OTA upgrade requires more time to complete cp: before web ui should be reloaded +const char HTTP_SCRIPT_RELOAD_OTA[] PROGMEM = + "setTimeout(function(){location.href='.';},20000);" ""; const char HTTP_SCRIPT_CONSOL[] PROGMEM = @@ -1463,7 +1468,7 @@ void HandleUploadDone(void) } else { page += F("green'>" D_SUCCESSFUL "
"); page += FPSTR(HTTP_MSG_RSTRT); - page.replace(F(""), FPSTR(HTTP_SCRIPT_RELOAD)); + page.replace(F(""), FPSTR(HTTP_SCRIPT_RELOAD_OTA)); // Refesh main web ui after OTA upgrade ShowWebSource(SRC_WEBGUI); restart_flag = 2; // Always restart to re-enable disabled features during update }