Since December 2017 AnyViz supports the MQTT protocol to transfer data from any IoT device to our cloud portal. We would like to use this blog post to explain the protocol and its advantages and disadvantages.
MQTT is an open protocol designed for the transfer of data between machines (M2M). Since it is quite easy to implement, it is supported by many devices. The data to be transferred is organized in so-called topics, which can be structured hierarchically:
- Machine1/Drive/Status
- Machine1/Drive/Speed
- Machine2/Temperature
The message content (or payload) is not specified in the protocol. The content is often transmitted in the form of a UTF8 string, which contains either the value in plain text or a complex object in the form of the JSON notation. Transferring values in binary format is also common.
A so-called broker is required for data exchange via MQTT. The corresponding clients can connect to this broker and provide or subscribe to data. More detailed information can be found in the protocol specification.
MQTT with Anyviz
The AnyViz team always strives to make the handling of data and protocols as easy as possible. For this reason, the AnyViz server itself acts as a broker. As soon as an MQTT device is successfully linked to a customer project, all topics provided by the end device appear automatically. The handling of JSON objects is particularly convenient. These are automatically recognized by AnyViz and are clearly displayed. Our MQTT documentation describes how easy it is to connect to AnyViz via MQTT.
Advantages of the MQTT protocol
- Very popular because of low complexity
- The amount of data to be transferred is quite small, as the protocol itself is very slim
Nachteile des MQTT Protokolls
- Since the message content is not specified, the sender and receiver must first define a notation. This requires technical knowledge and a certain amount of configuration
- The range of functions is limited to sending and receiving data. Functions such as the transmission of buffered data after a connection failure or the routing of web pages, as available in the AnyViz protocol, are not possible
Examples of MQTT devices
Almost every IoT gateway also supports the MQTT protocol. An example is the IoT router INSYS icom MRX, which we tested for compatibility. Libraries for MQTT communication are available for many PLC platforms. Even Siemens controllers can communicate via an open source library.