- Increase the MQTT Output Buffer: In STM32CubeMX, navigate to the LwIP middleware settings and increase the MQTT output buffer size (try setting it to 1024 bytes or more).
- Adjust LwIP Memory Settings: Increase MEM_SIZE (e.g., to 10 * 1024) and possibly other buffer-related parameters like PBUF_POOL_SIZE and TCP_SND_BUF, which control how much memory is available for networking.
- Ensure ASCII String Length Fits: Make sure the ASCII string generated from your number vector does not exceed the buffer size; longer strings will silently fail to transmit if they overflow the buffer.
- Recompile the Firmware: After making the above changes in STM32CubeMX, regenerate code and recompile the project so the new memory settings take effect.
- Use Debugging/Logs: If available, enable serial or RTT logs to see if buffer overflows or publish errors are happening on the STM32 side.
STM32 NUCLEO H753ZI Mqtt Simulink block is not sending.
4 次查看(过去 30 天)
显示 更早的评论
Hello! With this Simulink model, containing a MATLAB function to convert the vector of numbers to ASCII, I was able to send a vector of numbers until a length of only [1x20], while with a length >20, the simulink model works normally with the external mode, with the MATLAB function being able to handle any length of any row vector as an input, but no messages are displayed on Node-red.
Is it possible that the problem would be with the STM32 Mqtt block? Perhaps you can help me, please, by telling me if there are some settings in CubeMX that I can modify.
I really appreciate any help you can provide.
0 个评论
回答(2 个)
Deepak
2025-6-18
I understand that you are able to send vectors up to [1x20] from Simulink to Node-RED via MQTT using STM32, but longer vectors like [1x21] are not showing up. This likely happens due to limitations in the default MQTT buffer size on the STM32 side. Here are a few suggestions you can try that may resolve the issue:
These changes should help the STM32 handle larger payloads and allow longer vectors to reach Node-RED successfully.
I hope this helps.
0 个评论
Madhu Varshini
2025-7-1
Hi,
Kindly contact Technical Support for further assistance:
Ensure that the Simulink model as well as the STM32CubeMX IOC file are attached.
Thank you,
Madhu Varshini
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!