-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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. |
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. |
- Fixes: espressif#10526 - Completes old PR espressif#10529
I am not sure if this is a related issue. ip_napt_enable(WiFi.softAPIP(), 1); assert failed: sys_timeout /IDF/components/lwip/lwip/src/core/timeouts.c:308 (Required to lock TCPIP core functionality!) |
you can surround this line with the code from thsi comment above: #10526 (comment) This is the same kind of error, but not related to the same root cause and stack trace. |
Thank you very much @mathieucarbou My NAPT is still not working yet (I have to investigate why), but it got rid of the error. |
assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!) Is an error I get with this code (painlessmesh.h). Strange thing was working yesterday, today all my working code has this error. I think stuff got updated on my Arduino IDE 2.3.4 and this may have ingested some bad code? Anyway, here is my program:
The error occurs in the |
@garykuipers : please post the decoded stack... |
PLease excuse my ignorance. UNder help from grock I spnt aboutan hour trying to figure out how to do this. All of my attempts failed. I am going to try to install the ESP-IDF and use that, but before that I am going to see if I can go back a version of two on the Arduino IDE 2.3.4 I am using. I can't be sure but if seemed like there was an undate and then things stopped working. I will get nbback to this as soon as I can.
|
Appears to have been resolved by changing from Arduino IDE 2.3.4 to platformio. Programs now compile and run as they did before I ran into this problem: Suggestions fo people using Arduino IDEs: It will waste less of your time if you just use platformio. Arduino IDEs look easier but in the long ruun they will eat up days of your time pursuing errors that are not yours. Arduino IDE was born of Windows ... so it is inherently flawed at its core. |
@garykuipers this has nothing to do with the IDE. It only has to work with the versions of the ESP32 core. If you stay on PlatformIO, you are stuck on old core version (2.0.17) and on unsupported build tool (PlatformIO). |
@garykuipers also you mention the IDE version a few times and that has nothing to do wit the ESP32 core version, which in your case is unknown to us. |
Thanks for answering:
ALl I know is: switched to platformio and the problems disappeared.
The Arduino is junky, I am glad you have nothing to do with it.
As for the core, I suspect that the discussion here found its way into the
core? And got added to my environment by an update a couple of days ago.
HOpefully whoever needs to fix this can fix it. In the meanwhile, I will
stick with platformio and occasionally install and compile the arduino ide
to see if it works if that is what contains a newer core.
I appreciate your time
…On Tue, Jan 14, 2025 at 10:20 AM Me No Dev ***@***.***> wrote:
@garykuipers <https://github.com/garykuipers> also you mention the IDE
version a few times and that has nothing to do wit the ESP32 core version,
which in your case is unknown to us.
—
Reply to this email directly, view it on GitHub
<#10526 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEVW4EPWDTHC4S3ITFGNYHL2KU2MJAVCNFSM6AAAAABQUGPA76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJQGQYTQMBYGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Gary Kuipers, President, Casinfo
cell +1 805 443 9446 other +1 702 608 6558
|
I develop an distributed teperature control system using painlessmesh. After an upgrade to the new arduino IDE version 2.3.4 the application is not working becouse it runs into truble starting painlessmesh. I recieve the assert failed : tcp_alloc /IDF etc message. I have upgraded all the dependensies but that is not helping. All the examples in the example library give the same problem. I did try to go back to a running version of arduino but that is giving now the same problem arduino 1.8.13. So I am stuck and can not go backward or forward |
@jnivard you need to downgrade the ESP32 Arduino core version to 3.0.7, not the IDE itself |
@me-no-dev Thanks I look into that |
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: