You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Board: ESP32 Development board
Core Installation/update date: 1.0.2, also 1.0.3
IDE name: Arduino IDE 1.8.9
Flash Frequency: 40MHz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Windows10
Description:
After reconnecting WiFi, it returns WL_CONNECTED but TCP remains closed. The order of events in which problems occur is as follows:
Set Static IP with WiFi.config and WIFI_STA.
The sketch established a connection with the router by WiFi.begin() once.
Restart the router while the sketch is running. ESP32 is disconnected.
STA_DISCONNECTED event occurred, detects disconnected reason as BEACON_TIMEOUT. There is no problem with this behavior.
The router has come up and re-establish the WiFi data link with ESP32. Detects STA_GOT_IP event and the IP will be restored.
After that, the HTTP request does not pass and does not respond to the Ping.
At this time, WiFi.status() returns WL_CONNECTED, but TCP still seems to be closed.
This phenomenon doesn't occur in my environment, but it always happens in another user environment. It may be due to the reliability of a specific router, but for now, the cause is unknown.
Several issues similar to this issue have been discussed, but I would like to consider a countermeasure since the incompleteness of reconnection is still unresolved.
Is there an effective way to deal with this phenomenon?
STA_GOT_IP detection and IP restoration,WiFiClient client.connect still fails
Preliminary diagnostics:
The arduino-esp32 core try reconnect with the WiFi.disconnect() and WiFi.begin() in the event handler. The above log indicates that its handler has executed and restored the IP, but subsequent HTTP GET failed.
The phenomenon occurred with the AutoConnect library, but I diagnosed using the following sketch without AutoConnect library to isolate the problem. It performs WiFi.reconnect() (Actually esp_wifi_disconnect and esp_wifi_connect) on the user sketch side after STA_DISCONNECTED detection (actually after WiFi.disconnected() and WiFi.begin() is executed by Arduino core).
As a result, HTTP GET was successful. So, I assume that TCP remains closed.
[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.
Hardware:
Board: ESP32 Development board
Core Installation/update date: 1.0.2, also 1.0.3
IDE name: Arduino IDE 1.8.9
Flash Frequency: 40MHz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Windows10
Description:
After reconnecting WiFi, it returns WL_CONNECTED but TCP remains closed. The order of events in which problems occur is as follows:
WiFi.config
and WIFI_STA.WiFi.begin()
once.At this time,
WiFi.status()
returns WL_CONNECTED, but TCP still seems to be closed.This phenomenon doesn't occur in my environment, but it always happens in another user environment. It may be due to the reliability of a specific router, but for now, the cause is unknown.
Several issues similar to this issue have been discussed, but I would like to consider a countermeasure since the incompleteness of reconnection is still unresolved.
Is there an effective way to deal with this phenomenon?
Related issue #1464.
Hieromon/AutoConnect#121 as a source.
Sketch:
Log:
sorry for hard to see.
From initial behavior to router reset
STA_GOT_IP detection and IP restoration,
WiFiClient client.connect
still failsPreliminary diagnostics:
The arduino-esp32 core try reconnect with the
WiFi.disconnect()
andWiFi.begin()
in the event handler. The above log indicates that its handler has executed and restored the IP, but subsequent HTTP GET failed.The phenomenon occurred with the AutoConnect library, but I diagnosed using the following sketch without AutoConnect library to isolate the problem. It performs
WiFi.reconnect()
(Actuallyesp_wifi_disconnect
andesp_wifi_connect
) on the user sketch side after STA_DISCONNECTED detection (actually afterWiFi.disconnected()
andWiFi.begin()
is executed by Arduino core).As a result, HTTP GET was successful. So, I assume that TCP remains closed.
Test sketch with reconnection
Log for the above sketch executed.
WiFiClient client.connect
immediately following STA_GOT_IP event fails once and restore withWiFi.reconnect()
.The text was updated successfully, but these errors were encountered: