A deep dive into the pros and cons of using MQTT for IoT Applications
top of page
Writer's pictureAmar M

A deep dive into the pros and cons of using MQTT for IoT Applications

MQTT (Message Queuing Telemetry Transport) is a popular protocol built on TCP for lightweight M2M (Machine-to-Machine) communication. It has become a standard choice in IoT applications due to its simplicity, efficiency, and ease of implementation. We've had a great deal of experience working with both UDP and MQTT and wanted to share our experiences with MQTT.


Section 1: Core Advantages of MQTT

1.1 Lightweight Protocol

MQTT is designed to use low bandwidth and provide reliable message delivery even in high latency or unreliable networks. The protocol’s small header size and the keep-alive mechanism make it a great fit for IoT applications where bandwidth and battery power are often constrained.


1.2 Quality of Service Levels

QOS or Quality of Service levels is a feature of MQTT where you can decide how reliable you want the communication to be.

MQTT offers three Quality of Service (QoS) levels for message delivery:

0: The message is delivered at most once, delivery is not confirmed.

1: The message is delivered at least once, delivery is confirmed.

2: The message is delivered exactly once by using a four-step handshake.

These QoS levels allow for tailored message delivery guarantees based on the use-case requirements.


1.3 Last Will and Testament (LWT) Feature

The Last Will and Testament (LWT) feature allows a client to specify a “last will” message sent by the broker on its behalf in case it gets disconnected unexpectedly. This feature is vital in ensuring that other clients are informed about the disconnection, which can be crucial in monitoring and alert systems.


Now lets look at some of the major limitations of MQTT when it comes to low power IoT applications.


Section 2: Limitations of MQTT for low-power IoT applications

2.1 Too many configurable options

MQTT gives us a lot of options when it comes to authentication via username, password or x.509 certificates but along with the authentication, there are a lot of different types of configurations that are minute but can cause errors in transmission that are extremely hard to understand why it happens.


Especially when dealing with BG96, where everything has to be a configuration, as a manufacturer it gets extremely complicated to support different MQTT servers with various settings. We tried to simplify these and have default configurations for major vendors but every now and then we encounter issues due to some edge case like one firmware version of BG96 couldn't parse the certificate chain for TLS from certain MQTT servers.


2.2 Battery life and data consumption

When dealing with low-power battery operated devices, they are usually asleep for most of the time and wake up to transmit at regular intervals. Modems are usually the biggest cause of battery drain so they are completely turned off while the device is asleep. This means, we have to initiate the MQTT connection everytime the device wakes up which causes a lot of battery and network overhead. While MQTT provides a lot of flexibility, in scenarios like these it may not be the ideal choice.


2.3 Security Concerns

MQTT’s standard specification doesn’t include a defined security mechanism, thus relying on the underlying network’s security. This may necessitate additional security layers such as SSL/TLS for encrypted communication. If the vendor does not have a private SIM network and does not implement SSL, all communication will be in plain text.


2.4 Lack of Built-in Error Handling

As mentioned in the first point, there is no error handling mechanism when you have an issue. A lot of steps must be performed with trial and error to diagnose the issue.


2.5 Scalability Challenges

As the number of connected devices grows, there may be scalability challenges due to increased message traffic and the need for more robust broker solutions to handle a high number of concurrent connections. Services like EMQX and AWS IoT Core offer fully managed serverless solutions to solve part of the challenge but it comes at the cost of vendor lock-in.


Section 3: Comparing MQTT with Other Protocols

Protocols like customised UDP, CoAP (Constrained Application Protocol), HTTP (Hypertext Transfer Protocol), and WebSockets also serve the IoT ecosystem. CoAP, for instance, is designed for use in constrained environments and offers features like multicast support which MQTT lacks. HTTP and WebSockets, on the other hand, are more common in web services but might not be as efficient as MQTT in terms of bandwidth usage and latency in certain IoT scenarios.


There are other protocols entering the market like HTTP/3 with QUIC that are promising to make the web better which in turn also makes IoT communications better.


Section 4: Future of MQTT in IoT

The MQTT standards are evolving with the advent of MQTT 5.0, which brings in new features like enhanced authentication, shared subscriptions, and better error reporting, making it even more suitable for a broader range of IoT applications.


Wirepas an industrial mesh network uses MQTT as the protocol of choice for all the communications between the gateway and application server.


Conclusion

Like with any technology, MQTT has its advantages and disadvantages. If you are looking for a stateful connection that transmits data in milliseconds, it is the best choice but for battery operated devices that have to reinitate a connection everytime they wake up, you may find UDP or simple HTTP with TLS to be more efficient.


Hopefully, with this article, we've shed some light on the protocol so you may be better informed to choose the correct option for your IoT application. Our experts are available and happy to discuss and suggest a better choice for your application. Use the Contact Us page to get in touch or write to us on info@ellenex.com

1,597 views
ellenex logo - Industrial Iot Solution
order iot product
ellenex linkedin
ellenex x contact
ellenex youtube
ellenex contact
ellenex facebook
INSTAGRAM ELLENEX

© 2024 Ellenex Corporation 

Don't Settle for Less ...

Supported Networks:

 

Products:

Industries:

ellenex NB IoT
ellenex lorawan
ellenex satellite
ellenex LTE Cat M1
ellenex wirepas
hvac monitoring
water monitoring
diesel tank monitoring
differential pressure sensor
well monitoring
wireless sensor
ellenex-github
wireless pressure sensor
wireless level
wireless remperature
smart meter
ellenex water quality sensors ph conductivity turbidity dissolved oxygenedited
ellenex IoT moisture rain and humidity sensors
iot product
iot solution
ellenex%20other%20products_edited_edited
  • Air Compressor Operation Monitoring

  • Asset Cathodic Protection Monitoring

  • Asset Temperature Monitoring

  • Boilers Pressure and Temperature Monitoring

  • Building Structural Health Monitoring

  • Chemical Tanks Level Monitoring

  • Data Centre and Clean Room Pressure Monitoring

  • Diesel Delivery Management

  • Differential Pressure Monitoring

  • Dump Truck Overload and Operation Monitoring

  • Dust Collection System Monitoring

  • Farm Fish Operation Monitoring

  • Flood Monitoring

  • Frozen Food Delivery Management

  • Grain Silo Level Monitoring

  • HVAC Air Filter Performance Monitoring

  • HVAC Airflow Monitoring

  • Hydraulic Systems Overload Monitoring

  • Industrial Gas Cylinders Level Monitoring

  • Industrial Water Meters Digitalisation

  • Land Movement Monitoring

  • Liquid Storage Tank Level Monitoring

  • Manhole Blockage Monitoring

  • Milk Tank Level Monitoring

  • Negative Pressure Monitoring

  • Operational System Digitalisation

  • Pipe Temperature and Pressure Monitoring

  • Pump Pressure Monitoring

  • Rain Level Monitoring

  • Remote Diesel Tank Level Monitoring

  • Soil Moisture Monitoring

  • Trucks Overload Monitoring

  • Underground Water Pipeline Pressure Monitoring

  • Waste Liquid Delivery Management

  • Wastewater Pipe Pressure Monitoring

  • Water Filter Performance Monitoring

  • Water Quality Monitoring

  • Water Supply Monitoring

  • Water Tank Level Monitoring

  • Water Wells Level Monitoring

Key pre-configured Industrial IoT solutions

Main Industrial IoT Sensors: 

  • PTS2: Industrial Pressure (0.2bar to 1,000bar)

  • PTC2: Corrosive Resistant Pressure

  • PTD2: Pressure Sensor with Built-in Temperature Sensor

  • PTDH2: High Temperature Pressure and Temperature Sensor

  • PTG2: Pressure with Built-in GPS

  • PTS3: IP68 Pressure Sensor

  • PTF2: Flush Type Pressure Sensor

  • PTF2: Thich film Flush type Pressure

  • PTE2: Earth Pressure Sensor

  • PDS2: Industrial Differential Pressure Sensor

  • PDG2: DP with Built-in GPS

  • PDT2: Ultra Low Range Air Pressure and Temperature

  • PLS2: Submersible Level (1m to 200m range)

  • PLC2: Corrosive Resistant Level (Titanium)

  • PLD2: Level Sensor with Built-in Temperature

  • PLG2: Level Sensor with Built-in GPS

  • PLS3: Submersible Level Sensor with IP68 Housing

  • PLM2: Well Level Sensor (15.8mm Sensor Head, 2in Housing)

  • PLMD2: Well Level and Temperature Sensor

  • TTS2: Industrial Temperature Sensor

  • TTG2: Temperature Sensor with Built-in GPS

  • TTS3: Temperature Sensor with IP68 housing

  • TTS2: Pipe Temperature Sensor

  • DUS3: IP68 Ultrasonic Level Sensor

  • DRC3: IP68 Corrosive Radar Sensor (8m and 30m range)

  • FMS2: Industrial Water Meter Interface

  • CSD2: Conductivity Salinity and Temperature sensor

  • CTR2: Turbidity and Temperature Sensor

  • CPH2: pH, ORP and Temperature Sensor

  • CDO2: Dissolved Oxygen and Temperature Sensor

  • MSS2: Soil Moisture Sensor

  • MAS2: Outdoor Humidity Sensor

  • MRS2: Rain Sensor (Tipping bucket)

  • ECP2: Cathodic Protection Sensor

  • RS1-4/20: Single channel 4-20mA Interface

  • RS1-P: Single channel Pulse Interface

  • RS1-SDI: Single channel SDI-12 Interface

  • RS1-M: Single channel Modbus Interface

  • RS1-Pt: Single channel Pt100 Interface

  • RM1: Multi-channel Interface

  • RM4-4/20: Multi-channel Interface (4 x 4-20mA Sensor)

  • RM4-Pt: Multi-channel Interface (4 x Pt Sensor)

  • RM4-M: Multi-channel Interface (4 x Modbus)

  • RM4-mV: Multi-channel Interface (4 x mV Sensors)

  • RM4-Pulse: Multi-channel Interface (4 x Pulse Counter)

  • RM4-0/10: Multi-channel Interface (4 x 0-10V Sensor)

bottom of page