Added OTA updater option from esp8266. Code is manly taken from KoljaWindeler but modified in some pieces to fit current library version

This commit is contained in:
sidey79
2018-04-09 23:08:43 +02:00
parent 82309e7a84
commit 8065a1eaa4
3 changed files with 101 additions and 2 deletions
+10 -2
View File
@@ -28,6 +28,7 @@ const char * const HTTP_PORTAL_MENU[] PROGMEM = {
"<form action='/info' method='get'><button>Info</button></form><br/>\n", // MENU_INFO
"<form action='/param' method='get'><button>Setup</button></form><br/>\n",//MENU_PARAM
"<form action='/close' method='get'><button>Close</button></form><br/>\n", // MENU_CLOSE
"<form action='/update' method='get'><button>Update</button></form><br/>\n",// MENU_UPDATE
"<form action='/restart' method='get'><button>Restart</button></form><br/>\n",// MENU_RESTART
"<form action='/exit' method='get'><button>Exit</button></form><br/>\n", // MENU_EXIT
"<form action='/erase' method='get'><button class='D'>Erase</button></form><br/>\n", // MENU_ERASE
@@ -110,6 +111,10 @@ const char HTTP_HELP[] PROGMEM =
"</table>"
"<p/>More information about WiFiManager at <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>.";
const char HTTP_UPDATE[] PROGMEM = "<form method='POST' action='update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
const char HTTP_UPDATE_FAIL[] PROGMEM = "Update Failed!";
const char HTTP_UPDATE_OK[] PROGMEM = "Update OK! Rebooting now...";
#ifdef JSTEST
const char HTTP_JS[] PROGMEM =
"<script>function postAjax(url, data, success) {"
@@ -210,14 +215,15 @@ const char D_HR[] PROGMEM = "--------------------";
// -----------------------------------------------------------------------------------------------
// DO NOT EDIT BELOW THIS LINE
const uint8_t _nummenutokens = 9;
const char * const _menutokens[9] PROGMEM = {
const uint8_t _nummenutokens = 10;
const char * const _menutokens[10] PROGMEM = {
"wifi",
"wifinoscan",
"info",
"param",
"close",
"restart",
"update",
"exit",
"erase",
"sep"
@@ -235,6 +241,8 @@ const char R_exit[] PROGMEM = "/exit";
const char R_close[] PROGMEM = "/close";
const char R_erase[] PROGMEM = "/erase";
const char R_status[] PROGMEM = "/status";
const char R_update[] PROGMEM = "/u";
const char R_updatedone[] PROGMEM = "/update";
//Strings