-
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
WifiClient exception 29 #4488
Comments
It appears that the connection is not closed after the communication is done. client.stop() closes it, however, the issue remains. |
I am facing similar issues. Developing a library for esp8266 to talk to Twitter https://github.com/debsahu/TwitterWebAPI . Unfortunately, library works fine on 2.4.0 but after the upgrade to 2.4.1, I also get exception 29. I use WiFiSecureClient to send GET data and close the connection after every request. @igrr recommends to have only one client open due to the memory size. The recommendation is to use client.flush() and client.stop(), which I do and still get exception 29. Please help. |
I got it to work on 2.3.0 when I call tcpCleanup regularly.
It does however not work with the current core and LWIP 1.4 (compile from source) |
@s0170071 could you please upload a reproducer sketch? Thank you. |
@igrr: please see #4487. Its the same sketch. This issue uses two instances of the SMA class which gives a different kind of error. The underlying problem seems to be a memory leak if the connection is not closed by the peer. |
Well, that was my point — I am not sure how exactly to modify the sketch to reproduce this issue. I would be grateful if you give instructions to reproduce, including how to implement the peer side. |
ok, I just used another esp to respond with 11 bytes when contacted at port 502. They talk but I cannot reproduce the issue. But I observed that the connection is closed when the communication is done. |
Is there a way to make the server not close the connection? That could help to reproduce. |
Maybe connect to an HTTP server and send a Connect: keep-alive header? |
There is no such thing as headers when you play with modbus. And the client class has no method for headers :-) |
Nope. No real workaround. The leak is smaller but now and then it drops a few bytes... Slowly. Tested with latest git. |
Try adding client.setTimeout(time_ms) before client.connect(). Seems to solve my issues with exception 29. EDIT: nevermind. It was a bit stable for ~10min. |
@igrr Here is a server sketch that leaves the connection open. The trick is to just not send anything ;-)
Debug output of the client is:
@debsahu I tried that and also client.disableKeepAlive() but with little success |
Closing, will track in #4497. Please follow the link to that issue and click "subscribe" to receive notifications. |
Basic Infos
[x ] This issue complies with the issue POLICY doc.
[x ] I have read the documentation at readthedocs and the issue is not addressed there.
[x ] I have tested that the issue is present in current master branch (aka latest git).
[x ] I have searched the issue tracker for a similar issue.
[ x] If there is a stack dump, I have decoded it.
[x ] I have filled out all fields below.
Platform
Settings in IDE
Problem Description
This issue is related to #4487.
What changed is that I now have two instances of the SMA class which means I do have two instances of the WiFiClient too.
Sketch difference to #4487 is pretty much just the fact that I instantiated the class twice :
It does drain the memory twice as fast but instead of stalling, it is throwing an exception:
connect 192.168.1.41 OK, sending: 0 1 0 0 0 6 126 4 157 7 0 1
connect 192.168.1.41 fail.
1328
1160
reading bytes: 0 1 0 0 0 5 126 4 2 16 16 pow: -32768
1328
1328
1328
1328
1328
1328
1328
1328
1328
connect 192.168.1.41 OK, sending: 0 1 0 0 0 6 126 4 157 7 0 1
The text was updated successfully, but these errors were encountered: