MQTT Client Plug-in
MQTT – The protocol for IoT and M2M communication
The MQTT (Message Queue Telemetry Transport) protocol is a widely used protocol in the IoT (Internet of Things) world. In the industrial environment, many sensors are used as publishers and higher-level systems as subscribers. The data content of messages transferred via MQTT is unspecified and determined by the publisher. This is a major difference between communication via MQTT (What is MQTT?) and OPC UA (What is OPC UA?). The structures of the communicated data are predefined in OPC UA.
With OPC Router as MQTT client and subscriber you use data from MQTT publishers and forward them to any system via the additional Plug-ins. For example MQTT to OPC UA, MQTT to SAP, MQTT to SQL, MQTT to REST, etc. As a publisher, you can send data from non-MQTT capable sources to a broker and thus provide any MQTT subscriber with data. You can see practical use cases in our step-by-step guides: Connect to the Azure IoT Hub with the MQTT Client, Connect the AWS IoT Cloud via MQTT, Connect the IBM Watson Platform via MQTT, Connect the Google IoT Core via MQTT and Connecting Siemens MindSphere IoT via MQTT.
You can find a dedicated video about this topic by visiting our tutorial stream.
It can be as simple as that.
MQTT connection via drag & drop
Connecting systems via MQTT is quite easy and intuitive with OPC Router using drag & drop. In our screenshots you can see exemplary MQTT transfers. The first screenshot shows data that was collected from an OPC Server with OPC UA Client Plug-in, converted into a user-defined JSON string via the JPath Plug-in and sent to the MQTT Broker. The Mosquitto Broker was used for the test. The second screenshot shows an example of an MQTT to SQL transfer: Data is received by the MQTT client Plug-in from the broker. The reception triggers the trigger. The trigger makes the payload available and the data is written directly into an SQL table via the MS SQL Server Plug-in.
MQTT Client and IoT Gateway as one
- Achieve more with coupled systems:
With the OPC Router as an MQTT client, you send or receive valuable data to/from MQTT-enabled systems. The MQTT Client Plug-in paves the way to the IoT world and allows non-MQTT capable devices to communicate data with the IoT and the cloud.
- Industrie 4.0 MQTT Client:
The connected systems of the Industry 4.0 world communicate via many different interfaces. MQTT is one of them and in the Industry 4.0 world it primarily ensures the integration of IoT devices and the cloud. Here, the OPC Router builds the bridge to the infrastructure of networked production.
- Data hub and IoT gateway:
With the OPC Router, you can graphically realise the networking of your systems. Its Plug-ins make it a data hub in the industrial environment. Simple configuration, sophisticated monitoring and robustness are its distinguishing features. With the MQTT Plug-in, it takes on the function of an IoT gateway.
MQTT Client Plug-in application examples
IoT and Cloud Connection
The IoT lives on the one hand from the intelligent “things”, but just as much from the overarching networking of things. This is done by the cloud and IoT platforms. Most of these platforms have the IoT protocol MQTT as one of their primary interfaces. The data on the digital twins of things are exchanged with the real things via MQTT. The OPC Router can serve as a communication partner for these platforms with its MQTT Client Plug-in and thus send data from the real world to the platform, but the path from the cloud back to the “real things” is also possible. What can be considered a “thing” from the OPC Router point of view results from the Plug-ins of the OPC Router. By combining each of its Plug-ins with the MQTT Client Plug-in, printers, SQL servers, SAP systems, etc. can be integrated into the respective IoT platform. Common IoT platforms are, for example, Amazon AWS IoT (instructions for the AWS IoT Cloud connection with MQTT), Microsoft Azure (instructions for the connection of Azure IoT Hub with MQTT), IBM Watson, ThingWorx.
Data acquisition from sensors and devices
The MQTT protocol was created especially for devices and networks with low bandwidth. Therefore, small and low-power devices and sensors are predestined MQTT data sources. With the OPC Router, the data from these data sources can be received via a broker and then transferred to processing systems such as SQL servers, SAP systems, printers and others (see Plug-ins). Data is also sent to the devices and sensors this way to make settings or trigger actions since MQTT data traffic is bidirectional.
Connecting systems with the OPC Router MQTT Client Plug-in
The MQTT Client Transfer object allows messages to be sent as a publisher. The broker is configured in the instance of the Plug-in. The fields Topic and Payload are transferred to the transfer object.
The data is sent to the broker when the transfer is executed and thus transferred to the subscribers.
The XPath or JPath Plug-ins can be used very well for structuring the data in the payload.
The MQTT Client Plug-in provides an MQTT trigger to initiate connections.
The MQTT trigger is a subscriber for a specific topic (wildcard possible) on a broker. If a message is received, the trigger makes the topic and the payload available in the connection.
Browsing of topics is not provided by the MQTT protocol. For this reason, the MQTT Client Plug-in does not offer browsing.