Smart Factory Optimization Using MQTT

  • By Aaron Kuo
  • December 06, 2024
  • Moxa Technologies Inc
  • Feature
Smart Factory Optimization Using MQTT
Smart Factory Optimization Using MQTT

Compared to traditional factories, smart factories require a large number of sensors to collect onsite information and connect to information technology/operational technology (IT/OT) systems, thereby optimizing processes such as order processing, production and more. Managing the significantly increased communication demands to minimize costs, enhance efficiency and prevent cybersecurity vulnerabilities are critical issues. This article explores smart factory optimization using the MQTT protocol.


Optimizing onsite network transmission and data acquisition

MQTT is a highly efficient protocol widely used in Industrial Internet of Things (IIoT) applications. Its lightweight packet structure allows data to be transmitted efficiently within limited bandwidth. Unlike other request-response pattern protocols, MQTT’s publish-subscribe messaging pattern does not require all edge devices to be online simultaneously. Devices only need to connect to the broker when publishing or receiving data, hence reducing bandwidth waste. Additionally, its active messaging feature significantly enhances real-time performance compared to other request-response protocols.

In addition to its lightweight packets and active transmission capabilities, MQTT also optimizes the transmission architecture between onsite operations and systems. For example, in machine data collection applications, devices send their collected data to a central MQTT broker, which acts as the intermediary, allowing IT systems to retrieve and analyze the data for optimizing production processes. With MQTT, IT systems no longer need to separately connect to onsite devices to obtain data; instead, they retrieve the necessary information via the broker. This not only optimizes the data transmission path but also provides a unified and efficient communication method.

In smart factories, where data-intensive applications are common, it is crucial to prioritize data transmission based on the importance and urgency of the data. Real-time data must be sent immediately, while data that cannot be lost requires a reliable transmission mechanism. MQTT addresses these needs by offering three different quality of service (QoS) levels:

  1. QoS 0: at most once: In this mode, the client sends a message to the broker without confirmation of receipt and there is no notification about delivery to subscribers. The publisher only knows the message was sent, but not if it was received. While QoS 0 is the fastest, it is also the least reliable.
  2. QoS 1: at least once: The client expects the broker to acknowledge message receipt. If no acknowledgment is received within a set time, the message is resent until confirmed. QoS 1 is more reliable than QoS 0, but it may be slower.
  3. QoS 2: exactly once: Ensures each message is delivered only once through a four-step handshake process (initial publish, PUBREC, PUBREL and PUBCOMP), making it the most reliable but slowest QoS level in MQTT.

Security is a crucial issue in IIoT. From past experience, cyberattacks typically originate from outside the factory, so the first step to enhancing cybersecurity is installing a secure router. However, without internal defense mechanisms, breaching the router can lead to significant losses. The MQTT protocol offers strong protective measures; users can set up username and password authentication for the broker to ensure trusted access and use SSL/TLS to encrypt communications, thus ensuring the security of internal communications.
 

Connecting edge devices to an MQTT broker

To implement MQTT communication, users can add MQTT gateways to existing edge devices for protocol conversion, which enabling efficient onsite data collection. However, smart factories often need to collect large amounts of data and adding a gateway to each device can be costly. The Moxa ioThinx 4510 addresses this issue. As a modular remote input/output (I/O), the device can collect large volumes of I/O data at once and poll RTU devices onsite using the built-in Modbus RTU protocol. It then communicates with the MQTT broker using the northbound MQTT protocol and significantly reduces the cost and effort of deploying an MQTT network onsite.

This feature originally appeared in the November 2024 issue of AUTOMATION 2024.

About The Author


Aaron Kuo is a product manager at Moxa, a leading brand in industrial networking and control equipment. He specializes in the development and planning of modular remote I/O and PAC systems, with a strong focus on IT-oriented communication solutions for remote I/O products.

Download AUTOMATION 2024: IIoT, Digital Transformation & Smart Manufacturing

Did you enjoy this great article?

Check out our free e-newsletters to read more great articles..

Subscribe