New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TW#13516] Wifi Disconnect Loop #724
Comments
We added a wifi deinit to try and circumvent the disconnect loop.
This function is started as a task, after 10 consecutive disconnects. This build ran from 21-6-2017 17:30 till 23-6-2017 on a DOIT and a LoPy The disconnect loops and subsequent crashes occurred on 6 different times. These are the last time marks in the log files before the crash:
|
My code has a control flow aus outlined below: I can confirm that the ESP32 Rev 0 here.
|
@HubbyGitter We have no trouble connecting to the AP. There are certain situations where calling esp_wifi_connect() is not enough. Our Wifi event handler can successfully recover from a disconnect, even the reinit_wifi() has successfully run. mentioned in our previous post:
We enabled CONFIG_SW_COEXIST_ENABLE, this does not have a effect on the occurrence of the disconnect loop.
In all 9 disconnect loops the WDT triggers ( The Task watchdog is set to 60seconds)
|
@Resultfactory I'd appreciate if you elaborated a bit. When is calling Maybe I should have mentioned that the control flow stops the WiFi and starts from there when an event occurs which does not lead in the right direction. |
@HubbyGitter that is our question as well. Our Wifi works fine, until this Disconnect loop happens Log. On every disconnect event, esp_wifi_connect() is called. After 10 consecutive disconnects we try to restart the wifi with reinit_wifi() which ends up triggering the WDT. This weekend for example, the system was online for 10hours 48minutes (Log). Then this disconnect loop happens, we call reinit_wifi() and the system crashes. |
gentlemen, can i ask you if wifi station reconnect works for you after AP goes down and back up? |
@Resultfactory If disconnect event happens, do not need to reinit WiFi, just call esp_wifi_connect() to reconnect. |
@rojer For me, it does not matter why a reconnect takes place -- lost connection or intended disconnect. The first connect after system boot works well, and after that, I'm running into (finite) 201 loops, which do succeed eventually (e.g. as I write this, on the fourth attempt). I'm stopping WiFI but not reinitialising it in my FSM if something goes wrong and also, there'll be a short delay. The latest updates as of now have not changed the behaviour substantially. |
|
@FHFS Thank you for sharing this piece of critical information. |
@HubbyGitter We tested your workaround for reconnecting to the Wifi AP. You call a esp_wifi_stop & esp_wifi_start. We have tried doing the same. For the record we scan BLE advertisements. (*)On every disconnect event we call a esp_wifi_connect, after 10 disconnects with failed esp_wifi_connect's we call esp_wifi_stop & esp_wifi_start. The call to esp_wifi_start never returns and a WDT is generated. We also preformed this test over the weekend with BLE turned off. The same 201 disconnect loop occurs, but we are able to recover by calling esp_wifi_stop & esp_wifi_start. |
@Resultfactory I don't see it as a workaround to stop the WiFI if it delivers an unexpected event. It doesn't come with too much extra costs (the most expensive stuff happens on wifi init), saves a case distinction or two, and gets you back to a consolidated state (with reasonable likelihood). I have no idea what "count to ten" means (not an empty loop from 1 to 10, hopefully) and no, I'm delaying between wifi stop and wifi start, not between error and wifi stop -- wifi stop delivers an asynchronous event, for which I first wait (with a generous timeout). Still, there's a delay before the retry. Aggressive retries are rarely helpful, especially since a retry's justification is the hope that something changed in the meantime. Yes, I'm in the robust code fan club ®️... ✅ |
@HubbyGitter Thanks for the suggestion, we will test adding one second delay between the stop and start. Although the test we did without BLE recovered nicely without delay from a 201 disconnect loop with stop start. |
Hi @Resultfactory I think this issue already fixed in release 2.1 |
Any update? Is this problem solved now? |
@FayeY
The disconnect loop keeps repeating, sometimes it finds the AP and the state is set to run. But then disconnects.
|
Hi is there any update on this? any workarounds? this seems to be a critical bug in our project.. restarting the esp wifi during mid transmission is a big bummer!! |
HI @ricksondpenha is this issue easy to reproduce or not? According to the log line88, the RSSI is -71, it means the WiFi signal is week, I guess the AP (the router) is far aways from the device (esp32). It disconnects in 336 because esp32 receives a de-auth packet from AP, then the esp32 can't find the AP. So could you help to check the following things:
|
Closing due to lack of response. Please feel free to reopen it if the issue persists and you can supply more details. |
Lately after a few hours of running the esp32 goes into a disconnect loop.
A crash used to occur on:
See log
Ever since esp-idf 058eb26, the esp32 is going into a wifi disconnect loop instead of a crash.
See log. The last 10 lines in this log file repeat until a reset happens.
We have tested esp_wifi_disconnect(), which properly disconnects and reconnects.
See log
Except on those wifi: ap_probe_send over, resett wifi status to disassoc
This problem occurs on a DOIT board with the esp-wroom32, Pycom LoPy and SiPy. We also tested this on 4 different routers.
Another disconnect loop on both a DOIT and LoPy log where wifi log level is set to verbose. This happend after we updated esp-idf to 7ed8c66
What can we do about this problem? We would like to recover from this disconnect. A crash is less problematic because after a restart the esp32 functions again.
The same issue is posted on esp32.com
The text was updated successfully, but these errors were encountered: