2024-12-17 01:27 PM
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
2024-12-31 05:52 AM - edited 2024-12-31 05:59 AM
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 :
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:
Regards