Hi,
My application was created with ESP-IDF v4.x and the syslog logging worked just fine.
In jan 2025 I moved to ESP-IDF 5.4.1 which required me to adjust source code to match the new framework, but after that it functions as expected, except for the syslog logging althoug I did not change the logging module.
My application has a main task as created by the ESP-IDF, and 2 additional tasks (one on each core) that run a worker thread to support sub-tasks. In these subtasks we have 2 HTTP servers, 1 MQTT client and a TCP protocol driver. These all use non-blocking TCP sockets.
The logging module logs to console, a weblog and syslog over UDP socket.
When I enable syslogging I notice that the tasks die and the complete application is not responsive. Via a recovery method I can disable the syslogging and then the system works fine again.
What I notice is that sending data over the UDP socket (writeLine:sendto) returns ENOMEM after a few writes, and then we don't talk about big data, see example below.
From the moment writeLine:sendto returns err=12 (ENOMEM) the application starts dying as if memory is being eaten.
I compared sdkconfig as used in ESP-IDF v4.x and 5.4.1 but I don't see a problem
Anybody an idea?
Thx, Jo
>>>
2025-09-09,20:57:51,D,SNTP,!Initialising...
writeLine:sendto(46)
2025-09-09,20:57:51,I,HTPS,!Started
writeLine:sendto(62)
2025-09-09,20:57:51,I,MQTC,>Connecting to broker...
writeLine:sendto(60)
2025-09-09,20:57:51,I,RPCS,!XMLRPC server started
writeLine:sendto(64):err=12
2025-09-09,20:57:51,I,MQTC,<Connected to 192.168.0.10
writeLine:sendto(80):err=12
<<<
Sending data over UDP socket crashes my system
-
nopnop2002
- Posts: 362
- Joined: Thu Oct 03, 2019 10:52 pm
- Contact:
Re: Sending data over UDP socket crashes my system
1 Create a new UDP client task.Anybody an idea?
https://github.com/nopnop2002/esp-idf-n ... p_client.c
2 Replace sendto() with xRingbufferSend() or xMessageBufferSend().
You can use this component.
https://github.com/nopnop2002/esp-idf-n ... /tree/main
Re: Sending data over UDP socket crashes my system
Thank you for the response.
However, I find the proposed workarounds a bit over the top.
Certainly given the fact that this worked just fine with esp-idf 4.x on one hand, on the other hand, we are not talking about big data that we are sending.
After sending 160 bytes to the UDP socket things went wrong... huh !? This is a fundamental issue in the esp-idf in my view.
Is someone from espressif listening on this topic ?
regards, Jo
However, I find the proposed workarounds a bit over the top.
Certainly given the fact that this worked just fine with esp-idf 4.x on one hand, on the other hand, we are not talking about big data that we are sending.
After sending 160 bytes to the UDP socket things went wrong... huh !? This is a fundamental issue in the esp-idf in my view.
Is someone from espressif listening on this topic ?
regards, Jo
Re: Sending data over UDP socket crashes my system
I am doing it all of the time, with datagrams up to 32k. So IDF isn't at fault here IMHO.
Who is online
Users browsing this forum: Bing [Bot], meta-externalagent, Qwantbot, YisouSpider and 2 guests