MQTT Publish
R2026bLibraries:
STM32 Microcontroller Blockset /
STM32F4xx Based Boards
STM32 Microcontroller Blockset /
STM32F7xx Based Boards
STM32 Microcontroller Blockset /
STM32H7xx Based Boards
Description
The MQTT Publish block publishes messages from your hardware (publisher) to the Message Queuing Telemetry Transport (MQTT) broker on the specified topic.
The Message port accepts the message to be published to the broker. The Status port outputs the status of the publish request. The string topic/level on the block icon is specified by the Topic parameter.
For more information on MQTT, see Introduction to MQTT.
Note
The MQTT Publish block supports MQTT only over TCP/IP sockets.
Examples
Ports
Input
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"stm32f4xxblockslib/MQTT Publish"
"stm32f7xxblockslib/MQTT Publish"
"stm32h7xxblockslib/MQTT Publish"
Example: add_block("stm32f4xxblockslib/MQTT Publish","myModel/myBlock",MakeNameUnique="on")
Version History
Introduced in R2024a


