latest version

This commit is contained in:
Thomas Kopp 2019-02-03 19:13:33 +01:00
parent bd95532bc4
commit 44e9b02cf1
4 changed files with 19 additions and 5 deletions

View file

@ -197,9 +197,20 @@ boolean WiFiManager::startConfigPortal() {
} }
boolean WiFiManager::startConfigPortal(char const *apName, char const *apPassword) { boolean WiFiManager::startConfigPortal(char const *apName, char const *apPassword) {
//setup AP
WiFi.mode(WIFI_AP_STA); if(!WiFi.isConnected()){
DEBUG_WM(F("SET AP STA")); 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; _apName = apName;
_apPassword = apPassword; _apPassword = apPassword;
@ -297,11 +308,13 @@ int WiFiManager::connectWifi(String ssid, String pass) {
DEBUG_WM ("Connection result: "); DEBUG_WM ("Connection result: ");
DEBUG_WM ( connRes ); DEBUG_WM ( connRes );
//not connected, WPS enabled, no pass - first attempt //not connected, WPS enabled, no pass - first attempt
#ifdef NO_EXTRA_4K_HEAP
if (_tryWPS && connRes != WL_CONNECTED && pass == "") { if (_tryWPS && connRes != WL_CONNECTED && pass == "") {
startWPS(); startWPS();
//should be connected at the end of WPS //should be connected at the end of WPS
connRes = waitForConnectResult(); connRes = waitForConnectResult();
} }
#endif
return connRes; return connRes;
} }

View file

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

View file

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

View file

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