2025-11-26 8:07 AM
Hello!
I am trying to get an MQTT project to work, but having some issues. At some points randomly the program stops and does not respond to the remote server anymore. In hopes of figuring it out I tried to enable stack checking from ThreadX settings from CubeMX, and generated the code. BUT, whenever the stack checking was disabled, DNS was able to retrieve the IP address always. Now, it fails every time.
The function "nx_dns_host_by_name_get" is called from the begging of SNTP thread. After calling the mentioned function, the return status is NX_DNS_QUERY_FAILED (0xA3). I have the DNS set up as to retry 3 times with a timeout of 10 seconds.
Checking from WireShark I can see that the device did send out the query to get the IP address, and the router answered, but for some reason the packet was not received/saved on the device side. After that I get 3 different ARP packets from the router, which is trying to identify my device, but no responses. Finally, 2 more attempts are made by the device to query the IP address, which do not get any responses (makes sense, when the device does not respond to the router for identification).
So, I am a bit confused and out of ideas as to what might be the cause to this problem. I mean, enabling stack checking is doing something, but I believe that there is a deeper issue/problem present in my program.