Connect to an MQTT Broker using Twin Activate
Publish and subscribe from a client to an IoT platform (external broker) using MQTT (Message Queuing Telemetry Transport) protocol.
Prerequesites for This Tutorial
The following software and accounts are required for this tutorial:
- Altair Twin Activate
- Free account on Altair SmartWorks platform: https://studio.swx.altairone.com/
Files for This Tutorial
MQTT_Publishing.scm, MQTT_Subscribing.scm
Overview
One of Twin Activate's communication protocol options is MQTT, a well-known communication protocol used in IoT (Internet of Things). It is possible to both publish and subscribe to any MQTT broker, local or external, very quickly and lightly.
When publishing messages to a topic, Twin Activate sends data from the software to the broker. When subscribed to a topic, Twin Activate receives data from the broker to the software.
In this tutorial, the external MQTT broker is on Altair SmartWorks. That is the end-to-end Altair IoT platform that covers all necessary technology for Smart and connected products development. In SmartWorks, it is possible to create Things, which represent the entities in your world. They store information about real-world objects like assets, rooms, or buildings, as well as information about concepts like Tasks or processes. These Things receive data if Twin Activate is publishing, and sends data if Twin Activate is subscribed to the MQTT topic. With the data on the IoT platform, you can create dashboards using that data: https://help.altair.com/smartworks/topics/mqtt_dashboard.htm?hl=mqtt.
