From 4d37843af8293ee5eed866016d9a7d261c909861 Mon Sep 17 00:00:00 2001 From: tablatronix Date: Tue, 13 Apr 2021 14:40:06 -0500 Subject: [PATCH] fix #1241 maybe --- WiFiManager.cpp | 5 +++++ WiFiManager.h | 2 ++ examples/Basic/Basic.ino.cpp | 38 ------------------------------------ 3 files changed, 7 insertions(+), 38 deletions(-) delete mode 100644 examples/Basic/Basic.ino.cpp diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 29de598..3472a28 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -1173,13 +1173,16 @@ void WiFiManager::handleRequest() { // bool authenticateDigest(const String& username, const String& H1); // void requestAuthentication(HTTPAuthMethod mode = BASIC_AUTH, const char* realm = NULL, const String& authFailMsg = String("") ); + // 2.3 NO AUTH available bool testauth = false; if(!testauth) return; DEBUG_WM(DEBUG_DEV,F("DOING AUTH")); bool res = server->authenticate("admin","12345"); if(!res){ + #ifndef WM_NOAUTH server->requestAuthentication(HTTPAuthMethod::BASIC_AUTH); // DIGEST_AUTH + #endif DEBUG_WM(DEBUG_DEV,F("AUTH FAIL")); } } @@ -2024,11 +2027,13 @@ String WiFiManager::getInfoData(String id){ } #endif #ifdef ESP8266 + #ifndef WM_NOSOFTAPSSID else if(id==F("apssid")){ p = FPSTR(HTTP_INFO_apssid); p.replace(FPSTR(T_1),htmlEntities(WiFi.softAPSSID())); } #endif + #endif else if(id==F("apbssid")){ p = FPSTR(HTTP_INFO_apbssid); p.replace(FPSTR(T_1),(String)WiFi.BSSIDstr()); diff --git a/WiFiManager.h b/WiFiManager.h index 211f284..9b91065 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -34,6 +34,8 @@ #warning "ARDUINO_ESP8266_RELEASE_2_3_0, some WM features disabled" #define WM_NOASYNC // esp8266 no async scan wifi #define WM_NOCOUNTRY // esp8266 no country +#define WM_NOAUTH // no httpauth +#define WM_NOSOFTAPSSID // no softapssid() @todo shim #endif // #include "soc/efuse_reg.h" // include to add efuse chip rev to info, getChipRevision() is almost always the same though, so not sure why it matters. diff --git a/examples/Basic/Basic.ino.cpp b/examples/Basic/Basic.ino.cpp deleted file mode 100644 index 8e2a4ed..0000000 --- a/examples/Basic/Basic.ino.cpp +++ /dev/null @@ -1,38 +0,0 @@ -# 1 "/var/folders/6g/ljwft31n7r5g593rqjywgvmh0000gn/T/tmpg1WvI3" -#include -# 1 "/Users/alverson/projects/microcontrollers/dev/libraries/WiFiManager/examples/Basic/Basic.ino" -#include -void setup(); -void loop(); -#line 3 "/Users/alverson/projects/microcontrollers/dev/libraries/WiFiManager/examples/Basic/Basic.ino" -void setup() { - WiFi.mode(WIFI_STA); - - - Serial.begin(115200); - - - - - WiFiManager wm; -# 22 "/Users/alverson/projects/microcontrollers/dev/libraries/WiFiManager/examples/Basic/Basic.ino" - bool res; - - - res = wm.autoConnect("AutoConnectAP","password"); - - if(!res) { - Serial.println("Failed to connect"); - - } - else { - - Serial.println("connected...yeey :)"); - } - -} - -void loop() { - - -} \ No newline at end of file