WiFi disconnects in 20210503
Moderators: grovkillen, Stuntteam, TD-er
WiFi disconnects in 20210503
Running a few ESP8266 here with ESP_Easy_mega_20210114_normal_ESP8266_4M1M connected stable to WiFi without any issues.
Updated a few to ESP_Easy_mega_20210503_normal_ESP8266_4M1M and suddenly I see them random disconnect/ reconnect to WiFi.
They remain disconnected for a couple of minutes or hours. At some point they connect back to WiFi.
From setup point of view WiFi is setup as Mesh so SSID's (visible) overlap and the one with best connection to be used. With the most
recent WiFi enhancements in ESP_Easy it appears very often wrong decission is made connecting to the wrong AP (single SSID) with suboptimal connection.
"Last Disconnect Reason: (8) Assoc leave"
is seen then.
Tried to tune as much as possible in the WiFi settings in various combinations:
WiFi Settings
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: false
Connection Failure Threshold: 0
Max WiFi TX Power: 17.50
Current WiFi TX Power: 14.00
WiFi Sensitivity Margin: 3
Send With Max TX Power: false
Extra WiFi scan loops: 2
Periodical Scan WiFi: true
Though I can never reach the same stability level as it was in 20210114. I had seen similar issue already in 20210223 but decided to skip this release at that time.
It somehow sounds a bit like "ESP82xx_mega-20210503 WiFi problem" viewtopic.php?f=6&t=8528 and tried linked ESP_Easy_mega_20210505_custom_ESP8266_4M1M
which seem to improve things as reconnects seem to happen more frequently but overall the issue remains.
I can exclude a device failure as it impacts multiple ones. 2 ESPs sitting next to each other: 20210114 (works stable) and 20210503/20210505 (reconnects randomly)
Any hint how to fix this issue? Is there any WiFi setting combination which would match 1:1 the 20210114 build behaviors?
Many thanks!
Updated a few to ESP_Easy_mega_20210503_normal_ESP8266_4M1M and suddenly I see them random disconnect/ reconnect to WiFi.
They remain disconnected for a couple of minutes or hours. At some point they connect back to WiFi.
From setup point of view WiFi is setup as Mesh so SSID's (visible) overlap and the one with best connection to be used. With the most
recent WiFi enhancements in ESP_Easy it appears very often wrong decission is made connecting to the wrong AP (single SSID) with suboptimal connection.
"Last Disconnect Reason: (8) Assoc leave"
is seen then.
Tried to tune as much as possible in the WiFi settings in various combinations:
WiFi Settings
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: false
Connection Failure Threshold: 0
Max WiFi TX Power: 17.50
Current WiFi TX Power: 14.00
WiFi Sensitivity Margin: 3
Send With Max TX Power: false
Extra WiFi scan loops: 2
Periodical Scan WiFi: true
Though I can never reach the same stability level as it was in 20210114. I had seen similar issue already in 20210223 but decided to skip this release at that time.
It somehow sounds a bit like "ESP82xx_mega-20210503 WiFi problem" viewtopic.php?f=6&t=8528 and tried linked ESP_Easy_mega_20210505_custom_ESP8266_4M1M
which seem to improve things as reconnects seem to happen more frequently but overall the issue remains.
I can exclude a device failure as it impacts multiple ones. 2 ESPs sitting next to each other: 20210114 (works stable) and 20210503/20210505 (reconnects randomly)
Any hint how to fix this issue? Is there any WiFi setting combination which would match 1:1 the 20210114 build behaviors?
Many thanks!
Re: WiFi disconnects in 20210503
Maybe disable periodical wifi scan?
Re: WiFi disconnects in 20210503
Tried this already in one of the many combinations it did not really had any impact. I can give it a try again though...
Re: WiFi disconnects in 20210503
Maybe also test with:
Send With Max TX Power: checked
Send With Max TX Power: checked
Re: WiFi disconnects in 20210503
Max TX Power is indeed something with scared me off a bit to play with but testing now with the following set:
Thx
Code: Select all
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: false
Connection Failure Threshold: 0
Max WiFi TX Power: 17.50
Current WiFi TX Power: 14.00
WiFi Sensitivity Margin: 3
Send With Max TX Power: true
Extra WiFi scan loops: 2
Periodical Scan WiFi: false
Re: WiFi disconnects in 20210503
See here for more detailed info on what the settings do:
https://espeasy.readthedocs.io/en/lates ... -threshold
Periodical send Gratuitous ARP is also one best to have enabled, although it should not make a difference with disconnects/reconnects, only with reachability of the ESP.
Force WiFi B/G will give you some extra range as the TX-power can be higher (max. 20.5, you still need to increase the setting if you wish to use it) and the RX sensitivity is also better.
Max TX power for 802.11n = 14 dBm, 802.11g = 17 dBm, 802.11b = 20.5 dBm.
But we're not using the 'b' mode, so you won't see any difference between 17.5 and 20.5 dBm as setting. (for now..., might change that later)
https://espeasy.readthedocs.io/en/lates ... -threshold
Periodical send Gratuitous ARP is also one best to have enabled, although it should not make a difference with disconnects/reconnects, only with reachability of the ESP.
Force WiFi B/G will give you some extra range as the TX-power can be higher (max. 20.5, you still need to increase the setting if you wish to use it) and the RX sensitivity is also better.
Max TX power for 802.11n = 14 dBm, 802.11g = 17 dBm, 802.11b = 20.5 dBm.
But we're not using the 'b' mode, so you won't see any difference between 17.5 and 20.5 dBm as setting. (for now..., might change that later)
Re: WiFi disconnects in 20210503
Thx, the last change
seem to improve things immense testing it a bit further if it remains stable.
Was this the same behavior in 20210114?
Code: Select all
Send With Max TX Power: true
Was this the same behavior in 20210114?
Re: WiFi disconnects in 20210503
On older builds (not sure when I added the TX pwd option) the TX power was always set to max.
This could lead to some issues on some nodes, but as always it is not a fix for every scenario.
N.B. I just merged some temp fix for units not being able to reconnect to WiFi for a long time (or needing a power cycle).
Last night I had one of my own units (connected to serial log) showing the issue of not reconnecting.
So I could see what was wrong then. It appeared the WiFi events were not considered to timeout, so if not all events were processed (e.g. more likely to happen on static IP) it would wait forever (until it crashed....)
So I do have to take a closer look at it, as it is possible to get in the situation where a new connection cannot be started as there are unprocessed wifi events and those events cannot be processed as they are waiting for another event to happen first.
But for now it should (not so elegantly) get out of this infinite loop.
This could lead to some issues on some nodes, but as always it is not a fix for every scenario.
N.B. I just merged some temp fix for units not being able to reconnect to WiFi for a long time (or needing a power cycle).
Last night I had one of my own units (connected to serial log) showing the issue of not reconnecting.
So I could see what was wrong then. It appeared the WiFi events were not considered to timeout, so if not all events were processed (e.g. more likely to happen on static IP) it would wait forever (until it crashed....)
So I do have to take a closer look at it, as it is possible to get in the situation where a new connection cannot be started as there are unprocessed wifi events and those events cannot be processed as they are waiting for another event to happen first.
But for now it should (not so elegantly) get out of this infinite loop.
Re: WiFi disconnects in 20210503
It was running stable for about 15hrs but then startet to disconnect/ reconnect for about 2hrs never got a stable connection. Power cycled it and now its stable again.
No other devices had issues at that time...
testing now with
Periodical send Gratuitous ARP
if this changes anything.
No other devices had issues at that time...
testing now with
Periodical send Gratuitous ARP
if this changes anything.
Re: WiFi disconnects in 20210503
Still on the latest 'nightly' build?
Or are you using the latest code base?
Or are you using the latest code base?
Re: WiFi disconnects in 20210503
Using the custom build linked from viewtopic.php?f=6&t=8528
shall I go back to the last nightly 20210503?
Code: Select all
ESP Easy | Information |
-----|-----|
Build:⋄|20113 - Mega|
System Libraries:⋄|ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support|
Git Build:⋄|Skrzypowa: May 5 2021 22:15:20|
Plugin Count:⋄|32 |
Build Time:⋄|May 5 2021 22:15:11|
Binary Filename:⋄|ESP_Easy_mega_20210505_custom_ESP8266_4M1M|
Build Platform:⋄|Windows-10-10.0.19041-SP0|
Git HEAD:⋄|'bugfix/std_move_controllerqueue_e519d0b'|
Re: WiFi disconnects in 20210503
I can also make one for you, based on the current code as that does contain a fix which hopefully fixes this issue.
What build do you need?
What build do you need?
Re: WiFi disconnects in 20210503
That would be awesome, ESP_Easy_mega_20210503_normal_ESP8266_4M1M.bin in a more recent build needed then.
Re: WiFi disconnects in 20210503
2 builds for you to test:
* normal 'mega' branch: https://www.dropbox.com/s/ipvhx546kxwm4 ... M.bin?dl=0
* normal build where I hopefully fixed some MQTT reconnect issues: https://www.dropbox.com/s/hiaasmlkcgt41 ... M.bin?dl=0 See related issue: https://github.com/letscontrolit/ESPEas ... -843910973
Would be great if you could test the one of the pending pull request first and if that one works, no need to test the other one.
I would like to hear from you which one you test and whether it is a fix for your issues.
N.B. as a tip on making the WiFi connection more stable, in tools->advanced you can enable the "send with max. TX power"
But for testing the wifi reconnect, I guess you should first try to make it disconnect.
Also, do you use static IP or via DHCP?
* normal 'mega' branch: https://www.dropbox.com/s/ipvhx546kxwm4 ... M.bin?dl=0
* normal build where I hopefully fixed some MQTT reconnect issues: https://www.dropbox.com/s/hiaasmlkcgt41 ... M.bin?dl=0 See related issue: https://github.com/letscontrolit/ESPEas ... -843910973
Would be great if you could test the one of the pending pull request first and if that one works, no need to test the other one.
I would like to hear from you which one you test and whether it is a fix for your issues.
N.B. as a tip on making the WiFi connection more stable, in tools->advanced you can enable the "send with max. TX power"
But for testing the wifi reconnect, I guess you should first try to make it disconnect.
Also, do you use static IP or via DHCP?
Re: WiFi disconnects in 20210503
Alright using the following now:
Settings
Using DHCP address
Code: Select all
ESP Easy | Information |
-----|-----|
Build:⋄|20113 - Mega|
System Libraries:⋄|ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support|
Git Build:⋄|'bugfix/MQTT_check_connected_956c329'|
Plugin Count:⋄|47 [Normal]|
Build Time:⋄|May 19 2021 11:41:38|
Binary Filename:⋄|ESP_Easy_mega_20210519_normal_ESP8266_4M1M|
Build Platform:⋄|Windows-10-10.0.19041-SP0|
Git HEAD:⋄|'bugfix/MQTT_check_connected_956c329'|
Code: Select all
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: false
Connection Failure Threshold: 0
Max WiFi TX Power: 17.00
Current WiFi TX Power: 14.00
WiFi Sensitivity Margin: 3
Send With Max TX Power: false
Extra WiFi scan loops: 2
Periodical Scan WiFi: false
Re: WiFi disconnects in 20210503
Enabling these will make your WiFi connection more stable, but harder to reproduce the WiFi reconnect issue:
- Send With Max TX Power
- Restart WiFi Lost Conn
- Periodical send Gratuitous ARP
- Send With Max TX Power
- Restart WiFi Lost Conn
- Periodical send Gratuitous ARP
Re: WiFi disconnects in 20210503
After about 90min it lost connection for about 12min and recovered then. Lets see if this happens more often.
Its a test device so no issues debug further is there any way I can collect more information?
Its a test device so no issues debug further is there any way I can collect more information?
Re: WiFi disconnects in 20210503
Is this with "Restart WiFi Lost Conn" checked?
Periodical WiFi scan disabled?
Periodical WiFi scan disabled?
Re: WiFi disconnects in 20210503
Is this with "Restart WiFi Lost Conn" checked? -> No
Periodical WiFi scan disabled? -> Yes
Periodical WiFi scan disabled? -> Yes
Re: WiFi disconnects in 20210503
After 1st reconnect as described it took about 6h it somehow struggled again with total connetion loss/ reconnect. Not stable for about 30min so I power cycled it.
After recovered I set "Send With Max TX Power" it stayed up for about 23h and struggled then for about 40min until it recovered on its own (still no Restart WiFi on Lost Conn set".
Another ~10h later struggled again for about 10min recovered on its own then.
I also set now "Periodical send Gratuitous ARP"
All other ESPs on 20210114 connected so same infrastructure had no issues at that times.
Interesting though
Last Disconnect Reason: (202) Auth fail
while previously it was
Last Disconnect Reason: (8) Assoc leave
Let see - next try might be switch on the WiFi Scan again?
After recovered I set "Send With Max TX Power" it stayed up for about 23h and struggled then for about 40min until it recovered on its own (still no Restart WiFi on Lost Conn set".
Another ~10h later struggled again for about 10min recovered on its own then.
I also set now "Periodical send Gratuitous ARP"
Code: Select all
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: true
Connection Failure Threshold: 0
Max WiFi TX Power: 17.00
Current WiFi TX Power: 14.00
WiFi Sensitivity Margin: 3
Send With Max TX Power: true
Extra WiFi scan loops: 2
Periodical Scan WiFi: false
Interesting though
Last Disconnect Reason: (202) Auth fail
while previously it was
Last Disconnect Reason: (8) Assoc leave
Let see - next try might be switch on the WiFi Scan again?
Re: WiFi disconnects in 20210503
I don't think the periodical wifi scan may be the fix here, as I do believe there is some bug in the check if it may be allowed to perform a WiFi scan.
The auth fail may also be some indication that there is some mixup in which set of credentials it thinks it is using and what may actually be used.
I think the february build may also work just fine, as I do have the feeling I messed up just a few weeks ago.
The auth fail may also be some indication that there is some mixup in which set of credentials it thinks it is using and what may actually be used.
I think the february build may also work just fine, as I do have the feeling I messed up just a few weeks ago.
Re: WiFi disconnects in 20210503
So far it seems
turns out to be quite stable no issues since about 48hrs which marks a new high
Saw (202) Auth fail though again but seems its that fast not causing too much of an issue.
As mentioned I had skipped the february build can test this later if this turns out to be stable.
Code: Select all
Send With Max TX Power: true
Periodical send Gratuitous ARP: true
Saw (202) Auth fail though again but seems its that fast not causing too much of an issue.
As mentioned I had skipped the february build can test this later if this turns out to be stable.
Re: WiFi disconnects in 20210503
I may ask you later to try a newer build as there was for sure a bug in the code when WiFi events happened out of (expected) order.
Re: WiFi disconnects in 20210503
Seems I jinxed it shortly after my last post "48hrs" it disconnected.
Extended the setup a bit 3 ESPs next to each other
Prod (and most stable until now):
Lab1:
Lab2:
The bug you mentioned kick in randomly or after longer period of time?
Extended the setup a bit 3 ESPs next to each other
Prod (and most stable until now):
Code: Select all
ESP_Easy_mega_20210114_normal_ESP8266_4M1M
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: false
Connection Failure Threshold: 0
Code: Select all
ESP_Easy_mega_20210223_normal_ESP8266_4M1M /
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: true
Connection Failure Threshold: 0
Max WiFi TX Power: 17.00
Current WiFi TX Power: 14.00
WiFi Sensitivity Margin: 3
Send With Max TX Power: true
Code: Select all
ESP_Easy_mega_20210519_normal_ESP8266_4M1M (bugfix/MQTT_check_connected_956c329)
WiFi Settings
Force WiFi B/G: false
Restart WiFi Lost Conn: false
Force WiFi No Sleep: false
Periodical send Gratuitous ARP: true
Connection Failure Threshold: 0
Max WiFi TX Power: 17.00
Current WiFi TX Power: 14.00
WiFi Sensitivity Margin: 3
Send With Max TX Power: true
Extra WiFi scan loops: 2
Periodical Scan WiFi: false
Re: WiFi disconnects in 20210503
It depends... (as always )
The problem is related to reconnecting to WiFi and the order in which the WiFi events may occur.
So it depends mainly on the stability and reception quality of WiFi.
The problem is related to reconnecting to WiFi and the order in which the WiFi events may occur.
So it depends mainly on the stability and reception quality of WiFi.
Re: WiFi disconnects in 20210503
Understood any new build I shall test let me know.
Re: WiFi disconnects in 20210503
So far it seems
ESP_Easy_mega_20210114_normal_ESP8266_4M1M
and
ESP_Easy_mega_20210223_normal_ESP8266_4M1M
seem to behave quite similar/ stable.
ESP_Easy_mega_20210519_normal_ESP8266_4M1M (bugfix/MQTT_check_connected_956c329)
seem to fail random after some time, reconnects most of time though it has a habbit doing this in a Mesh network
by choosing the wrong AP with worse RSSI ending up in packet loss/ further connection issues.
ESP_Easy_mega_20210114_normal_ESP8266_4M1M
and
ESP_Easy_mega_20210223_normal_ESP8266_4M1M
seem to behave quite similar/ stable.
ESP_Easy_mega_20210519_normal_ESP8266_4M1M (bugfix/MQTT_check_connected_956c329)
seem to fail random after some time, reconnects most of time though it has a habbit doing this in a Mesh network
by choosing the wrong AP with worse RSSI ending up in packet loss/ further connection issues.
Re: WiFi disconnects in 20210503
using ESP_Easy_mega_20210802 now and it seem to work very well so far.
Re: WiFi disconnects in 20210503
Good to hear
Who is online
Users browsing this forum: Google [Bot] and 141 guests