mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-15 15:41:21 +10:00
attempt to fix not connecting issues and endless loops
This commit is contained in:
+13
-4
@@ -151,8 +151,8 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
|
||||
|
||||
boolean WiFiManager::startConfigPortal(char const *apName, char const *apPassword) {
|
||||
//setup AP
|
||||
WiFi.mode(WIFI_AP);
|
||||
DEBUG_WM("SET AP");
|
||||
WiFi.mode(WIFI_AP_STA);
|
||||
DEBUG_WM("SET AP STA");
|
||||
|
||||
_apName = apName;
|
||||
_apPassword = apPassword;
|
||||
@@ -229,8 +229,17 @@ int WiFiManager::connectWifi(String ssid, String pass) {
|
||||
if (ssid != "") {
|
||||
WiFi.begin(ssid.c_str(), pass.c_str());
|
||||
} else {
|
||||
DEBUG_WM("Using last saved values, should be faster");
|
||||
WiFi.begin();
|
||||
if(WiFi.SSID()) {
|
||||
DEBUG_WM("Using last saved values, should be faster");
|
||||
//trying to fix connection in progress hanging
|
||||
ETS_UART_INTR_DISABLE();
|
||||
wifi_station_disconnect();
|
||||
ETS_UART_INTR_ENABLE();
|
||||
|
||||
WiFi.begin();
|
||||
} else {
|
||||
DEBUG_WM("No saved credentials");
|
||||
}
|
||||
}
|
||||
|
||||
int connRes = waitForConnectResult();
|
||||
|
||||
+3
-1
@@ -20,7 +20,9 @@
|
||||
#undef min
|
||||
#undef max
|
||||
#include <algorithm>
|
||||
|
||||
extern "C" {
|
||||
#include "user_interface.h"
|
||||
}
|
||||
|
||||
const char HTTP_200[] PROGMEM = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n";
|
||||
const char HTTP_HEAD[] PROGMEM = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/><title>{v}</title>";
|
||||
|
||||
Reference in New Issue
Block a user