Description
Basic Infos
Hello everyone. I have a very strange problem since 2.4.0.
Hardware
Hardware: Esp8266 12f and Esp8266 -01
Description
If the ESP looses the connection to the router (just disable your network for 30 seconds and reenable again at the router) the ESP won't connect to the wifi again.
It is a very strange behaviour, because the function wifi_station_get_connect_status() return only 0 then when the WiFi.begin was called 1 and after sometime 0 again. And now it gets even more funny when the ESP stucks at 1 my Router a Fritzbox 7490 lists the device as connected and you can access the httpserver on the ESP but only until it goes back to 0 again. It never gets the state 3 which should be triggered once. Under 2.3.0 everything works fine and as expected.
After an reboot it connects again...
Settings in IDE
lwip v2 prebuilt MSS=536
Sketch
/*
* This sketch trys to Connect to the best AP based on a given list
*
*/
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
ESP8266WiFiMulti wifiMulti;
void setup() {
Serial.begin(115200);
delay(10);
WiFi.mode(WIFI_STA);
wifiMulti.addAP("ssid_from_AP_1", "your_password_for_AP_1");
wifiMulti.addAP("ssid_from_AP_2", "your_password_for_AP_2");
wifiMulti.addAP("ssid_from_AP_3", "your_password_for_AP_3");
Serial.println("Connecting Wifi...");
if(wifiMulti.run() == WL_CONNECTED) {
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
}
void loop() {
if(wifiMulti.run() != WL_CONNECTED) {
Serial.println("WiFi not connected!");
Serial.println(wifi_station_get_connect_status());
delay(1000);
}
}