From 952034af06a8ec9119064c2ca071c4dc408ebd47 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Mon, 22 Feb 2021 23:34:23 +0100 Subject: [PATCH] Add .on("/config") to AP mode --- src/svc/hasp_http.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/svc/hasp_http.cpp b/src/svc/hasp_http.cpp index 1fea82a0..dff3244f 100644 --- a/src/svc/hasp_http.cpp +++ b/src/svc/hasp_http.cpp @@ -118,7 +118,6 @@ extern char mqttNodeName[16]; char mqttNodeName[3] = "na"; #endif - //////////////////////////////////////////////////////////////////////////////////////////////////// String getOption(int value, String label, bool selected) { @@ -187,7 +186,7 @@ bool httpIsAuthenticated(const __FlashStringHelper * fstr_page) #if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) LOG_TRACE(TAG_HTTP, F("Sending %S page to client connected from: %s"), fstr_page, - webServer.client().remoteIP().toString().c_str()); + webServer.client().remoteIP().toString().c_str()); #else // LOG_INFO(TAG_HTTP,F("Sending %s page to client connected from: %s"), page, // String(webServer.client().remoteIP()).c_str()); @@ -1129,7 +1128,8 @@ void webHandleMqttConfig() F("'>

"); add_form_button(httpMessage, F("↩ " D_HTTP_CONFIGURATION), F("/config"), F("")); - // httpMessage += PSTR("

"); webSendPage(httpGetNodename(), httpMessage.length(), false); @@ -1753,7 +1753,7 @@ void httpHandleNotFound() #if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) LOG_TRACE(TAG_HTTP, F("Sending 404 to client connected from: %s"), - webServer.client().remoteIP().toString().c_str()); + webServer.client().remoteIP().toString().c_str()); #else // LOG_TRACE(TAG_HTTP,F("Sending 404 to client connected from: %s"), String(webServer.client().remoteIP()).c_str()); #endif @@ -1901,7 +1901,7 @@ void httpStart() LOG_INFO(TAG_HTTP, F(D_SERVICE_STARTED " @ http://%d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); #else LOG_INFO(TAG_HTTP, F(D_SERVICE_STARTED " @ http://%s"), - (WiFi.getMode() != WIFI_STA ? WiFi.softAPIP().toString().c_str() : WiFi.localIP().toString().c_str())); + (WiFi.getMode() != WIFI_STA ? WiFi.softAPIP().toString().c_str() : WiFi.localIP().toString().c_str())); #endif #else IPAddress ip; @@ -1942,6 +1942,7 @@ void httpSetup() if(WiFi.getMode() != WIFI_STA) { LOG_TRACE(TAG_HTTP, F("Wifi access point")); webServer.on(F("/"), webHandleWifiConfig); + webServer.on(F("/config"), webHandleWifiConfig); return; }