-
Notifications
You must be signed in to change notification settings - Fork 7.6k
How to recover from BEACON_TIMEOUT, STA_DISCONNECTED and STA_LOST_IP #3686
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
Comments
Reconnect does not work properly. I use something like WiFi.onEvent( WiFiEvent );
WiFi.begin();
...
void WiFiEvent( WiFiEvent_t event ) {
switch ( event ) {
case SYSTEM_EVENT_AP_START:
ESP_LOGI( TAG, "AP Started");
//WiFi.softAPsetHostname(AP_SSID);
break;
case SYSTEM_EVENT_AP_STOP:
ESP_LOGI( TAG, "AP Stopped");
break;
case SYSTEM_EVENT_STA_START:
ESP_LOGI( TAG, "STA Started");
//WiFi.setHostname( DEFAULT_HOSTNAME_PREFIX.c_str( );
break;
case SYSTEM_EVENT_STA_CONNECTED:
ESP_LOGI( TAG, "STA Connected");
//WiFi.enableIpV6();
break;
case SYSTEM_EVENT_AP_STA_GOT_IP6:
ESP_LOGI( TAG, "STA IPv6: ");
//ESP_LOGI( TAG, "%s", WiFi.localIPv6().toString());
break;
case SYSTEM_EVENT_STA_GOT_IP:
//ESP_LOGI( TAG, "STA IPv4: ");
//ESP_LOGI( TAG, "%s", WiFi.localIP());
break;
case SYSTEM_EVENT_STA_DISCONNECTED:
ESP_LOGI( TAG, "STA Disconnected");
WiFi.begin();
break;
case SYSTEM_EVENT_STA_STOP:
ESP_LOGI( TAG, "STA Stopped");
break;
default:
break;
}
} |
@CelliesProjects What is Doesn't this bit do nothing ?
|
https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/log.html Control this by setting
It shows connection is lost on serial output. ( if loglevel is set to |
Alernative solution could be something like if ( !WiFi.isConnected() ) WiFi.begin(); This has to be in a loop somewhere. |
So the ESP can't recover from a I think that this |
The first suggestion does its work automagically in the background. |
|
I think automatic reconnects for several causes were broken recently from this change: Specifically these causes may be affected: The reconnect code now calls this pair (which has changed a lot over the history of the codebase):
but in my testing this is an unreliable way to reconnect. The problem is that |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
@me-no-dev thoughts on this? |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
I have faced the same problem, any solution? |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
@me-no-dev thoughts on this? We could use your insight here. The change you accepted seems to have broken basic reconnect functionality when you merged #3085 see comment #3686 (comment) |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
Is there anything I can do to help further this along or get a maintainer to take a look? |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
poke |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
Hallo everyone. This happens every around 200-210 sockets connections:
Any help would be highly appreciated |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
Is there anything I can do to help further this along or get a maintainer to take a look? |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hello @simap and @GeorgeFlorian , sorry for late reply. Are you able to test your issue on development version 2.0.3-RC1 to check if this is still valid? You can take a look on Docs where is explained how to choose development release version in Arduino IDE. |
Hello, as there was no answer in more than 14 days, I'm closing the issue as expired to keep our backlog manageable. If it's still needed, please reopen the issue. Thanks for understanding. |
OS: Linux Mint 19.1
Board: ESP32 EVB
I have a server that sends data through a POST request to the ESP32. I am using ESPAsyncWebServer to handle it:
The issue is that if the server disconnects the ESP hangs, then disconnects from the WiFi and returns the following:
and stays like this. I have seen it reconnect only one time.
How can I force the ESP to reconnect to the WiFi ?
The text was updated successfully, but these errors were encountered: