Endüstri Vadisi
Endüstri Vadisi
- Thread Author
- #1
What you need to know about MQTT in automation
MQTT is an important protocol for communication in the Internet of Things. It is also being used increasingly in automation. Here's what you need to know about it:Many devices in the Industrial Internet of Things can communicate wirelessly with each other using the "lean" communication protocol MQTT.
What does MQTT stand for? What is it about?
MQTT stands for Message Queuing Telemetry Transport. It is an open network protocol for the exchange of information between machines (machine-to-machine communication / M2M).Who invented MQTT?
The story of MQTT began in 1999. IBM and Arcom Control Systems were tasked with developing a system for remote monitoring of oil and gas pipelines. Due to the still rudimentary mobile data infrastructure at the time, the protocol messages had to be small enough to be transmitted via satellite.The number of devices in the IoT is growing rapidly.

Number of machine-to-machine connections in OECD countries in December 2022.How does MQTT work?
MQTT uses a publish/subscribe model, where devices publish messages and other devices subscribe to receive them. At the heart of the system is a central server called a broker, which acts as an intermediary between the different devices and systems.Data transfer takes place within a topic with naming conventions similar to file structures, for example, "Smart Factory/Production Line 1/Machine 2". MQTT uses simple text-based formats such as JSON or XML and is therefore very efficient in terms of bandwidth.
What is special about MQTT?
MQTT has a number of features that make the protocol very useful and easy to implement:- Scalable: MQTT is capable of supporting large networks with thousands of devices.
- Offline capability: MQTT supports caching messages when devices are offline and delivers stored messages upon reconnection.
- Discovery: When new devices are added to the network, they are automatically discovered and can act as publishers or subscribers.
- QoS: A different Quality of Service (QoS) can be set for each client-broker connection:
0 (at most once): The message is sent only once, no acknowledgment of receipt is received.
1 (at least once): The message will be sent several times until delivery acknowledgment is received.
2 (exactly once): The message is sent only once with delivery acknowledgment.
What is the current version of MQTT?
The current version is MQTT 5.0, which was released as an OASIS standard in March 2019. This version offers a significant number of new features compared to previous versions and addresses various criticisms that existed in earlier versions:- Improved mechanisms for authentication and authorization: The newly introduced AUTH packet now supports the SASL (Simple Authentication and Security Layer) framework.
- Protocol extensibility: The protocol is now significantly more extensible through the specification of user properties (i.e., application-specific headers). In addition to the actual user data, all kinds of metadata can now be added to an MQTT packet.
- Performance improvements for small clients: For example, long topic names lead to a large packet overhead. Topic aliases allow the topic name to be replaced by a two-byte integer value. This saves bandwidth.
What is the "last will" in MQTT?
The "last will" in MQTT is a special message that a device sends if it involuntarily leaves the network or fails. This feature is important to ensure that the protocol works even with unreliable connections.How can MQTT be used in industrial automation?
In industrial automation, MQTT can be used in many areas to improve communication between devices and systems. Here are some examples:- Monitoring of machines and processes: MQTT enables data from sensors and machines to be sent to monitoring systems, allowing for quick intervention in the event of possible malfunctions or problems. MQTT can also be used to collect data from control systems and send it to higher-level systems for controlling and monitoring the production process.
- Energy consumption: MQTT can be used to collect data from energy meters and send it to energy management systems.
- Supply chain data: MQTT enables the collection of data from supply chain sensors and sending it to systems for monitoring and managing delivery status.
What are the disadvantages of MQTT?
As with any technology protocol, MQTT also has some disadvantages and weaknesses that should be considered. Here are a few of them:- Data integrity: MQTT does not offer integrity checks for transmitted data, which can lead to data loss or misinterpretation.
- Data security: MQTT does not offer integrated security for transmitted data; therefore, it is important to transmit data over a secure connection and to protect the data using encryption technologies.
- Transmission speed: MQTT is not optimized for very high transmission speeds and can slow down in applications with large amounts of data.
How does MQTT differ from OPC UA?
MQTT and OPC UA are protocols used in industrial automation for data transmission and control of devices and systems. However, they have different purposes and characteristics.OPC UA (OPC Unified Architecture) is an open communication protocol specifically designed for industrial automation. It offers high data integrity and availability. OPC UA is a robust protocol suitable for use in complex industrial environments. However, it is not easy to implement. The standard description comprises several thousand pages.
In contrast, MQTT (Message Queuing Telemetry Transport) is a very lightweight protocol specifically designed for data transmission over wireless networks and resource-constrained applications such as small devices. It is easy to implement and use.
MQTT originates primarily from the IT sector and is supported by many cloud providers such as Azure and AWS. OPC UA, on the other hand, is supported by important players in the mechanical engineering and automation sectors. It has a greater focus on operational technology (OT) in manufacturing plants.
In many - especially complex - industrial applications, a combination of MQTT and OPC UA can also be beneficial.



















