From c8148a623fadc208336c8e29c0090b5f85e6bca7 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Mon, 2 May 2022 17:25:31 +0200 Subject: [PATCH] Firmware upload using factory partition --- .../html_compressed/HTTP_HEAD_LAST_SCRIPT.h | 5 +- .../html_compressed/HTTP_HEAD_LAST_SCRIPT32.h | 32 +++++++++++++ .../html_uncompressed/HTTP_HEAD_LAST_SCRIPT.h | 2 +- .../HTTP_HEAD_LAST_SCRIPT32.h | 48 +++++++++++++++++++ tasmota/language/af_AF.h | 1 + tasmota/language/bg_BG.h | 1 + tasmota/language/cs_CZ.h | 1 + tasmota/language/de_DE.h | 1 + tasmota/language/el_GR.h | 1 + tasmota/language/en_GB.h | 1 + tasmota/language/es_ES.h | 1 + tasmota/language/fr_FR.h | 1 + tasmota/language/fy_NL.h | 1 + tasmota/language/he_HE.h | 1 + tasmota/language/hu_HU.h | 1 + tasmota/language/it_IT.h | 1 + tasmota/language/ko_KO.h | 1 + tasmota/language/nl_NL.h | 1 + tasmota/language/pl_PL.h | 1 + tasmota/language/pt_BR.h | 1 + tasmota/language/pt_PT.h | 1 + tasmota/language/ro_RO.h | 1 + tasmota/language/ru_RU.h | 1 + tasmota/language/sk_SK.h | 1 + tasmota/language/sv_SE.h | 1 + tasmota/language/tr_TR.h | 1 + tasmota/language/uk_UA.h | 1 + tasmota/language/vi_VN.h | 1 + tasmota/language/zh_CN.h | 1 + tasmota/language/zh_TW.h | 1 + tasmota/xdrv_01_webserver.ino | 35 +++++++++++++- 31 files changed, 143 insertions(+), 5 deletions(-) create mode 100644 tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT32.h create mode 100644 tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h diff --git a/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT.h b/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT.h index 41ed93443..32b31c318 100644 --- a/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT.h +++ b/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT.h @@ -2,7 +2,7 @@ // compressed by tools/unishox/compress-html-uncompressed.py ///////////////////////////////////////////////////////////////////// -const size_t HTTP_HEAD_LAST_SCRIPT_SIZE = 355; +const size_t HTTP_HEAD_LAST_SCRIPT_SIZE = 346; const char HTTP_HEAD_LAST_SCRIPT_COMPRESSED[] PROGMEM = "\x30\x2F\x83\xAD\xCE\x46\xB1\x0E\xE9\xDE\x3D\xA6\x77\xF5\x47\xC3\x8C\xEA\x2D\x3E" "\x09\x81\x8B\x1A\xFA\x8E\x86\xA1\x6F\xE6\x45\xE6\x13\x0E\xB3\xE5\x61\x04\x77\x4F" "\xBD\xE1\x82\xE8\xEA\x1C\x2E\xAB\x38\xEA\xA6\x6C\xAB\xFB\xB3\xAB\xCC\x26\x1D\x1F" @@ -13,7 +13,6 @@ const char HTTP_HEAD_LAST_SCRIPT_COMPRESSED[] PROGMEM = "\x30\x2F\x83\xAD\xCE\x4 "\x04\x1C\x87\x44\x3E\xCF\x7C\xF3\x04\x7C\xB0\xF0\x7B\xA8\xED\x9D\xB3\xC1\xEE\x3D" "\xC0\x89\xC1\x77\x8C\x1D\xDF\x03\x02\xE0\xBC\xE8\x28\xC0\x2F\x70\x2C\x74\xF5\x19" "\x04\xCE\x82\x6F\x86\x05\x66\x47\xCF\x1D\xA3\xEC\x70\x58\x19\xA1\xF6\x79\x9F\x7D" - "\x9C\xCF\xB0\x43\xD7\x47\xC2\x3B\xA6\xB1\x0E\xF1\xE0\xF4\x3B\x3C\x1F\xF4\x65\x1F" - "\x86"; + "\x9C\xCF\xB0\x43\xD7\x47\xC2\x3B\xA6\xB1\x0E\xF1\xE0"; #define HTTP_HEAD_LAST_SCRIPT Decompress(HTTP_HEAD_LAST_SCRIPT_COMPRESSED,HTTP_HEAD_LAST_SCRIPT_SIZE).c_str() \ No newline at end of file diff --git a/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT32.h b/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT32.h new file mode 100644 index 000000000..15d227b30 --- /dev/null +++ b/tasmota/html_compressed/HTTP_HEAD_LAST_SCRIPT32.h @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////// +// compressed by tools/unishox/compress-html-uncompressed.py +///////////////////////////////////////////////////////////////////// + +const size_t HTTP_HEAD_LAST_SCRIPT32_SIZE = 771; +const char HTTP_HEAD_LAST_SCRIPT32_COMPRESSED[] PROGMEM = "\x30\x2F\x83\xAD\xCE\x46\xB1\x0E\xE9\xDE\x3D\xA6\x77\xF5\x47\xC3\x8C\xEA\x2D\x3E" + "\x09\x81\x8B\x1A\xFA\x8E\x86\xA1\x6F\xE6\x45\xE6\x13\x0E\xB3\xE5\x61\x04\x77\x4F" + "\xBD\xE1\x82\xE8\xEA\x1C\x2E\xAB\x38\xEA\xA6\x6C\xAB\xFB\xB3\xAB\xCC\x26\x1D\x1F" + "\x67\x78\xF0\x3E\x2B\x42\x67\x77\x4E\x81\x3E\x1E\xA1\x47\xE1\xF2\x8E\xF1\xED\xD3" + "\x07\x77\x4F\x7A\x8F\x7C\xEF\x1E\xDD\x3D\xEA\x3D\xF3\xDE\x3E\xFA\xC6\xB3\xEC\xF7" + "\xCF\x87\x77\x4F\x7A\x8F\x7C\xE8\x2A\x2B\xFC\x57\x55\xFD\x1C\x2E\x99\xDD\x3E\xF4" + "\x43\xEC\xEF\x1F\xA3\xF4\x77\x4F\xE0\x27\x57\xEB\x1A\xCF\xB3\xBC\x77\x8E\xF1\xDA" + "\x04\x1C\x87\x44\x3E\xCF\x7C\xF3\x04\x7C\xB0\xF0\x7B\xA8\xED\x9D\xB3\xC1\xEE\x3D" + "\xC0\x89\xC1\x77\x8C\x1D\xDF\x03\x02\xE0\xBC\xE8\x28\xC0\x2F\x70\x2C\x74\xF5\x19" + "\x04\xCE\x82\x6F\x86\x05\x66\x47\xCF\x1D\xA3\xEC\x70\x58\x19\xA1\xF6\x79\x9F\x7D" + "\x9C\xCF\xB0\x43\xD7\x47\xC2\x3B\xA6\xB1\x0E\xF1\xE0\x11\x76\x41\x67\x76\x8E\xF1" + "\xED\x63\x8E\xE9\xF6\x60\xE5\x9F\x67\x78\x81\x2B\x21\x04\x2C\x5D\x8E\x3B\xA7\xD9" + "\x83\x94\x40\x9B\x68\x10\x73\xD3\xC5\x1D\x0C\x67\xC6\x9D\x3C\x2C\x70\xDD\xA3\xBA" + "\x77\x8F\x2A\x01\x8B\xC2\x09\x80\xE8\xEE\xD0\x20\xF0\x84\x6C\x3E\x73\x1F\x44\x6C" + "\x21\xA4\x11\x0A\xAA\x18\x5F\x66\xA1\x6F\xD4\x77\x4E\xF1\xE0\xD8\x74\xC1\x8F\x8E" + "\xE9\xF6\x43\xC4\xCA\x8F\xB3\xA8\xFB\x3B\x05\x9C\xC3\xB4\x42\xCE\x61\xF0\x8C\x07" + "\x47\xEA\xC6\x69\xF0\xFB\x3A\xAB\xE2\xD9\xDE\x3C\x1B\x0E\x99\xDF\x76\x21\x97\xAA" + "\xE9\x86\x2A\x2B\xF8\x79\x9F\x0E\xE9\xDE\x3E\x1F\x87\xB7\x4C\x1D\xD3\x61\xD3\xEE" + "\xC4\x32\x2F\x55\xD3\x3E\x1F\x0E\x61\xFA\x3F\x44\x6C\x3A\x7A\xAE\x85\xF8\xF8\x7C" + "\x39\x4D\x90\x20\xEB\x3E\x3E\x1B\x0E\x9F\x7E\x19\x9D\xE6\x54\xCD\x94\x78\xD3\x07" + "\x77\xC7\xC3\xE1\xF6\x62\xC2\xF3\x3E\xCE\xF7\x9D\x15\x68\xD7\x82\xE8\xEE\x9D\xD3" + "\xBC\x7C\x3F\x0F\x68\x20\xF0\x26\x78\x3D\xC7\x51\xCE\x6D\x9D\xE2\x04\x3C\x26\xBE" + "\x2D\x9F\x67\x7B\xC2\xCE\xED\x1D\xE3\xC1\xEE\x61\x79\xA0\x59\xD6\x8E\x33\xBC\x7B" + "\x48\x15\x33\x53\x94\xDB\x3B\xC7\x83\xDC\x78\x3D\xC7\x82\x36\x1D\x3C\xF8\x43\xBA" + "\x77\x8F\x1F\x74\x2F\xFC\x8C\x58\x5E\x67\x83\xDC\x7A\x1D\x9E\x0F\xFA\x32\x8F\xC3"; + +#define HTTP_HEAD_LAST_SCRIPT32 Decompress(HTTP_HEAD_LAST_SCRIPT32_COMPRESSED,HTTP_HEAD_LAST_SCRIPT32_SIZE).c_str() \ No newline at end of file diff --git a/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT.h b/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT.h index 6a3a01c49..5818df491 100644 --- a/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT.h +++ b/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT.h @@ -18,4 +18,4 @@ const char HTTP_HEAD_LAST_SCRIPT[] PROGMEM = "}" "}" "wl(jd);" // Add name='' to any id='' in input,button,textarea,select - ""; + ; diff --git a/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h b/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h new file mode 100644 index 000000000..1b651cc52 --- /dev/null +++ b/tasmota/html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h @@ -0,0 +1,48 @@ +const char HTTP_HEAD_LAST_SCRIPT32[] PROGMEM = + "function jd(){" // Add label name='' based on provided id='' + "var t=0,i=document.querySelectorAll('input,button,textarea,select');" + "while(i.length>=t){" + "if(i[t]){" + "i[t]['name']=(i[t].hasAttribute('id')&&(!i[t].hasAttribute('name')))?i[t]['id']:i[t]['name'];" + "}" + "t++;" + "}" + "}" + "function sf(s){" + "var t=0,i=document.querySelectorAll('.hf');" + "while(i.length>=t){" + "if(i[t]){" + "i[t].style.display=s?'block':'none';" + "}" + "t++;" + "}" + "}" + "wl(jd);" // Add name='' to any id='' in input,button,textarea,select + // experimental + "function su(t){" + // "console.log('su()');" + "eb('f3').style.display='none';" + "eb('f2').style.display='block';" + "t.form.submit();" + "}" + "function fct(t){" + // "console.log('running fct');" + // "console.log(t);" + "var x=new XMLHttpRequest();" + "x.open('GET','/u4?u4=fct&api=',true);" + "x.onreadystatechange=()=>{" + // "console.log('x.readyState=%%i x.status=%%i',x.readyState,x.status);" + "if(x.readyState==4&&x.status==200){" + "var s=x.responseText;" + // "console.log('responseText:'+s);" + "if(s=='false')setTimeout(()=>{fct(t);},6000);" + "if(s=='true')su(t);" + "}else if(x.readyState==4&&x.status==0){" + "setTimeout(()=>{fct(t);},2000);" // retry in 2 seconds + "};" + "};" + "x.send();" + // "console.log('after send');" + "return false;" + "}" + ""; diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index e421316cc..8d96dd5d8 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Begin opgradering" #define D_UPGRADE_BY_FILE_UPLOAD "Gradeer op volgens lêeroplaai" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Oplaai begin" #define D_UPGRADE_STARTED "Opgradering is begin" #define D_UPLOAD_DONE "Oplaai gedoen" diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index 0e3a49ac0..d38d30f81 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -372,6 +372,7 @@ #define D_OTA_URL "Адрес на сървър за OTA" #define D_START_UPGRADE "Начало на обновяване" #define D_UPGRADE_BY_FILE_UPLOAD "Обновяване от файл" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Качване" #define D_UPGRADE_STARTED "Обновяване" #define D_UPLOAD_DONE "Качването завърши" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index 69d11e2d8..628a87aca 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -372,6 +372,7 @@ #define D_OTA_URL "URL OTA" #define D_START_UPGRADE "Start aktualizace" #define D_UPGRADE_BY_FILE_UPLOAD "Aktualizace nahráním souboru" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Nahrávání zahájeno" #define D_UPGRADE_STARTED "Zahájení aktualizace" #define D_UPLOAD_DONE "Nahrávání ukončeno" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 2581479ef..b4365df39 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA-URL" #define D_START_UPGRADE "Update starten" #define D_UPGRADE_BY_FILE_UPLOAD "Update Datei hochladen" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Upload gestartet" #define D_UPGRADE_STARTED "Update gestartet" #define D_UPLOAD_DONE "Upload abgeschlossen" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index 2586f53fd..4ce0c2b43 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA URL" #define D_START_UPGRADE "Εκκίνηση αναβάθμισης" #define D_UPGRADE_BY_FILE_UPLOAD "Αναβάθμιση με μεταφόρτωση αρχείου" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Η μεταφόρτωση ξεκίνησε" #define D_UPGRADE_STARTED "Η αναβάθμιση ξεκίνησε" #define D_UPLOAD_DONE "Η μεταφόρτωση ολοκληρώθηκε" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 750e68227..cdb40a7a7 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Start upgrade" #define D_UPGRADE_BY_FILE_UPLOAD "Upgrade by file upload" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Upload started" #define D_UPGRADE_STARTED "Upgrade started" #define D_UPLOAD_DONE "Upload done" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 30fc163f9..2479a92d9 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Comenzar actualización" #define D_UPGRADE_BY_FILE_UPLOAD "Actualizar cargando archivo bin" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Cargando archivo" #define D_UPGRADE_STARTED "Actualización iniciada" #define D_UPLOAD_DONE "Carga finalizada" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index 387bb189f..37d99584c 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -372,6 +372,7 @@ #define D_OTA_URL "URL OTA" #define D_START_UPGRADE "Lancer la mise à jour" #define D_UPGRADE_BY_FILE_UPLOAD "Mise à jour par téléchargement fichier" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Téléchargement lancé" #define D_UPGRADE_STARTED "Mise à jour lancée" #define D_UPLOAD_DONE "Téléchargement terminé" diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index 3526a45e0..15b92f7c3 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Begjin upgrade" #define D_UPGRADE_BY_FILE_UPLOAD "Upgrade op bestân upload" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Upload begon" #define D_UPGRADE_STARTED "Upgrade begon" #define D_UPLOAD_DONE "Upload dien" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index f0af2f18b..e157192cb 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA כתובת" #define D_START_UPGRADE "התחל בשדרוג" #define D_UPGRADE_BY_FILE_UPLOAD "שדרוג דרך קובץ נכשל" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "העלאה מתחילה" #define D_UPGRADE_STARTED "שדרוג מתחיל" #define D_UPLOAD_DONE "העלאה הסתיימה" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index fd862bbc8..e83341bca 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA URL" #define D_START_UPGRADE "Frissítés" #define D_UPGRADE_BY_FILE_UPLOAD "Frissítés helyi fájllal" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Feltöltés elindítva" #define D_UPGRADE_STARTED "Frissítés elindítva" #define D_UPLOAD_DONE "Feltöltés kész" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index b431cd319..e8622e37e 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -372,6 +372,7 @@ #define D_OTA_URL "URL OTA" #define D_START_UPGRADE "Esegui aggiornamento" #define D_UPGRADE_BY_FILE_UPLOAD "Aggiornamento tramite file locale" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Caricamento..." #define D_UPGRADE_STARTED "Aggiornamento..." #define D_UPLOAD_DONE "Caricamento completato" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index f2182dde3..261345b88 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "업그레이드 시작" #define D_UPGRADE_BY_FILE_UPLOAD "파일에서 업로드해 업그레이드" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "업로드 시작됨" #define D_UPGRADE_STARTED "업그레이드 시작됨" #define D_UPLOAD_DONE "업그레이드 완료" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index 5b13fe1eb..db0de2f7e 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Start opwaarderen" #define D_UPGRADE_BY_FILE_UPLOAD "Opwaarderen dmv verzenden bestand" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Verzending gestart" #define D_UPGRADE_STARTED "Opwaarderen gestart" #define D_UPLOAD_DONE "Opwaarderen klaar" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index c46c699ee..88eb1f797 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -372,6 +372,7 @@ #define D_OTA_URL "Adres serwera" #define D_START_UPGRADE "Aktualizuj" #define D_UPGRADE_BY_FILE_UPLOAD "Aktualizacja z pliku" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Wgrywanie rozpoczęte" #define D_UPGRADE_STARTED "Aktualizacja rozpoczęta" #define D_UPLOAD_DONE "Wgrywanie zakończone" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index 1b05ad513..ae3234214 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA URL" #define D_START_UPGRADE "Iniciar atualização" #define D_UPGRADE_BY_FILE_UPLOAD "Atualização por arquivo local" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Início do envio" #define D_UPGRADE_STARTED "Atualização iniciada" #define D_UPLOAD_DONE "Atualização finalizada" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index c5200a61d..10b0252bc 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -372,6 +372,7 @@ #define D_OTA_URL "Url OTA" #define D_START_UPGRADE "Iniciar atualização" #define D_UPGRADE_BY_FILE_UPLOAD "Atualizar por envio de ficheiro" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Envio Iniciado" #define D_UPGRADE_STARTED "Atualização Iniciada" #define D_UPLOAD_DONE "Atualização Finalizada" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index 095f2a777..bdb183bf9 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Porneste actualizare" #define D_UPGRADE_BY_FILE_UPLOAD "Actualizare prin încărcare fișier" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Încărcare începută" #define D_UPGRADE_STARTED "Actualizare începută" #define D_UPLOAD_DONE "Încărcare terminată" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 66b3ded98..e37f5142d 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Начать обновление" #define D_UPGRADE_BY_FILE_UPLOAD "Обновление путем загрузки файлов" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Загрузка началась" #define D_UPGRADE_STARTED "Обновление началось" #define D_UPLOAD_DONE "Загрузка завершена" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 2205db29e..564783ee3 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -372,6 +372,7 @@ #define D_OTA_URL "URL OTA" #define D_START_UPGRADE "Spustiť aktualizáciu" #define D_UPGRADE_BY_FILE_UPLOAD "Aktualizácia nahraním súboru" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Nahrávanie spustené" #define D_UPGRADE_STARTED "Aktualizácia spustená" #define D_UPLOAD_DONE "Nahrávanie ukončené" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index 6727802c7..1021c512b 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Starta uppdatering" #define D_UPGRADE_BY_FILE_UPLOAD "Uppgradering via filuppladdning" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Uppladdning startad" #define D_UPGRADE_STARTED "Uppgradeing startad" #define D_UPLOAD_DONE "Uppladdning klar" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index 7e0782f36..78a0924e5 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA Url" #define D_START_UPGRADE "Yükseltmeyi başlat" #define D_UPGRADE_BY_FILE_UPLOAD "Dosya kullanrak yükset" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Yükleme başlatıldı" #define D_UPGRADE_STARTED "YÜkestlme başlatıldı" #define D_UPLOAD_DONE "Yükleme Tamamlandı" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index 0d9238bc7..e5b948ec7 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA URL" #define D_START_UPGRADE "Почати оновлення" #define D_UPGRADE_BY_FILE_UPLOAD "Оновлення шляхом завантаження файлів" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Завантаження почалось" #define D_UPGRADE_STARTED "Оновлення почалось" #define D_UPLOAD_DONE "Завантаження завершено" diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index 98194eae9..bb9d23a57 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -372,6 +372,7 @@ #define D_OTA_URL "Đường dẫn OTA" #define D_START_UPGRADE "Bắt đầu nâng cấp" #define D_UPGRADE_BY_FILE_UPLOAD "Nâng cấp thông qua tải lên tệp" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "Bắt đầu tải lên" #define D_UPGRADE_STARTED "Bắt đầu nâng cấp" #define D_UPLOAD_DONE "Hoàn thành tải tệp" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index d8631eee4..a5c6381a6 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA 地址" #define D_START_UPGRADE "开始升级" #define D_UPGRADE_BY_FILE_UPLOAD "通过文件升级" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "开始上传" #define D_UPGRADE_STARTED "开始升级" #define D_UPLOAD_DONE "上传完成" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 81616bcfc..5aab42a00 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -372,6 +372,7 @@ #define D_OTA_URL "OTA網址" #define D_START_UPGRADE "開始升級" #define D_UPGRADE_BY_FILE_UPLOAD "透過檔案升級" +#define D_UPLOAD_FACTORY "Switching to safeboot partition" #define D_UPLOAD_STARTED "已開始上傳" #define D_UPGRADE_STARTED "已開始升級" #define D_UPLOAD_DONE "已上傳完成" diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 7609cff82..3b129e3c6 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -209,10 +209,12 @@ const char HTTP_SCRIPT_INFO_END[] PROGMEM = #ifdef USE_UNISHOX_COMPRESSION #include "./html_compressed/HTTP_HEAD_LAST_SCRIPT.h" + #include "./html_compressed/HTTP_HEAD_LAST_SCRIPT32.h" #include "./html_compressed/HTTP_HEAD_STYLE1.h" #include "./html_compressed/HTTP_HEAD_STYLE2.h" #else #include "./html_uncompressed/HTTP_HEAD_LAST_SCRIPT.h" + #include "./html_uncompressed/HTTP_HEAD_LAST_SCRIPT32.h" #include "./html_uncompressed/HTTP_HEAD_STYLE1.h" #include "./html_uncompressed/HTTP_HEAD_STYLE2.h" #endif @@ -354,6 +356,16 @@ const char HTTP_FORM_RST_UPG[] PROGMEM = "" ""; +// upload via factory partition +const char HTTP_FORM_RST_UPG_FCT[] PROGMEM = + "
" + "

" + "
" + "" + "" + "" + ""; + const char HTTP_FORM_CMND[] PROGMEM = "


" "
" @@ -844,7 +856,11 @@ void WSContentSendStyle_P(const char* formatP, ...) { WSContentSend_P(HTTP_SCRIPT_COUNTER); } } +#ifdef ESP32 + WSContentSend_P(HTTP_HEAD_LAST_SCRIPT32); +#else WSContentSend_P(HTTP_HEAD_LAST_SCRIPT); +#endif WSContentSend_P(HTTP_HEAD_STYLE1, WebColor(COL_FORM), WebColor(COL_INPUT), WebColor(COL_INPUT_TEXT), WebColor(COL_INPUT), WebColor(COL_INPUT_TEXT), WebColor(COL_CONSOLE), WebColor(COL_CONSOLE_TEXT), WebColor(COL_BACKGROUND)); @@ -2286,7 +2302,15 @@ void HandleRestoreConfiguration(void) WSContentStart_P(PSTR(D_RESTORE_CONFIGURATION)); WSContentSendStyle(); WSContentSend_P(HTTP_FORM_RST); +#ifdef ESP32 + if (EspSingleOtaPartition() && !EspRunningFactoryPartition()) { + WSContentSend_P(HTTP_FORM_RST_UPG_FCT, PSTR(D_RESTORE)); + } else { + WSContentSend_P(HTTP_FORM_RST_UPG, PSTR(D_RESTORE)); + } +#else WSContentSend_P(HTTP_FORM_RST_UPG, PSTR(D_RESTORE)); +#endif if (WifiIsInManagerMode()) { WSContentSpaceButton(BUTTON_MAIN); } else { @@ -2511,7 +2535,15 @@ void HandleUpgradeFirmware(void) { WSContentStart_P(PSTR(D_FIRMWARE_UPGRADE)); WSContentSendStyle(); WSContentSend_P(HTTP_FORM_UPG, SettingsText(SET_OTAURL)); +#ifdef ESP32 + if (EspSingleOtaPartition() && !EspRunningFactoryPartition()) { + WSContentSend_P(HTTP_FORM_RST_UPG_FCT, PSTR(D_UPGRADE)); + } else { + WSContentSend_P(HTTP_FORM_RST_UPG, PSTR(D_UPGRADE)); + } +#else WSContentSend_P(HTTP_FORM_RST_UPG, PSTR(D_UPGRADE)); +#endif WSContentSpaceButton(BUTTON_MAIN); WSContentStop(); @@ -2955,8 +2987,9 @@ void HandleSwitchFactory(void) Webserver->send(302, "text/plain", ""); } } + Web.upload_file_type = UPL_TASMOTA; } -#endif +#endif // ESP32 /*-------------------------------------------------------------------------------------------*/