mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
hotfixing #425
this is a hotfix, there are numerous issues with this, development branch already addressed all of them.
This commit is contained in:
+14
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user