MQTT

MQTT or Message Queing Telemetry Transport is the leading communication protocol for Industry 4.0
MQTT is a TCP/IP machine-to-machine/IoT communication protocol. It is an ultra light, open source, publish/subscribe communication model, which is also very easy to implement. It is very useful in applications where low code footprint, low bandwidth consumption low power consumption and reliability in data distribution are important

Send data directly to the client

Publish/subscribe is an alternative to the traditional HTTP client-server model, where the client communicates directly with the endpoint. The difference is that in the publish/subscribe model, the client does not extract data from the server, but the server sends it to the client in the event of a change.

A reliable TCP connection is required for communication. If it is interrupted, the server can store data in a buffer, and the data is sent to client when connection is re-established.

Want to purchase our Industrial network equipment?

Transmit messages from publishers to subscribers

MQTT Broker

The central communication point is the so-called MQTT broker, with the task of transmitting messages from publishers to subscribers.

Selects the appropriate subscriber based on the topics. Publishers have the task of sending messages to the broker with specified topic.

Transmission is event-driven, which means that data is transmitted at changes (or at time intervals).

Subscribers receive messages from MQTT broker only for the topics to which they are subscribed.

Get to know the main advantages of MQTT

MQTT provides a very high level of security using TLS/SSL certificates on top of TCP protocol.

The MQTT packet or message format consists of a 2 byte fixed header (always present), Variable-header (not always present) and payload (not always present). Downloading only the essential components reduces the amount of data, and at the same time, each package does not necessarily contain a variable header and payload

Messages are sent asynchronously using the pub/sub architecture. Each packet sent has its own purpose, each bit is carefully created so that data consumption is kept to a minimum.

Each MQTT network shall have at least:

  • 1 x MQTT broker,
  • 1 x MQTT publisher,
  • 1 x MQTT subscriber

In MQTT, you use the Last Will and Testament (LWT) feature to notify other clients about an ungracefully disconnected client. Each client can specify its last will message when it connects to a broker. The last will message is a normal MQTT message with a topic, retained message flag, QoS, and payload.

The broker stores the message until it detects that the client has disconnected ungracefully. In response to the ungraceful disconnect, the broker sends the last-will message to all subscribed clients of the last-will message topic. If the client disconnects gracefully with a correct DISCONNECT message, the broker discards the stored LWT message.

MQTT is an OASIS standardized protocol that enables integration into IoT, platforms, and operating systems. For most MQTT applications, the implementation of basic commands (CONNECT, PUBLISH, SUBSCRIBE, DISCONNECT) is sufficient.

You can set 3 types of Quality of Service depending on application:

  • QoS 0 – messages are sent to the best of their ability. Data loss may occur
  • QoS 1 – messages are guaranteed to arrive. Duplicates may occur
  • QoS 2 – It is guaranteed that messages arrive only once
MQTT communication protocol for Industry 4.0

Want to know more?

MQTT ladder functions

Fill out the contact form and we will get back to you shortly.

Don’t miss any news.

Subscribe to our newsletter!

    Contact form 7 Mailchimp extension by Renzo Johnson - Web Developer

    Don’t miss other news