diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 6a6f86d..bfb0324 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -828,13 +828,19 @@ boolean WiFiManager::process(){ return false; } - uint8_t state = processConfigPortal(); + uint8_t state = processConfigPortal(); // state is WL_IDLE or WL_CONNECTED/FAILED return state == WL_CONNECTED; } return false; } -//using esp wl_status enums as returns for now, should be fine +/** + * [processConfigPortal description] + * using esp wl_status enums as returns for now, should be fine + * returns WL_IDLE_STATUS or WL_CONNECTED/WL_CONNECT_FAILED upon connect/save flag + * + * @return {[type]} [description] + */ uint8_t WiFiManager::processConfigPortal(){ if(configPortalActive){ //DNS handler @@ -2354,7 +2360,7 @@ void WiFiManager::handleNotFound() { */ boolean WiFiManager::captivePortal() { #ifdef WM_DEBUG_LEVEL - DEBUG_WM(DEBUG_DEV,"-> " + server->hostHeader()); + DEBUG_WM(DEBUG_MAX,"-> " + server->hostHeader()); #endif if(!_enableCaptivePortal) return false; // skip redirections, @todo maybe allow redirection even when no cp ? might be useful diff --git a/examples/Tests/wifi_softap/wifi_softap.ino b/examples/Tests/wifi_softap/wifi_softap.ino new file mode 100644 index 0000000..aa3e45c --- /dev/null +++ b/examples/Tests/wifi_softap/wifi_softap.ino @@ -0,0 +1,51 @@ +// wifi_basic.ino + +#include +#include + +// #define NVSERASE +#ifdef NVSERASE +#include +#include +#endif + +void setup(){ + Serial.begin(115200); + delay(2000); + Serial.println("Startup...."); + + #ifdef NVSERASE + esp_err_t err; + err = nvs_flash_init(); + err = nvs_flash_erase(); + #endif + + Serial.setDebugOutput(true); + + WiFi.begin("hellowifi","noonehere"); + + while (WiFi.status() != WL_CONNECTED && millis()<15000) { + delay(500); + Serial.print("."); + } + + if(WiFi.status() == WL_CONNECTED){ + Serial.println(""); + Serial.println("WiFi connected."); + Serial.println("IP address: "); + // Serial.println(WiFi.localIP()); + } + else { + Serial.println("WiFi NOT CONNECTED, starting ap"); + /////////////// + /// BUG + // WiFi.enableSTA(false); // BREAKS softap start, says ok BUT no ap found + + delay(2000); + WiFi.softAP("espsoftap","12345678"); + } +} + +void loop(){ + +} \ No newline at end of file