mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
add connection fixes for esp32 wifi not started yet
This commit is contained in:
@@ -271,6 +271,14 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
|
||||
#ifdef WM_DEBUG_LEVEL
|
||||
DEBUG_WM(F("AutoConnect"));
|
||||
#endif
|
||||
|
||||
#ifdef ESP32
|
||||
if(WiFi.getMode() != WIFI_STA){
|
||||
WiFi.mode(WIFI_STA);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if(getWiFiIsSaved()){
|
||||
_startconn = millis();
|
||||
_begin();
|
||||
@@ -332,6 +340,7 @@ boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
|
||||
DEBUG_WM(DEBUG_VERBOSE,F("Connected in"),(String)((millis()-_startconn)) + " ms");
|
||||
DEBUG_WM(F("STA IP Address:"),WiFi.localIP());
|
||||
#endif
|
||||
// Serial.println("Connected in " + (String)((millis()-_startconn)) + " ms");
|
||||
_lastconxresult = WL_CONNECTED;
|
||||
|
||||
if(_hostname != ""){
|
||||
|
||||
@@ -95,7 +95,6 @@ void setup() {
|
||||
// Serial1.begin(115200);
|
||||
|
||||
// Serial.setDebugOutput(true);
|
||||
delay(1000);
|
||||
|
||||
Serial.println("\n Starting");
|
||||
// WiFi.setSleepMode(WIFI_NONE_SLEEP); // disable sleep, can improve ap stability
|
||||
@@ -310,6 +309,7 @@ void setup() {
|
||||
}
|
||||
|
||||
void wifiInfo(){
|
||||
// can contain gargbage on esp32 if wifi is not ready yet
|
||||
Serial.println("[WIFI] WIFI INFO DEBUG");
|
||||
// WiFi.printDiag(Serial);
|
||||
Serial.println("[WIFI] SAVED: " + (String)(wm.getWiFiIsSaved() ? "YES" : "NO"));
|
||||
|
||||
Reference in New Issue
Block a user