Home United States USA — software Using MQTT for IIOT Apps

Using MQTT for IIOT Apps

140
0
SHARE

Learn about the MQTT communication protocol and how it’s used in the manufacturing sector to send and receive data from an Opto 22 industrial controller.
Join the DZone community and get the full member experience. MQTT is a communication protocol that has taken off in the IIoT community. It’s a lightweight, efficient protocol that works through a publisher/broker/subscriber model. It creates an easy way for field devices to communicate and retrieve data from a single location. In this tutorial, we’ll go over MQTT and dive into an example of how you can publish data using a groov EPIC PAC and retrieve the data using an MQTT client. The Open Systems Interconnection (OSI) model is used to describe the way machines and applications communicate between themselves. The model was developed with the idea that a provider can utilize different protocols or software components at every layer without having to re-architect the entire structure. The MQTT protocol will come into play at Layer 7 of the model; on top of TCP/IP (Layer 4). The reason that this is important is that this keeps a lot of infrastructure in place while redefining how the packets are being sent between devices. As mentioned in the introduction, MQTT will have three large buckets for each node: We thus have the following topology in the world of MQTT: It can be immediately apparent that this type of model has multiple advantages over the traditional polling model. MQTT is often sold to have the following advantages: The protocol will send data when a change is detected. In other words, digital values need to toggle while the analog ones need to change beyond a set threshold / deadband. This reduces the amount of traffic on the network and provides only meaningful updates to all the subscribers. The MQTT protocol was designed with efficiency in mind. While HTTP (same OSI layer) has close to 8000 bytes in the header, MQTT has 2. The smaller header once again contributes to faster and more efficient transmission of data over the network. MQTT supports TLS / SSL encryptions and thus secures IoT data sent over the protocol. In most instances, MQTT will utilize TCP/IP. However, it’s possible to use the protocol over other popular IoT networks such as Zigbee and UDP. MQTT provides a special standard called MQTT-SN for these types of applications. IoT devices are designed with unstable network connections in mind. Therefore, Quality Of Service (QoS) plays an important role within the MQTT protocol. The QoS flags will guarantee message delivery and update based on network conditions. Should the network deteriorate, MQTT will enable a higher level of QoS which will ensure repeated attempts at delivering system messages.

Continue reading...