Open AndyKoder opened 3 months ago
Please enable core debug level to verbose and let's see what reason the WiFi gives for disconnecting. 2900 minutes is oddly specific and in no way around some 32 bit overflow (or similar)
[168428788][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 14 - STA_DISCONNECTED
[168428797][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 14 - STA_DISCONNECTED
[168428805][W][STA.cpp:135] _onStaArduinoEvent(): Reason: 8 - ASSOC_LEAVE
And what reason does it give when it fails to reconnect after that?
Compiled the same code with 1.0.6, runs for a week now.
In the router log i see 3 disconnects after 42h, 47h and 53h,
but it ALWAYS reconnected right after the disconnect.
So maybe it's normal that it disconnects from time to time, but the reconnect part in the 3.0.x doesn't work for some reason...
btw: how would i get the Reason 8 ASSOC_LEAVE
error from inside the esp32, so i could log that without using serial console?
Do you have "band steering" enabled on your access point? If so, try disabling it. Of try to connect you ESP with forced 802.11g mode (not 802.11n)
And what reason does it give when it fails to reconnect after that?
[486788][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 13 - STA_CONNECTED [486795][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 13 - STA_CONNECTED
and then after a couple of seconds again
[546732][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 14 - STA_DISCONNECTED [546740][V][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 14 - STA_DISCONNECTED [546748][W][STA.cpp:135] _onStaArduinoEvent(): Reason: 8 - ASSOC_LEAVE
Do you have "band steering" enabled on your access point? If so, try disabling it. Of try to connect you ESP with forced 802.11g mode (not 802.11n)
I do not see any "band steering" on the router. How would i tell the ESP32 to use 802.11g?
uint8_t protocol = WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G; // Default to BG
esp_wifi_set_protocol(WIFI_IF_STA, protocol);
N.B. you need to set these before you make the connection
This sounds a lot like the router is refusing to allocate a DHCP address. Can you try a manual IP assignment and see if it has the same issue? This will help identify what the router is having a problem with.
Board
ESP32-Wroom32 (ESP32 Dev Module)
Device Description
Module on breadboard
Hardware Configuration
DHT20
Version
v3.0.1
IDE Name
Arduino IDE
Operating System
ubuntu linux
Flash frequency
80Mhz
PSRAM enabled
no
Upload speed
115200
Description
WiFi connects, but after 48h - ~20mins it disconnects and could not reconnect. But after another 48h - ~20mins (without connection) it suddenly is able to reconnect again. It is otherwise fully working, serial console shows normal output of wifi status, temp every 60s (this does not happen with 1.0.6) I don't see a reason anywhere, in the WiFi AP/router log i see only lots of "esp32-xxxx connects/disconnects"
Sketch
Basically this example (changed only ssid+pass, some debug msgs every 60s, dht20 temp, everything working, but wifi is disconnected)
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide