-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Crash with error message: "Required to lock TCPIP core functionality" #10526
Comments
I suspect this is caused by: As I understand, That is not a bad check per see, but right now, activating it could break a lof of downstream projects, but also Arduino components right ? Example of the stack trace above, which lies in the sntp feature. Example: This issue seems related: #10415 |
Another ref: espressif/esp-matter#853 (comment) |
It is Matter that enabled it..
AsyncUDP in this repo is already made to work with the locks. The fastest way is to have a look and see if you can solve it yourself. Not everything in Async is executed in the LwIP thread, so some locking will now be required. We can not get rid of Matter :) |
But for the last stack trace, only sntp is involved... For the first stack trace, do you mean that I should port in AsyncTCP these locks like they are done in AsyncUDP ? That's impressive the amount of libs, web servers and mqtt clients will break when they will adopt 3.1.0. I wish AsyncTCP were included in Arduino Core ! |
I do plan to do this. Seems like it will be rather sooner than later 😄 |
I've placed some locks in the AsyncTCP lib, but still have some issues with sntp:
|
Ok so I've fixed AsyncTCP in mathieucarbou/AsyncTCP#28: Tested :
The only issue now remains sntp, and I have no control over that. Is it a bug in Arduino Core ?
|
From my point of view the sntp bug is a Arduino Core bug. As a workaround I modified my sources in the following way:
My sketch is running fine now with Arduino Core 3.1.0-rc2, the mentioned workaround and the fix in AsyncTCP... |
I have applied this patch in https://github.com/mathieucarbou/MycilaNTP and I confirm it works too. |
…se of Arduino Core 3.1.0 RC2 bug See: espressif/arduino-esp32#10526
can you please post a patch to the AsyncTCP repo and the ntp one to this repo? I will merge them asap |
For NTP, yes, will do later. For AsyncTCP, it is done: https://github.com/mathieucarbou/AsyncTCP. I don't see the point in sending PRs to the original repo, except if there is a clear motivation to "resurrect" it and keep it alive and maintained, with a few collaborators added in the project, who can also deploy to registries (Arduino and Pio). FYI the diff with original repo There has been many fixes / improvements from ESPHome, community and me. At any point these can be merge back to the original repo. |
I caught this one while chasing a system crash for a different issue. This is with Mathieu's updated AsyncTCP. The scenario is a simple EspAsyncWebServer (Mathieu's too) webserver/websockets with page data deliver via websockets. And in this case, an iPhone opened webpage (via Chrome) the page has stats delivered via websocket, but is not a page designed to be continually refreshed. The ws.cleanupClients() is being called and the following occured when the iPhone finally hits the auto-lock timeout. No additional investigation has been performed.
|
@microfoundry : good catch! Indeed I forgot this one: |
@me-no-dev @NicoWallmeier : fyi PR opened for the sntp fix |
@microfoundry : I have released AsyncTCP v3.2.12. Please let me know if you encounter other issues. It is still possible that some other code path need locking but I cannot find them right now. |
on my code I got this error assert failed: sntp_stop /IDF/components/lwip/lwip/src/apps/sntp/sntp.c:696 (Required to lock TCPIP core functionality!) I used these libraries #include "time.h" |
If you are not using the Arduino API you need to lock yourself the calls to sntp_* like I did: https://github.com/espressif/arduino-esp32/pull/10529/files |
Thank you @mathieucarbou - that resolved the issue |
@mathieucarbou it's up to you wether you will send a PR to the original repo. It's up to me wether will be "resurrected", but your ways do leave me wandering many things... |
If something is bothering you, you can tell me ;-) I just said I cannot afford to spend my little spare time sending a PR to fix all the projects I am not using, cannot use or cannot maintain, which is totally understandable. I would be glad to merge all the changes of my fork back to the original AsyncTCP repo though, but for me to spend time here, I don't want it to be for nothing and I would do it if there's a plan to add collaborators to the project, CI, deployment and also time allocated for maintenance, review, pr merge, etc. Things that I am able to do in my fork for now. |
That would be great.
Plan is to add it directly to the core and be fully supported here. I have not decided on the WebServer yet, but the TCP should be here, just like UDP. I do have some fun plans for it's future also. |
Now I'm getting off-topic, but I can't resist:
Please also consider AsyncWebServer for this! |
Ok! I will put that on my list and will do it then. Fist need to finish other things but I will for sure have time to do it before the end of the year. |
Going to kick this one again with:
|
I've mistakenly copy pasted and set the unlock at the wrong place 😓 Fixing... edit => v3.2.14 |
Sorry for reviving this, but @mathieucarbou can you release a new version of ESPAsyncWebServer which uses v3.2.14 of AsyncTCP? Now we need to manually add the reference. |
done. |
Description
I have several apps that I keep updated to lats Arduino RC.
3.1.0-RC1 work fine.
Since RC2 (3.1.0-RC2), I am observing several crashes with always the same error, in STA mode (not in AP mode).
Another app:
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: