2024-11-25 05:53 AM - last edited on 2024-11-25 06:46 AM by SofLit
Hello STM Community,
I am currently working on a project using the STM32F407 microcontroller, and I need to implement MQTT communication with Azure IoT Hub for cloud connectivity. The STM32F407 is already connected to the internet through LTE modem via PPPoS, and now I need to integrate MQTT to send data to Azure IoT Hub
Any guidance or resources for setting this up would be greatly appreciated!
Thanks!
2024-11-25 08:47 PM
Hello,
Any update Today?
Can I proceed with the implementation from
https://github.com/eziya/STM32F4_HAL_ETH_MQTT_CLIENT ?
2024-11-27 09:11 PM
Hello,
Any update Today?
2024-11-29 08:37 AM - edited 2024-11-29 08:46 AM
Hello
Did you look at Microsoft documentation to connect to their Azure IoT Hub ?
Microsoft provides C SDKs to connect to azure iot hub:
Azure IoT device and service SDKs - Azure IoT | Microsoft Learn (you need the "device" SDK)
There are 2 SDKs: "Azure IoT C SDK" and "Azure SDK for C". For embedded devices you need "Azure SDK for C" (https://github.com/Azure/azure-sdk-for-c).
General information to connect to Azure IoT Hub:
Use MQTT to communicate with Azure IoT Hub - Azure IoT Hub | Microsoft Learn
if you want low level MQTT connection details:
If your project uses FreeRTOS, see the link in "Azure IoT SDKs" page to GitHub - Azure/azure-iot-middleware-freertos: Azure IoT Middleware for FreeRTOS
If your project is based on Azure RTOS with Netxduo TCP-IP stack you can have a look at X-CUBE-AZURE or X-CUBE-AZURE-H5 (but they are for STM32U5/STM32H5, not for your STM32F4).
2024-11-30 04:43 AM
Hi@ Guillaume K
I have reviewed the Azure documentation and would like to integrate the Azure SDK Middleware for FreeRTOS with my STM32F407-based application. However, the Azure documentation mentions that the middleware has only been tested with the following MCUs:
For my application, which is based on the STM32F407, which of these MCUs would you recommend I use as a reference for porting?
Additionally, I noticed that the X-CUBE-AZURE package is specifically designed for STM32U5 and STM32H5 devices. Is it possible to adapt X-CUBE-AZURE for the STM32F407, or would this require extensive modifications?
Best regards,
Noushadali K.
2024-12-01 09:05 PM
Hi,
Any update Today?
2024-12-02 12:19 AM
Both X-CUBE-AZURE packages are made with Azure RTOS and Netxduo so it would be difficult to port to FreeRTOS.
I don't have much experience with Azure SDK middleware for FreeRTOS.
The 3 boards you mention don't have the same network interface as yours (cellular).
I suggest you refer to Microsoft documentation about Azure SDK middleware for FreeRTOS, and your cellular modem documentation.