diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 3018c28..3b7b753 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -585,7 +585,7 @@ void WiFiManager::handleWifi(boolean scan) { server->send(200, "text/html", page); // server->close(); // testing reliability fix for content length mismatches during mutiple flood hits - Serial.println(page); + // Serial.println(page); DEBUG_WM(F("Sent config page")); } @@ -1158,7 +1158,7 @@ void WiFiManager::handleNotFound() { boolean WiFiManager::captivePortal() { DEBUG_WM("-> " + server->hostHeader()); - if(!_enableCaptivePortal) return true; // skip redirections + if(!_enableCaptivePortal) return false; // skip redirections if (!isIp(server->hostHeader())) { DEBUG_WM(F("<- Request redirected to captive portal")); diff --git a/WiFiManager.h b/WiFiManager.h index ac3c0cf..826be09 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -150,7 +150,7 @@ class WiFiManager void setRestorePersistent(boolean persistent); //if true, always show static net inputs, IP, subnet, gateway, if false, only show when already set. void setShowStaticFields(boolean alwaysShow); - + //if true disable captive portal redirection void setCaptivePortalEnable(boolean enabled); private: diff --git a/examples/OnDemandConfigPortal/OnDemandConfigPortal.ino b/examples/OnDemandConfigPortal/OnDemandConfigPortal.ino index 08353c4..3a521fa 100644 --- a/examples/OnDemandConfigPortal/OnDemandConfigPortal.ino +++ b/examples/OnDemandConfigPortal/OnDemandConfigPortal.ino @@ -42,6 +42,8 @@ void loop() { //WITHOUT THIS THE AP DOES NOT SEEM TO WORK PROPERLY WITH SDK 1.5 , update to at least 1.5.1 //WiFi.mode(WIFI_STA); + wifiManager.setCaptivePortalEnable(false); + if (!wifiManager.startConfigPortal("OnDemandAP")) { Serial.println("failed to connect and hit timeout"); delay(3000);