cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407VGT6 + Azure threadX + NetXDuo + MQTT + usbX

coso2
Associate

Hi,

I have a STM32F407G-DISC1 board. The final goal is to write a program that get data from the hardware and publish via mqtt, and via the usb (HID client). Also an integrated http server would be great.

Is it there online an implementation example for this? Or some documentation that can help? I worked for many years as a c# developer, I can understand some concepts, but I am not speaking firmware fluently for now. Any hints would be appreciated

MCU: STM32F407VGT6

1 REPLY 1
STea
ST Employee

Hello @coso2 ,
There are a lot of libraries implementing MQTT with the difference being the ease of uses of the APIs and the lightness of the implementation or the reliability of the connection which are important criteria of selection when developing on MCUs with limited access to fast memories nor lots of storage. you can find a lot of comparatives of the implementations of MQTT online. MQTT is a fairly simple and uncluttered protocol designed to carry small amounts of data but is very simple to implement which is why it is widely used in embedded development .

if you want to stick to azure ecosystem you can find an MQTT example in x-cube-azrtos-f4/Projects/STM32F429ZI-Nucleo/Applications/NetXDuo/Nx_MQTT_Client at main · STMicroelectronics/x-cube-azrtos-f4 · GitHub
and combine it with :

x-cube-azrtos-f4/Projects/STM32F429ZI-Nucleo/Applications/USBX/Ux_Device_HID at main · STMicroelectronics/x-cube-azrtos-f4 · GitHub

alternatively, you can see the following eziya/STM32F4_HAL_ETH_MQTT_CLIENT: STM32 + FREERTOS + LWIP + MQTT example (github.com)
which implement an MQTT client on STM32F4 using Lwip and FreeRtos which is very similar to your usecase
you can see also an implementation of pubsubclient MQTT using STM32duino which is a very simple and quick way to establish a client with very little time and effort and will be simpler and more familiar environment for you I suppose: 

STM32Examples/examples/Communication/MQTT/PubSubClient/mqtt_STM32Ethernet/mqtt_STM32Ethernet.ino at main · stm32duino/STM32Examples (github.com)

Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.