Skip to content

WiFi automatic reconnection not working in 2.4.0 but works in core 2.3.0 #4397

Closed
@jplavoiemtl

Description

@jplavoiemtl

Basic Infos

Hardware: ESP-12E
Core Version: 2.4.0

Description: bug found in esp8266 core 2.4.0

Here is a bug I found in esp core 2.4.0 that was not there in core 2.3.0. The esp does not reconnect automatically to WiFi while using WiFiManager. When my esp is running it connect to WiFi no problem. I have a WiFi status of 3 which is connected. Serial.println(WiFi.status());

Then I deactivate WiFi in my router to simulate a WiFi problem. After I reactivate WiFi on the router, the esp does not reconnect to WiFi. I check status at 1 second intervals and I get 6 for a WL_DISCONNECT

The problem is not related with WiFiManager. To solve it I had to revert back to esp core 2.3.0 and the WiFi reconnects fine and WiFiManager works like a charm.

Quick fix: revert to previous core 2.3.0

I hope it will be resolved in the next version. In the mean time, if someone experience the same problem with core 2.4.0, revert to core 2.3.0 as a quick fix.

Settings in IDE

Module: NodeMCU 1.0 (ESP-12E)
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode:

Sketch

Basic WiFiManager and very simple code to initialize WiFi in setup()

WiFiManager wifiManager;
wifiManager.setTimeout(180);    
wifiManager.autoConnect("NodeMcuM5");

Very little in the main loop checking WiFi which is the purpose of WiFiManager.

//If MQTT client is not connected and wifi is connected
if (!client.connected() && WiFi.status() == WL_CONNECTED) {
  reconnectMQTT();
 }

Metadata

Metadata

Assignees

Labels

waiting for feedbackWaiting on additional info. If it's not received, the issue may be closed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions