Browse Source

latest version

Thomas Kopp 1 year ago
parent
commit
44e9b02cf1

+ 16
- 3
firmware/libraries/WiFiManager/WiFiManager.cpp View File

@@ -197,9 +197,20 @@ boolean WiFiManager::startConfigPortal() {
197 197
 }
198 198
 
199 199
 boolean  WiFiManager::startConfigPortal(char const *apName, char const *apPassword) {
200
-  //setup AP
201
-  WiFi.mode(WIFI_AP_STA);
202
-  DEBUG_WM(F("SET AP STA"));
200
+  
201
+  if(!WiFi.isConnected()){
202
+    WiFi.persistent(false);
203
+    // disconnect sta, start ap
204
+    WiFi.disconnect(); //  this alone is not enough to stop the autoconnecter
205
+    WiFi.mode(WIFI_AP);
206
+    WiFi.persistent(true);
207
+  } 
208
+  else {
209
+    //setup AP
210
+    WiFi.mode(WIFI_AP_STA);
211
+    DEBUG_WM(F("SET AP STA"));
212
+  }
213
+
203 214
 
204 215
   _apName = apName;
205 216
   _apPassword = apPassword;
@@ -297,11 +308,13 @@ int WiFiManager::connectWifi(String ssid, String pass) {
297 308
   DEBUG_WM ("Connection result: ");
298 309
   DEBUG_WM ( connRes );
299 310
   //not connected, WPS enabled, no pass - first attempt
311
+  #ifdef NO_EXTRA_4K_HEAP
300 312
   if (_tryWPS && connRes != WL_CONNECTED && pass == "") {
301 313
     startWPS();
302 314
     //should be connected at the end of WPS
303 315
     connRes = waitForConnectResult();
304 316
   }
317
+  #endif
305 318
   return connRes;
306 319
 }
307 320
 

+ 1
- 0
firmware/libraries/WiFiManager/examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino View File

@@ -61,6 +61,7 @@ void setup() {
61 61
         } else {
62 62
           Serial.println("failed to load json config");
63 63
         }
64
+        configFile.close();
64 65
       }
65 66
     }
66 67
   } else {

+ 1
- 1
firmware/libraries/WiFiManager/library.json View File

@@ -9,5 +9,5 @@
9 9
   },
10 10
   "frameworks": "arduino",
11 11
   "platforms": "espressif8266",
12
-  "version": "0.13"
12
+  "version": "0.14"
13 13
 }

+ 1
- 1
firmware/libraries/WiFiManager/library.properties View File

@@ -1,5 +1,5 @@
1 1
 name=WiFiManager
2
-version=0.13
2
+version=0.14
3 3
 author=tzapu
4 4
 maintainer=tzapu
5 5
 sentence=ESP8266 WiFi Connection manager with fallback web configuration portal

Loading…
Cancel
Save