-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
stopAll() in WiFiGeneric causes currently in progress webServer transmission to stop. #6123
Comments
I can imagine it would be useful to enter sleep mode as soon as possible and leave in a known state. |
@adrionics This is history and legacy. I currently can't think of anything that would prevent the removal of
Agreed, then |
My feeling is stopAll() should always be user initiated and if you are going to sleep, call it if you need to. My issue was happening in AP_STA mode, while not connected to WiFi as a STA, but with a client connected to the AP and downloading a web page from the ESP. The AP client stays connected, just the web browsers TCP connection is interrupted when the ESP attempts to connect to a non existent network and that fails. Looking at the code, any WiFi event would cause this though. Do you want an MCVE? |
@adrionics the method must be called if an interface goes down, e. g. the STA disconnects, for cleanup purposes. In that case, it is up to the user app layer to restart services, usually by implementing the restart in a wifi event callback. @d-a-v I do believe we currently have a single list of sockets for both AP and STA. We could split the list, but we would need to have one per interface (e. g. loopback, Ethernet_lwip, etc). We could then close only those relevant to the interface that went down. |
TCP connections must be closed before the interface goes down. The question arisen in this issue is to remove core-initiated calls to |
This line:
Arduino/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Line 224 in eea9999
If, while the web server is sending a chunked response, a WiFi event occurs, the chunked response is abandoned and the web browser gives an error. Commenting it out appears to fix the problem but maybe there was a reason for it and something else would be broken after removing it?
It may also have some bearing on an older issue: #1554
The text was updated successfully, but these errors were encountered: