Mastering MQTT in IIoT: The Gateway to Efficient Communication

MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol designed for low-bandwidth, high-latency or unreliable networks. Developed by IBM in the late 1990s, it is now an open standard managed by OASIS (Organization for the Advancement of Structured Information Standards) and the ISO (International Organization for Standardization).

IACS Engineering: Poineering MQTT Solutions for Australia’s Industrial Growth

In the digital tapestry of the Industrial Internet of Things (IIoT), MQTT (Message Queuing Telemetry Transport) emerges as a vital protocol, enabling lightweight, efficient messaging between devices. This article delves into MQTT’s role in IIoT and clarifies the distinction between MQTT and its extension, Sparkplug B.

Understanding MQTT in IIoT:

MQTT is a messaging protocol designed for minimal bandwidth and device resource usage, making it ideal for IIoT applications where network connectivity is limited or costly. Its key features include:

  1. Lightweight Protocol: Optimized for small code footprints, ideal in constrained environments like IIoT.
  2. Publish-Subscribe Model: Allows devices to publish messages to a central broker, which then distributes these messages to subscribed clients, ensuring efficient data distribution.
  3. Reliable Message Delivery: Offers multiple levels of Quality of Service (QoS) to guarantee message delivery.
  4. Low Power Usage: Designed for devices with limited battery life, making it perfect for remote sensors and actuators in IIoT.

Mapping Sheet for MQTT:

Creating a mapping sheet for MQTT communication involves defining the topics, payloads, and QoS levels for each message exchanged between the MQTT clients. Here’s what you should include:

  1. Topics: Define the topics for publishing and subscribing. Topics should be organized in a hierarchical structure that reflects the application’s data model.
  2. Payloads: Specify the content of the messages to be sent over each topic. This includes the format of the data, such as JSON, XML, plain text, etc.
  3. Quality of Service (QoS): Decide on the QoS level for each message exchange. QoS levels include:
    • QoS 0: At most once delivery (fire and forget).
    • QoS 1: At least once delivery (guaranteed delivery).
    • QoS 2: Exactly once delivery (highest reliability).

Data Format Representations in MQTT:

MQTT does not not dictate a specific format, and flexibility for an application’s needs is offered. However, some of the common data format representations in MQTT’s payload (the actual message content) are as under:

Data FormatDescriptionTypical Application
JSON
(JavaScript Object Notation)
A human read-able and widely used format for representing structured data in the pairs of “Name” & “Value”. Good for complex data with various data types
CSV
(Comma-Separated )
A simple text format where data is separated by commas. Efficient for simpler datasets with a consistent structure.
CBOR
(Concise Binary Object Representation)
A compact binary format for encoding data. Offers a balance between readability (like JSON) and size efficiency (compared to plain text).
Custom Binary FormatsSpecific to an application’s data structure, a customised binary format can be defined. Efficient for well-defined data but requires custom parsing logic on both the sending and receiving ends.
MQTT Payload’s Typical Data Formats

The choice of data format representation depends on factors like:

  • Complexity of your data: JSON for complex data, CSV for simpler data.Readability: JSON for easier debugging, custom binary for efficiency.Payload size: Text formats (JSON, CSV) are larger than binary formats (CBOR, custom).

Specifications of MQTT v5.0:

Here are some key specifications of MQTT v5.0 to remember:

  • Improved Message Properties: Provides more informative messages with additional properties for better context.
  • Shared Subscriptions: Enables multiple clients to subscribe to a single topic, improving efficiency by reducing message duplication on the broker.
  • Enhanced Diagnostics: Offers better debugging with detailed error information through Reason Codes and Diagnostic Messages.
  • Request/Response Flow: Introduces a mechanism for two-way communication beyond publish/subscribe, allowing devices to send requests and receive responses.
  • Improved Flow Control Mechanisms: Provides features to manage message flow and prevent overwhelming clients or the broker, ensuring reliable communication.

Note: This is a simplified list. Refer to official documentation for a complete understanding of the MQTT v5.0 specification.

Engineering Spreadsheet for MQTT:

Here is a sample spreadsheet format for MQTT to be used during integration and pre-commissioning checks:

Topic NameDescriptionMessage Type
(PUBLISH/SUBSCRIBE)
Data Format
(JSON, CSV, Custom)
QoS LevelExpected PayloadComments/ Remarks
temperature/sensor1Temperature readings from sensor 1.PUBLISHJSON1 (At Least Once){“temperature”: 25.5}Passed
command/actuator1Commands to control actuator 1.SUBSCRIBEJSON2 (Exactly Once){“command”: “ON”, “duration”: 10}Test in Progress
status/actuator1Status updates from actuator 1.PUBLISHCSV0 (At Most Once)“ON,10” (command, remaining time)Passed
MQTT Spreadsheet

MQTT’s Role in IIoT:

  • Facilitating Machine-to-Machine Communication: MQTT’s efficient message delivery system is crucial for M2M interactions in industrial settings.
  • Scalability: Easily handles a large number of connected devices, a common scenario in IIoT environments.
  • Real-Time Data Transfer: Enables real-time data communication, vital for monitoring and controlling IIoT operations.

MQTT vs. Sparkplug B:

While MQTT provides the framework for messaging, it does not inherently define how to structure the data payload, leading to inconsistencies in implementations. This is where Sparkplug B comes into play

MQTT:

  • A protocol standard for messaging.
  • Does not specify payload structure.
  • Requires additional agreement on data format for interoperability.

Sparplug B:

  • An extension of MQTT.
  • Standardizes the payload format and topic namespace.
  • Ensures seamless interoperability between devices and applications.

Sparkplug B’s Significance: By standardizing the payload format, Sparkplug B simplifies the integration of diverse devices and applications in an IIoT ecosystem, enhancing MQTT’s utility in industrial applications.

Conclusion:

MQTT, with its lightweight and efficient communication capabilities, is pivotal in IIoT. Sparkplug B further elevates MQTT’s effectiveness by ensuring consistent data payload formats, crucial for interoperable IIoT systems. Together, they form a formidable duo in the realm of industrial communication.

Contact Us:

For expert guidance on implementing MQTT and Sparkplug B in your IIoT strategy, contact IACS Engineering. Let’s harness the power of efficient communication in your industrial operations.

×

Hello!

Click one of our engineer below to chat on WhatsApp

× Call/ Text Anytime