-
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
Exception in WiFiClient when WiFi is disconnected #4078
Comments
I can confirm this. Doesn't happen with LwIP v1.4 selected. Log output with 1.4 when WiFi disconnects:
With 2.0, this results either in an exception or a hardware WDT (still wondering how that happens):
With LwIP 1.4, TCP PCB receives error callback (log with |
The "del if0" is treated differently in lwip2.
I'll check asap.
…--
on mobile
On January 4, 2018 2:26:20 PM Ivan Grokhotkov ***@***.***> wrote:
I can confirm this. Doesn't happen with LwIP v1.4 selected.
Log output with 1.4 when WiFi disconnects:
```
:ref 1
Client connected.
state: 5 -> 0 (0)
rm 0
:er -8 0x00000000
del if0
usl
mode : null
wifi evt: 1
STA disconnect: 8
:ur 1
:del
```
With 2.0, this results either in an exception or a hardware WDT (still
wondering how that happens):
```
:ref 1
Client connected.
state: 5 -> 0 (0)
rm 0
del if0
usl
mode : null
wifi evt: 1
STA disconnect: 8
:ur 1
:close
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
```
Seems that if TCP disconnect is triggered after WiFi goes down, this
results in an invalid memory access somewhere.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#4078 (comment)
|
Thanks for reproducing! That's the same behavior I described here a few days ago. |
Thank you for your explanation! Where can I change to LwIP v1.4 if it is possible without changing core version? |
@pakokol In Arduino IDE you can change it in the Tools menu |
@jp112sdl Thank you! |
about lwip2: |
@pakokol Please retest with the reference PR. |
related to esp8266#4101 esp8266#4078 esp8266#4060 esp8266#4028 and maybe others
@devyte I have cloned and tested your commit, but it still crashes after a few connection drops.
|
related to esp8266#4101 esp8266#4078 esp8266#4060 esp8266#4028 and maybe others
@pakokol |
@d-a-v I have retested it with a clean installation from git and also removed my printouts from the above code. The exception occurred after the second connection drop. The result from stack decoder is:
And the printouts:
I hope I did everything the right way, because I'm a little confused about what did you meant that the referenced PR is merged. Aren't PR just printouts on the serial or did I miss something? |
a PR is a "Pull Request" meaning a pending source code update which become included (part of core) once "Merged". Get some doc about git and GitHub for more information. Could you please add
|
@d-a-v Hi sorry for the late response I was away for the weekend. I retested it with your changes and I couldn't reproduce the exception. Thank you for your support on that issue!! :) |
The reason is found, this proposed fix is valid but a better one is coming. |
What are the build flags for lwip, using platformio? |
Reported in #4078. WiFiClient::stopAll, called from a WiFi disconnected event handler, could be called while WiFiClient::connect was in progress. This issue was initially fixed in #4194, by testing `this` pointer for being non-null in ClientContext::connect. This change delegates deletion of ClientContext to WiFiClient destructor. WiFiClient::stop only calls ClientContext::stop, which closes/aborts the connection.
Reported in #4078. WiFiClient::stopAll, called from a WiFi disconnected event handler, could be called while WiFiClient::connect was in progress. This issue was initially fixed in #4194, by testing `this` pointer for being non-null in ClientContext::connect. This change delegates deletion of ClientContext to WiFiClient destructor. WiFiClient::stop only calls ClientContext::stop, which closes/aborts the connection.
I am having a problem with this correction, after 5 days working well, communication with the access point is ok, I can ping the device, the device connect to the server but there is no communication with the server. The sketch stop when calling httpclient. Timeout dont work and hardware watch dog dont restart the device. After reboot the access point or the device, every thing go normal. I'm using iis 8.5 server to connect and i got the error 1232: |
After losing the connection for unknown reasons, it can not restore the connection, and begins to lose memory. What eventually comes to crash.
Transcript:
|
@whakru this is a closed issue. |
Basic Infos
Hardware
Hardware: ESP-WROOM-02
Core Version: 2.4.0
Description
WiFiClient causes exception 28 in connect function.
Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 2M
CPU Frequency: 80Mhz
Flash Mode: DIO
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck
Sketch
Debug Messages
I'm trying to connect to a MQTT server. It connects to the server and works as expected. But when I turn of my router and the connection is lost it crashes with exception 28. Am I using something wrong or is this a bug?
The text was updated successfully, but these errors were encountered: