Update nodenames

This commit is contained in:
fvanroie 2020-03-10 15:13:27 +01:00
parent 15a61188fd
commit 8b80a331d8

View File

@ -137,7 +137,6 @@ void webSendFooter()
void webSendPage(String & nodename, uint32_t httpdatalength, bool gohome = false) void webSendPage(String & nodename, uint32_t httpdatalength, bool gohome = false)
{ {
char buffer[128]; char buffer[128];
snprintf_P(buffer, sizeof(buffer), PSTR("%u.%u.%u"), HASP_VERSION_MAJOR, HASP_VERSION_MINOR, HASP_VERSION_REVISION); snprintf_P(buffer, sizeof(buffer), PSTR("%u.%u.%u"), HASP_VERSION_MAJOR, HASP_VERSION_MINOR, HASP_VERSION_REVISION);
/* Calculate Content Length upfront */ /* Calculate Content Length upfront */
@ -167,18 +166,27 @@ void webSendPage(String & nodename, uint32_t httpdatalength, bool gohome = false
webServer.sendContent_P(HTTP_HEADER_END); // 80 webServer.sendContent_P(HTTP_HEADER_END); // 80
} }
void webSendPage(uint32_t httpdatalength, bool gohome = false)
{
String nodename((char *)0);
nodename.reserve(128);
nodename = mqttGetNodename();
webSendPage(nodename, httpdatalength, gohome);
}
void webHandleRoot() void webHandleRoot()
{ {
if(!httpIsAuthenticated(F("root"))) return; if(!httpIsAuthenticated(F("root"))) return;
// char buffer[128]; String nodename((char *)0);
String nodename = haspGetNodename(); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += String(F("<h1>")); httpMessage += nodename;
httpMessage += String(nodename); httpMessage += F("</h1><hr>");
httpMessage += String(F("</h1>"));
httpMessage += F("<p><form method='get' action='info'><button type='submit'>Information</button></form></p>"); httpMessage += F("<p><form method='get' action='info'><button type='submit'>Information</button></form></p>");
httpMessage += F("<p><form method='get' action='screenshot'><button type='submit'>Screenshot</button></form></p>"); httpMessage += F("<p><form method='get' action='screenshot'><button type='submit'>Screenshot</button></form></p>");
@ -207,8 +215,17 @@ void httpHandleReboot()
{ // http://plate01/reboot { // http://plate01/reboot
if(!httpIsAuthenticated(F("reboot"))) return; if(!httpIsAuthenticated(F("reboot"))) return;
String nodename = haspGetNodename(); String nodename((char *)0);
String httpMessage = F("Rebooting Device"); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage = F("Rebooting Device");
webSendPage(nodename, httpMessage.length(), true); webSendPage(nodename, httpMessage.length(), true);
webServer.sendContent(httpMessage); webServer.sendContent(httpMessage);
httpMessage.clear(); httpMessage.clear();
@ -230,9 +247,15 @@ void webHandleScreenshot()
guiTakeScreenshot(webServer); guiTakeScreenshot(webServer);
} else { } else {
String nodename = haspGetNodename(); String nodename((char *)0);
nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage += F("<p class='c'><img id='bmp' src='?q=0'></p>"); httpMessage += F("<p class='c'><img id='bmp' src='?q=0'></p>");
httpMessage += F("<p><form method='get' onsubmit=\"var timestamp = new Date().getTime();var "); httpMessage += F("<p><form method='get' onsubmit=\"var timestamp = new Date().getTime();var ");
@ -253,7 +276,10 @@ void webHandleAbout()
{ // http://plate01/about { // http://plate01/about
if(!httpIsAuthenticated(F("about"))) return; if(!httpIsAuthenticated(F("about"))) return;
String nodename = haspGetNodename(); String nodename((char *)0);
nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
@ -297,15 +323,24 @@ void webHandleInfo()
{ // http://plate01/ { // http://plate01/
if(!httpIsAuthenticated(F("info"))) return; if(!httpIsAuthenticated(F("info"))) return;
// char buffer[128]; String nodename((char *)0);
String nodename = haspGetNodename(); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
/* HASP Stats */ /* HASP Stats */
httpMessage += F("<hr><b>HASP Version: </b>"); httpMessage += F("<b>HASP Version: </b>");
httpMessage += String(haspGetVersion()); httpMessage += String(haspGetVersion());
httpMessage += F("<br/><b>Uptime: </b>"); httpMessage += F("<b>Build DateTime: </b>");
httpMessage += __DATE__;
httpMessage += F(" ");
httpMessage += __TIME__;
httpMessage += F(" CET<br/><b>Uptime: </b>");
httpMessage += String(long(millis() / 1000)); httpMessage += String(long(millis() / 1000));
httpMessage += F("<br/><b>Free Memory: </b>"); httpMessage += F("<br/><b>Free Memory: </b>");
httpMessage += spiffsFormatBytes(ESP.getFreeHeap()); httpMessage += spiffsFormatBytes(ESP.getFreeHeap());
@ -322,8 +357,8 @@ void webHandleInfo()
httpMessage += F("<br/><b>LVGL Fragmentation: </b>"); httpMessage += F("<br/><b>LVGL Fragmentation: </b>");
httpMessage += mem_mon.frag_pct; httpMessage += mem_mon.frag_pct;
// httpMessage += String(F("<br/><b>LCD Model: </b>")) + String(LV_HASP_HOR_RES_MAX) + " x " + // httpMessage += F("<br/><b>LCD Model: </b>")) + String(LV_HASP_HOR_RES_MAX) + " x " +
// String(LV_HASP_VER_RES_MAX); httpMessage += String(F("<br/><b>LCD Version: </b>")) + String(lcdVersion); // String(LV_HASP_VER_RES_MAX); httpMessage += F("<br/><b>LCD Version: </b>")) + String(lcdVersion);
httpMessage += F("</p/><p><b>LCD Active Page: </b>"); httpMessage += F("</p/><p><b>LCD Active Page: </b>");
httpMessage += String(haspGetPage()); httpMessage += String(haspGetPage());
@ -344,12 +379,12 @@ void webHandleInfo()
/* Mqtt Stats */ /* Mqtt Stats */
httpMessage += F("</p/><p><b>MQTT Status: </b>"); httpMessage += F("</p/><p><b>MQTT Status: </b>");
if(mqttIsConnected()) { // Check MQTT connection if(mqttIsConnected()) { // Check MQTT connection
httpMessage += String(F("Connected")); httpMessage += F("Connected");
} else { } else {
httpMessage += String(F("<font color='red'><b>Disconnected</b></font>, return code: ")); httpMessage += F("<font color='red'><b>Disconnected</b></font>, return code: ");
// +String(mqttClient.returnCode()); // +String(mqttClient.returnCode());
} }
httpMessage += String(F("<br/><b>MQTT ClientID: </b>")); httpMessage += F("<br/><b>MQTT ClientID: </b>");
// +String(mqttClientId); // +String(mqttClientId);
/* ESP Stats */ /* ESP Stats */
@ -665,12 +700,16 @@ void webHandleConfig()
httpHandleReboot(); httpHandleReboot();
} }
// char buffer[128]; String nodename((char *)0);
String nodename = haspGetNodename(); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage += F("<hr>");
httpMessage += httpMessage +=
F("<p><form method='get' action='/config/wifi'><button type='submit'>Wifi Settings</button></form></p>"); F("<p><form method='get' action='/config/wifi'><button type='submit'>Wifi Settings</button></form></p>");
@ -709,14 +748,21 @@ void webHandleMqttConfig()
{ // http://plate01/config/mqtt { // http://plate01/config/mqtt
if(!httpIsAuthenticated(F("config/mqtt"))) return; if(!httpIsAuthenticated(F("config/mqtt"))) return;
String nodename((char *)0);
nodename.reserve(128);
nodename = mqttGetNodename();
DynamicJsonDocument settings(256); DynamicJsonDocument settings(256);
mqttGetConfig(settings.to<JsonObject>()); mqttGetConfig(settings.to<JsonObject>());
// char buffer[128]; // char buffer[128];
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage += String(F("<form method='POST' action='/config'>")); httpMessage += F("<form method='POST' action='/config'>");
httpMessage += F("<b>HASP Node Name</b> <i><small>(required. lowercase letters, numbers, and _ only)</small>" httpMessage += F("<b>HASP Node Name</b> <i><small>(required. lowercase letters, numbers, and _ only)</small>"
"</i><input id='name' required name='name' maxlength=15 " "</i><input id='name' required name='name' maxlength=15 "
"placeholder='HASP Node Name' pattern='[a-z0-9_]*' value='"); "placeholder='HASP Node Name' pattern='[a-z0-9_]*' value='");
@ -741,7 +787,6 @@ void webHandleMqttConfig()
httpMessage += httpMessage +=
PSTR("<p><form method='get' action='/config'><button type='submit'>Configuration</button></form></p>"); PSTR("<p><form method='get' action='/config'><button type='submit'>Configuration</button></form></p>");
String nodename = haspGetNodename();
webSendPage(nodename, httpMessage.length(), false); webSendPage(nodename, httpMessage.length(), false);
webServer.sendContent(httpMessage); webServer.sendContent(httpMessage);
httpMessage.clear(); httpMessage.clear();
@ -757,20 +802,25 @@ void webHandleGuiConfig()
DynamicJsonDocument settings(256); DynamicJsonDocument settings(256);
guiGetConfig(settings.to<JsonObject>()); guiGetConfig(settings.to<JsonObject>());
// char buffer[128]; String nodename((char *)0);
String nodename = haspGetNodename(); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage += String(F("<form method='POST' action='/config'>")); httpMessage += F("<form method='POST' action='/config'>");
httpMessage += String(F("<p><b>Short Idle</b> <input id='idle1' required " httpMessage += F("<p><b>Short Idle</b> <input id='idle1' required "
"name='idle1' type='number' min='0' max='32400' value='")); "name='idle1' type='number' min='0' max='32400' value='");
httpMessage += settings[FPSTR(F_GUI_IDLEPERIOD1)].as<String>(); httpMessage += settings[FPSTR(F_GUI_IDLEPERIOD1)].as<String>();
httpMessage += F("'></p>"); httpMessage += F("'></p>");
httpMessage += String(F("<p><b>Long Idle</b> <input id='idle2' required " httpMessage += F("<p><b>Long Idle</b> <input id='idle2' required "
"name='idle2' type='number' min='0' max='32400' value='")); "name='idle2' type='number' min='0' max='32400' value='");
httpMessage += settings[FPSTR(F_GUI_IDLEPERIOD2)].as<String>(); httpMessage += settings[FPSTR(F_GUI_IDLEPERIOD2)].as<String>();
httpMessage += F("'></p>"); httpMessage += F("'></p>");
@ -827,17 +877,22 @@ void webHandleWifiConfig()
DynamicJsonDocument settings(256); DynamicJsonDocument settings(256);
wifiGetConfig(settings.to<JsonObject>()); wifiGetConfig(settings.to<JsonObject>());
// char buffer[128]; String nodename((char *)0);
String nodename = haspGetNodename(); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage += String(F("<form method='POST' action='/config'>")); httpMessage += F("<form method='POST' action='/config'>");
httpMessage += String(F("<b>WiFi SSID</b> <i><small>(required)</small></i><input id='ssid' required " httpMessage += F("<b>WiFi SSID</b> <i><small>(required)</small></i><input id='ssid' required "
"name='ssid' maxlength=32 placeholder='WiFi SSID' value='")); "name='ssid' maxlength=31 placeholder='WiFi SSID' value='");
httpMessage += settings[FPSTR(F_CONFIG_SSID)].as<String>(); httpMessage += settings[FPSTR(F_CONFIG_SSID)].as<String>();
httpMessage += String(F("'><br/><b>WiFi Password</b> <i><small>(required)</small></i><input id='pass' required " httpMessage += F("'><br/><b>WiFi Password</b> <i><small>(required)</small></i><input id='pass' required "
"name='pass' type='password' maxlength=64 placeholder='WiFi Password' value='")); "name='pass' type='password' maxlength=63 placeholder='WiFi Password' value='");
if(settings[FPSTR(F_CONFIG_PASS)].as<String>() != "") { if(settings[FPSTR(F_CONFIG_PASS)].as<String>() != "") {
httpMessage += F("********"); httpMessage += F("********");
} }
@ -864,17 +919,22 @@ void webHandleHttpConfig()
DynamicJsonDocument settings(256); DynamicJsonDocument settings(256);
httpGetConfig(settings.to<JsonObject>()); httpGetConfig(settings.to<JsonObject>());
// char buffer[128]; String nodename((char *)0);
String nodename = haspGetNodename(); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage += String(F("<form method='POST' action='/config'>")); httpMessage += F("<form method='POST' action='/config'>");
httpMessage += String(F("<b>Web Username</b> <i><small>(optional)</small></i><input id='user' " httpMessage += F("<b>Web Username</b> <i><small>(optional)</small></i><input id='user' "
"name='user' maxlength=32 placeholder='admin' value='")); "name='user' maxlength=31 placeholder='admin' value='");
httpMessage += settings[FPSTR(F_CONFIG_USER)].as<String>(); httpMessage += settings[FPSTR(F_CONFIG_USER)].as<String>();
httpMessage += String(F("'><br/><b>Web Password</b> <i><small>(optional)</small></i><input id='pass' " httpMessage += F("'><br/><b>Web Password</b> <i><small>(optional)</small></i><input id='pass' "
"name='pass' type='password' maxlength=64 placeholder='Password' value='")); "name='pass' type='password' maxlength=63 placeholder='Password' value='");
if(settings[FPSTR(F_CONFIG_PASS)].as<String>() != "") { if(settings[FPSTR(F_CONFIG_PASS)].as<String>() != "") {
httpMessage += F("********"); httpMessage += F("********");
} }
@ -898,14 +958,19 @@ void webHandleDebugConfig()
DynamicJsonDocument settings(256); DynamicJsonDocument settings(256);
debugGetConfig(settings.to<JsonObject>()); debugGetConfig(settings.to<JsonObject>());
// char buffer[128]; String nodename((char *)0);
String nodename = haspGetNodename(); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage += String(F("<form method='POST' action='/config'>")); httpMessage += F("<form method='POST' action='/config'>");
httpMessage += String(F("<p><b>Telemetry Period</b> <input id='teleperiod' required " httpMessage += F("<p><b>Telemetry Period</b> <input id='teleperiod' required "
"name='idle1' type='number' min='0' max='65535' value='")); "name='idle1' type='number' min='0' max='65535' value='");
httpMessage += settings[FPSTR(F_DEBUG_TELEPERIOD)].as<String>(); httpMessage += settings[FPSTR(F_DEBUG_TELEPERIOD)].as<String>();
httpMessage += F("'></p>"); httpMessage += F("'></p>");
httpMessage += F("<p><button type='submit' name='save' value='debug'>Save Settings</button></p></form>"); httpMessage += F("<p><button type='submit' name='save' value='debug'>Save Settings</button></p></form>");
@ -927,14 +992,19 @@ void webHandleHaspConfig()
DynamicJsonDocument settings(256); DynamicJsonDocument settings(256);
haspGetConfig(settings.to<JsonObject>()); haspGetConfig(settings.to<JsonObject>());
// char buffer[128]; String nodename((char *)0);
String nodename = haspGetNodename(); nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
httpMessage += F("<p><form action='/edit' method='post' enctype='multipart/form-data'><input type='file' " httpMessage += F("<p><form action='/edit' method='post' enctype='multipart/form-data'><input type='file' "
"name='filename' accept='.jsonl,.zi'>"); "name='filename' accept='.jsonl,.zi'>");
httpMessage += F("<hr><button type='submit'>Upload File</button></form></p>"); httpMessage += F("<button type='submit'>Upload File</button></form></p><hr>");
httpMessage += F("<form method='POST' action='/config'>"); httpMessage += F("<form method='POST' action='/config'>");
httpMessage += F("<p><b>UI Theme</b> <i><small>(required)</small></i><select id='theme' name='theme'>"); httpMessage += F("<p><b>UI Theme</b> <i><small>(required)</small></i><select id='theme' name='theme'>");
@ -996,12 +1066,12 @@ void webHandleHaspConfig()
#endif #endif
httpMessage += F("</select></p>"); httpMessage += F("</select></p>");
httpMessage += F("<p><b>Pages File</b> <i><small>(required)</small></i><input id='pages' required " httpMessage += F("<p><b>Startup Layout</b> <i><small>(optional)</small></i><input id='pages' "
"name='pages' maxlength=32 placeholder='/pages.jsonl' value='"); "name='pages' maxlength=31 placeholder='/pages.jsonl' value='");
httpMessage += settings[FPSTR(F_CONFIG_PAGES)].as<String>(); httpMessage += settings[FPSTR(F_CONFIG_PAGES)].as<String>();
httpMessage += String(F("'></br><b>Startup Page</b> <i><small>(required)</small></i><input id='startpage' required " httpMessage += F("'></br><b>Startup Page</b> <i><small>(required)</small></i><input id='startpage' required "
"name='startpage' type='number' min='0' max='3' value='")); "name='startpage' type='number' min='0' max='3' value='");
httpMessage += settings[FPSTR(F_CONFIG_STARTPAGE)].as<String>(); httpMessage += settings[FPSTR(F_CONFIG_STARTPAGE)].as<String>();
httpMessage += httpMessage +=
F("'></p><p><b>Startup Brightness</b> <i><small>(required)</small></i><input id='startpage' required " F("'></p><p><b>Startup Brightness</b> <i><small>(required)</small></i><input id='startpage' required "
@ -1028,6 +1098,7 @@ void httpHandleNotFound()
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("File Not Found\n\nURI: "); httpMessage += F("File Not Found\n\nURI: ");
httpMessage += webServer.uri(); httpMessage += webServer.uri();
httpMessage += F("\nMethod: "); httpMessage += F("\nMethod: ");
@ -1060,14 +1131,18 @@ void httpHandleEspFirmware()
{ // http://plate01/espfirmware { // http://plate01/espfirmware
if(!httpIsAuthenticated(F("espfirmware"))) return; if(!httpIsAuthenticated(F("espfirmware"))) return;
String nodename = haspGetNodename(); String nodename((char *)0);
// char buffer[128]; nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += String(F("<h1>")); httpMessage += F("<h1>");
httpMessage += String(haspGetNodename()); httpMessage += nodename;
httpMessage += String(F(" ESP update</h1><br/>Updating ESP firmware from: ")); httpMessage += F("</h1><hr>");
httpMessage += String(webServer.arg("espFirmware"));
httpMessage += F("<p><b>ESP update</b></p>Updating ESP firmware from: ");
httpMessage += webServer.arg("espFirmware");
webSendPage(nodename, httpMessage.length(), true); webSendPage(nodename, httpMessage.length(), true);
webServer.sendContent(httpMessage); webServer.sendContent(httpMessage);
@ -1084,24 +1159,28 @@ void httpHandleResetConfig()
if(!httpIsAuthenticated(F("resetConfig"))) return; if(!httpIsAuthenticated(F("resetConfig"))) return;
bool resetConfirmed = webServer.arg(F("confirm")) == F("yes"); bool resetConfirmed = webServer.arg(F("confirm")) == F("yes");
String nodename = haspGetNodename();
// char buffer[128]; String nodename((char *)0);
nodename.reserve(128);
nodename = mqttGetNodename();
String httpMessage((char *)0); String httpMessage((char *)0);
httpMessage.reserve(HTTP_PAGE_SIZE); httpMessage.reserve(HTTP_PAGE_SIZE);
httpMessage += F("<h1>");
httpMessage += nodename;
httpMessage += F("</h1><hr>");
if(resetConfirmed) { // User has confirmed, so reset everything if(resetConfirmed) { // User has confirmed, so reset everything
httpMessage += F("<h1>");
httpMessage += haspGetNodename();
bool formatted = SPIFFS.format(); bool formatted = SPIFFS.format();
if(formatted) { if(formatted) {
httpMessage += F("</h1><b>Resetting all saved settings and restarting device into WiFi AP mode</b>"); httpMessage += F("<b>Resetting all saved settings and restarting device into WiFi AP mode</b>");
} else { } else {
httpMessage += F("</h1><b>Failed to format the internal flash partition</b>"); httpMessage += F("<b>Failed to format the internal flash partition</b>");
resetConfirmed = false; resetConfirmed = false;
} }
} else { } else {
httpMessage += httpMessage +=
F("<h1>Warning</h1><b>This process will reset all settings to the default values. The internal flash will " F("<h2>Warning</h2><b>This process will reset all settings to the default values. The internal flash will "
"be erased and the device is restarted. You may need to connect to the WiFi AP displayed on the panel to " "be erased and the device is restarted. You may need to connect to the WiFi AP displayed on the panel to "
"re-configure the device before accessing it again. ALL FILES WILL BE LOST!" "re-configure the device before accessing it again. ALL FILES WILL BE LOST!"
"<br/><hr><br/><form method='get' action='resetConfig'>" "<br/><hr><br/><form method='get' action='resetConfig'>"
@ -1192,6 +1271,8 @@ void httpSetup(const JsonObject & settings)
webServer.on(F("/reboot"), httpHandleReboot); webServer.on(F("/reboot"), httpHandleReboot);
webServer.onNotFound(httpHandleNotFound); webServer.onNotFound(httpHandleNotFound);
} }
debugPrintln(F("HTTP: Setup Complete"));
} }
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1218,7 +1299,7 @@ void httpReconnect()
} }
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
void httpLoop(bool wifiIsConnected) void httpLoop()
{ {
if(httpEnable) { if(httpEnable) {
if(webServerStarted) if(webServerStarted)