diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 2deb942..6fd55a7 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,9 @@ ## PLEASE TRY DEVELOPMENT BRANCH before submitting bugs on release or master, in case they were already fixed. ## +## POST SERIAL OUTPUT ! +## POST SERIAL OUTPUT ! +## POST SERIAL OUTPUT ! + Issues without basic info will be ignored or closed! Please fill the info fields, it helps to get you faster support ;) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index a0d5948..dd56cca 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -197,9 +197,20 @@ boolean WiFiManager::startConfigPortal() { } boolean WiFiManager::startConfigPortal(char const *apName, char const *apPassword) { - //setup AP - WiFi.mode(WIFI_AP_STA); - DEBUG_WM(F("SET AP STA")); + + if(!WiFi.isConnected()){ + WiFi.persistent(false); + // disconnect sta, start ap + WiFi.disconnect(); // this alone is not enough to stop the autoconnecter + WiFi.mode(WIFI_AP); + WiFi.persistent(true); + } + else { + //setup AP + WiFi.mode(WIFI_AP_STA); + DEBUG_WM(F("SET AP STA")); + } + _apName = apName; _apPassword = apPassword; @@ -301,11 +312,13 @@ int WiFiManager::connectWifi(String ssid, String pass) { DEBUG_WM ("Connection result: "); DEBUG_WM ( connRes ); //not connected, WPS enabled, no pass - first attempt + #ifdef NO_EXTRA_4K_HEAP if (_tryWPS && connRes != WL_CONNECTED && pass == "") { startWPS(); //should be connected at the end of WPS connRes = waitForConnectResult(); } + #endif return connRes; } diff --git a/examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino b/examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino index 1d58e5c..7e6c373 100644 --- a/examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino +++ b/examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino @@ -61,6 +61,7 @@ void setup() { } else { Serial.println("failed to load json config"); } + configFile.close(); } } } else { diff --git a/library.json b/library.json index 44400f6..8f0830a 100644 --- a/library.json +++ b/library.json @@ -9,5 +9,5 @@ }, "frameworks": "arduino", "platforms": "espressif8266", - "version": "0.12" + "version": "0.14" } diff --git a/library.properties b/library.properties index 2466f0d..e0420ad 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=WiFiManager -version=0.12 +version=0.14 author=tzapu maintainer=tzapu sentence=ESP8266 WiFi Connection manager with fallback web configuration portal