The MQTT Solution

Real-Time Data Transmission in a Publish-Subscribe Messaging Model, Reducing Network Bandwidth Stress, with MQTT Training from AUTOSOL

AUTOSOL’s edge computing software, eACM relies on MQTT, which is short for Message Queuing Telemetry Transport, to deliver large quantities of data using less bandwidth than traditional methods. This lightweight messaging protocol is designed for use in SCADA systems, the IIoT (Industrial Internet of Things) and other low-bandwidth, high-latency or unreliable network environments. Several factors contribute to MQTT being ideal for transmitting data from oil and gas pipeline sensors and other connected devices from the field.

Whether you’re new to AUTOSOL or a seasoned user, AUTOSOL Academy provides a unique opportunity to deepen your understanding of AUTOSOL’s products, enhance your operational efficiency, and tackle real-world challenges with confidence. Additionally, our courses cover today’s hottest industry topics, equipping you with insights and best practices to thrive in automation, SCADA, and IIoT environments. 

Interested in MQTT Training?
To jump directly to our AUTOSOL Academy MQTT 101 Training, please click here.

Getting Started with MQTT  

In the realm of Industrial Internet of Things (IIoT), seamless communication is paramount for efficient and reliable operations. One protocol that has gained significant traction in this domain is MQTT (Message Queuing Telemetry Transport). MQTT’s lightweight and efficient messaging capabilities make it an ideal choice for transmitting data between industrial devices and systems. In this article, we’ll explore AUTOSOL’s utilization of MQTT Sparkplug and its significance in enhancing IIoT communication. 

MQTT is a lightweight messaging protocol, which is widely used for IoT applications, thanks to its low overhead and scalability. MQTT’s publish/subscribe model makes it ideal for AUTOSOL’s solutions, especially when dealing with large-scale IoT networks where devices and applications need to communicate seamlessly. We’ll walk through the basics, including core concepts, topic structure, message payloads, and much more.

What Is MQTT?

MQTT (Message Queuing Telemetry Transport) is a lightweight, broker-based protocol designed to operate over TCP/IP. It uses a publish/subscribe (Pub/Sub) model, making it ideal for one-to-many messaging in IoT networks where devices can exchange data in near real-time.

Key Features of MQTT

  • Lightweight: Optimized for minimal network and computing resources.
  • Broker-Based: Relies on an intermediary server (broker) to manage data flow.
  • Pub/Sub Model: Supports a highly scalable one-to-many messaging model.
  • Data Agnostic: Can handle any payload type, allowing flexibility in message formats.

Key Components of MQTT

MQTT Client

An MQTT client is any device or application that can send and/or receive messages using an MQTT library.

MQTT Broker

The broker is a program that runs on a more powerful machine, managing client connections and facilitating message distribution. The broker:

  • Authenticates and authorizes MQTT clients.
  • Manages client sessions.
  • Receives, filters, and forwards messages to relevant subscribers.

Why Choose MQTT? Pub/Sub vs. Poll/Response

The Pub/Sub model provides several advantages over a traditional poll/response approach, especially in IoT and unreliable network environments.

Pub/Sub

  • Network Efficiency: MQTT easily allows implementation of Report By Exception, which conserves bandwidth.
  • Scalability: Allows multiple consumers to subscribe to the same topic without disrupting the source.
  • Reliability: Suitable for environments with intermittent connectivity.

Poll/Response

  • Tightly Coupled: Data gets contextualized in your SCADA system and usually has to funnel out to other places from there.
  • Inefficiency: Requires continuous polling, even if data hasn’t changed, consuming unnecessary resources.

Understanding MQTT Topic Structure

MQTT topics are structured as strings, organized in hierarchical levels separated by forward slashes. For example: building/floor4/lobby/securitycamera. This approach enables easy categorization of data across different topics.

Topic Filtering and Wildcards

  • Multi-Level Wildcard (#): Matches multiple levels and can only be used at the end. E.g., building/floor4/lab/#
  • Single-Level Wildcard (+): Matches a single level. E.g., building/floor4/+/temperature

MQTT Payloads

MQTT payloads can be of various formats, such as raw binary/hex, JSON, XML, or Protobuf, depending on the requirements of the application. However, payload variety comes with maintenance overhead, and care should be taken to manage payload types for efficiency and reliability.

Payload Best Practices

  • Be consistent with data format across similar topics.

Consider using standards like Sparkplug for better interoperability. AUTOSOL’s ACM supports Sparkplug, and eACM supports Sparkplug, Raw, and JSON payloads.

Understanding MQTT Sparkplug 

Sparkplug is a protocol specification, managed by the Eclipse Foundation, that builds upon the MQTT standard, customizing it specifically for industrial applications. It defines a set of rules and guidelines for structuring MQTT payloads, making it easier to work with data in industrial settings. 

Key features of MQTT Sparkplug include: 

Backfill: Sparkplug allows for messages to be stored in the field and sent up the network during communication outages assuring every data point makes it to its destination.  

Device Registration: Sparkplug facilitates automatic device registration and management, reducing the complexity of onboarding new devices into the network. 

Birth and Death Certificates: It ensures that a device’s status (birth) and the notification of its disconnection (death) are automatically communicated, improving network reliability. 

Payload Definition: Sparkplug defines a standardized format for payloads, making it easier for applications to interpret and act upon the data. 

Quality of Service (QoS)

QoS is an agreement that defines how messages are sent and ensures reliable communication. MQTT allows clients to specify the desired Quality of Service (QoS) level for messages, which controls delivery guarantees.

  • QoS 0 – At Most Once: Messages are sent without acknowledgment, and message loss may occur.
  • QoS 1 – At Least Once: Messages are guaranteed to arrive but may be duplicated. (Brokers will handle this.)
  • QoS 2 – Exactly Once: Messages are delivered exactly once with additional “handshaking” between client and broker.

Session Management in MQTT

Session management is crucial in MQTT for managing connections and tracking message states. MQTT offers various session options:

  • Non-Persistent Session: Requires clients to reconnect and resubscribe upon disconnecting, ideal for simple applications. (Costly on smaller devices.)
  • Persistent Session: Stores session data on the broker, which is useful for devices needing to resume from where they left off. (Client ID, subscription topics, and retained messages)
  • Clean Session: Discards queued messages upon disconnection, suitable for clients that only publish data and don’t need offline storage.

Last Will & Testament (LWT)

LWT is a feature that lets a client notify others if it unexpectedly disconnects, by publishing a predefined message to a specified topic.

Connection Reliability: Keep Alive Mechanism

To maintain connection health, MQTT uses a keep-alive mechanism involving PINGREQ/PINGRESP messages that verify a live connection between client and broker. This feature ensures that clients can detect when a connection is lost.

Test Clients for MQTT Development

Many MQTT test clients are available to help developers simulate device messaging and understand protocol behavior. These clients support testing of publish/subscribe operations, topic structures, QoS settings, and more.

Writing to a Topic

In MQTT, writing to a topic simply involves publishing a message to that topic. Each message contains:

  • Topic name
  • Payload (data)
  • QoS level
  • Optional LWT settings for connection health notifications

AUTOSOL’s solutions are designed to leverage MQTT’s efficient Pub/Sub model, helping industrial enterprises achieve scalable, reliable IoT networks with minimal overhead. Learn how our applications can streamline your IoT integration, maximize data availability, and enhance connectivity across your ecosystem. In addition, AUTOSOL offers MQTT Training through our AUTOSOL Academy.

Register for Training

MQTT 101
Dive into the fundamentals of MQTT and Sparkplug B with our MQTT 101, designed to provide a comprehensive understanding of this critical protocol for IIoT applications. Priced at $1,000, this one-day class involves interactive learning and real-world scenarios, empowering you to leverage MQTT for scalable and efficient industrial automation.

Heading to AUTOSOL?

If you are attending a training session at AUTOSOL’s Houston campus, we’ve compiled some helpful links to accommodations and local attractions to see during your visit.

Houston Visitor Information

Accommodations

Candlewood Suites Clear Lake
281-461-3060
www.candlewoodsuites.com
2737 Bay Area Blvd. Houston, TX
Distance: .5 miles

Residence Inn by Marriott
281-486-2424
www.residenceinn.com
525 Bay Area Blvd. Houston, TX
Distance: 1.7 miles

Hilton Houston NASA Clear Lake
281-333-9300
www.hilton.com
3000 NASA Road One Houston, TX
Distance: 3.4 miles

Towneplace Suites by Marriott
281-286-2132
www.towneplace.com
1050 Bay Area Blvd. Houston, TX
Distance: 1.3 miles

Hampton Inn
281-332-7952
www.hamptoninn.com
506 Bay Area Blvd. Houston, TX
Distance: 1.7 miles

South Shore Harbour Resort
281-334-1000
www.sshr.com
2500 S. Shore Blvd. League City, TX
Distance: 7 miles

Extended Stay Johnson Space Center
281-333-9494
www.extendedstayhotels.com
1410 Nasa Rd. 1 Houston, TX
Distance: 1.3 miles

Comfort Inn
281-554-5400
www.comfortinn.com
16931 N. Texas Ave Webster, TX
Distance: 3 miles

Points of Interest

Baybrook Mall | Clear Lake Recreation Space | NASA Space Center Houston | Kemah Boardwalk | University of Houston – Clear Lake | San Jacinto Battleground Monument | Galveston Beach

houston