MQTT Subscribe
Libraries:
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32H7xx Based Boards
Description
The MQTT Subscribe block receives messages from the MQ Telemetry Transport (MQTT) broker for the specified topic.
At each time step, the block checks if a new message is available on the specified topic. If a new message is available, the block receives the message. The Message port outputs the new message. If a new message is not available, Message outputs the last received message. The Topic port outputs the topic of the received message. 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 Subscribe block supports MQTT only over TCP/IP sockets.
Examples
Limitations
Only a maximum of 10 MQTT Subscribe blocks are allowed in a Simulink® model.
Ports
Output
Parameters
Version History
Introduced in R2024a