— Blogs —
—Products—
WhatsApp:+8615367865107
Address:Room 102, District D, Houhu Industrial Park, Yuelu District, Changsha City, Hunan Province, China
Product knowledge
Time:2021-12-26 12:32:03 Popularity:833
What is the difference between MQTT protocol and Modbus protocol
IoT gateway protocol MQTT and Modbus: Local protocol Modbus for short-distance device connection and extensible Internet protocol "Message Queuing Telemetry Transmission (MQTT)" that supports the Internet of Things for global communication. What is the difference between the two gateway protocols.
Modbus protocol
Modbus has evolved into a comprehensive set of protocols supporting multiple physical links (such as RS-485). The core of Modbus is a serial communication protocol, using master-slave mode. The host sends a request to the slave, and the slave responds. In a standard Modbus network, there is one master and a maximum of 247 slaves (however, if 2-byte addressing is used, this limit can be significantly increased).
MQTT
With RS-485, the communication between the master and the slave occurs in the frame indicating the function code. The function code can identify the function to be operated, such as reading independent input; reading first-in first-out queue; or executing diagnostic function. Then, the slave responds according to the received function code. The response is relatively simple and is indicated by a set of bytes. Therefore, the slave can be a smart device or a simple device with only one sensor.
From this description, you can see that the Modbus protocol is very simple, but its openness as a protocol makes it the actual communication protocol for the entire industry or SCADA system.
message queue telemetry transmission
MQTT is an open and lightweight machine-to-machine protocol, designed for IoT interaction. The MQTT network contains an MQTT broker, which is responsible for coordinating the interaction between MQTT brokers. The agent is a publisher, responsible for publishing information for users.
MQTT has very few requirements because it is designed for embedded devices with limited resources. In addition to occupying less space, MQTT can also provide excellent communication efficiency (even through a low-bandwidth network for communication) and very little overhead (compared to protocols such as HTTP). In 3G networks, the throughput speed of MQTT is 93 times that of Representational State Transfer (REST) using HTTP.
MQTT can use the least method to indicate the operation to be implemented on a specific topic, and then implement the publish/subscribe model. The agent first connects to the broker, and then publish or subscribe to the topic. Upon completion, the agent will be disconnected from the broker. MQTT method definition:
MQTT
Connection-Establish a connection with the MQTT broker.
Disconnect-Disconnect the connection with the MQTT broker.
Publish – Publish topics on MQTT brokers.
Subscribe-Subscribe to topics from MQTT brokers.
Unsubscribe-Unsubscribe the topic from the MQTT broker.
MQTT allows the definition of quality of service (QoS). There are three levels of QoS in MQTT:
QoS 0. This rating means "at most once" delivery (best case). The news will not be confirmed, so this is a once-and-for-all method.
QoS 1. This rating means "at least once" delivery. The user may get the message more than once, but the person allowed to receive it confirms that it has been received.
QoS 2. The slowest but most guaranteed service quality level is level 2. QoS 2 means "only once" and includes a four-stage delivery handshake. This level is the slowest, but the safest.
The QoS level you choose will depend on the importance of the data and its delivery.
MQTT and Modbus can complement each other to improve the performance of the Internet of Things. Using Modbus as a local interface to manage devices, and using MQTT as a global protocol to expand the range of devices, both have played an important role.
Related recommendations
Sensors & Weather Stations Catalog
Agriculture Sensors and Weather Stations Catalog-NiuBoL.pdf
Weather Stations Catalog-NiuBoL.pdf
Agriculture Sensors Catalog-NiuBoL.pdfRelated products
Screenshot, WhatsApp to identify the QR code
WhatsApp number:+8615367865107
(Click on WhatsApp to copy and add friends)