2024-12-20 06:04 AM - last edited on 2024-12-20 06:46 AM by Andrew Neil
Hi,
The requirement is to port MQTT of NetX Duo to STM32f412 ,without the need to use the TCP/IP and TLS addons in NetX Duo. Since we have DIGI XBee's modem and we will use its TLS socket for communications. I have the secure-socket-like interface ready, e.g. createSocket, connect, send, recv, etc...I'm looking at the middleware at stm32-mw-netx. At the beginning, I expected by providing my own BSD addon, I could run the azure-iot. But it turns out that the BSD addon in that repository is not used by MQTT. Can you suggest how I can integrate my sockets to the azure-iot/MQTT addon?
Best regards,
Hongwei
2024-12-20 06:12 AM - edited 2024-12-20 06:31 AM
Wouldn't it be easier to just find a generic MQTT implementation which isn't tied to a particular IP stack?
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/netx-duo/index.md
2024-12-20 06:40 AM - edited 2024-12-20 06:40 AM
I hope to have the netXDuo azure_iot addon, which depends on its MQTT addon. I'm not sure if any generic MQTT could be used to replace the nexT Duo MQTT addon?
2024-12-20 06:47 AM
OK - I've edited the title to make that clearer
2024-12-20 08:41 AM
If you use a 4G modem that provides its own TCP-IP stack you may have a look at Netxduo compilation flag NX_ENABLE_TCPIP_OFFLOAD. See:
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/netx-duo/chapter3.md#tcpip-offload
of course you have to provide the offload functions.
no guarantee it works. I didn't test it.
It works at TCP-IP level, not TLS. azure-iot add-on will use netxduo's TLS functions.
Also there are some example of use of cellular modem in X-CUBE-AZURE package on st.com but it is for STM32U5 with Trustzone.
There may be examples in X-CUBE-AZURE-CELLULAR package.
if you want to have technical details about how to connect to Azure IoT without Azure SDK (with your own MQTT client and TLS), see Microsoft doc https://learn.microsoft.com/en-us/azure/iot/iot-mqtt-connect-to-iot-hub#using-the-mqtt-protocol-directly-as-a-device
also:
Implementing MQTT Communication with Azure IoT Hub... - STMicroelectronics Community
2024-12-22 11:48 PM
Hello @hongwei_lyu,
These examples might be helpful for you: x-cube-azrtos-f4/Projects/STM32F429ZI-Nucleo/Applications/NetXDuo at main · STMicroelectronics/x-cube-azrtos-f4
With Regards,