Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By pidloop
#88961 Hello!

I have been using 2.4.2 for years and it has been flawless but I am now evaluating 2.7.2 because I would like to use LittleFS. I find 2.7.2 works very well except for one thing: wifi does not always connect.

My setup() loop to connect is just:

Code: Select allWiFi.mode(WIFI_STA);
WiFi.begin (ssid, pass);
while (WiFi.status() != WL_CONNECTED)

I am finding about 5-10% of the time the loop exits but in fact the connection is not working, as evidenced by subsequent calls to WiFiClient::connect() returning false.

To test further, I added retry code when connect() fails exactly as above and it never succeeds. The only recourse is to reset the processor. Then the next time it might succeed and if so all is well forever.

So my question is: is there a new API best practice for connecting to wifi reliably in 2.7.4?

Many thanks for your time.
User avatar
By pidloop
#88969 Forgot to mention another symptom: 2.7.4 takes much longer to make the initial connection. 2.4.2 would reconnect to the same SSID/PW almost instantly after reset, but 2.7.4 takes anywhere from 4-10 seconds. This is entirely repeatable.