Skip to content

Help no connection without WiFi.begin(); #1852

@kae90

Description

@kae90

Hi, I've been using WifiManager for a few years. Now I've made some updates to the FirebaseClient, replacing Service auth with user auth, and suddenly I've encountered a problem.
I've always started WifiManager like this:

#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager

void setup(){
Serial.begin(115200);

WiFi.mode(WIFI_STA);
WiFiManager wm;
wm.setConnectTimeout(-1);
WiFi.setAutoReconnect(true);
wm.setBreakAfterConfig(true);

while (WiFi.status() != WL_CONNECTED) {
Serial.println(F("Not connected!"));
delay(1000);
if (digitalRead(D5) == LOW) {
wm.autoConnect("test","12345678");
delay(1000);
ESP.restart();
} }
timeClient.begin(); //NTP
timeClient.update();
InitializeFirebase();
}

After changing FirebaseClient access to "user auth," WiFiManager can't find the WiFi credentials and is stuck in the while loop on not connected.
To get the device to connect, I simply add WiFi.begin(); before WiFi.mode(WIFI_STA); and it connects immediately.
Am I doing something wrong with WifiManager?
Thanks and congratulations on the fantastic library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions