Page 53 of 57
King Pigeon Hi-Tech. Co., Ltd.
Ver 3.0
GSM/SMS/GPRS/3G/4G
Cellular IoT M2M RTU
10.MQTT Protocol
MQTT
Introduction to MQTT
MQTT is a client-server based message publish/subscribe transfer protocol. The MQTT protocol is lightweight,
simple, open, and easy to implement. These characteristics make it applicable to a wide range. In many cases,
including restricted environments, such as: machine-to-machine (M2M) communication and Internet of
Things (IoT). It has been widely used in communication sensors via satellite links, occasionally dialed medical
devices, smart homes, and some miniaturized devices. The MQTT protocol runs on TCP/IP or other network
protocols and provides orderly, lossless, bidirectional connections.
MQTT implementation principle
There are three kinds of identities in the MQTT protocol: publisher (Publish), broker (Broker) (server), and
subscriber (Subscribe). Among them, the publisher and subscriber of the message are both clients, the
message broker is the server, and the message publisher can also be a subscriber. Take S27X connected to King
Pigeon cloud 2.0 platform as an example:
When the device publish I/O point data:
Publisher
S27X
Broker(King
Pigeon Cloud2.0)
Subscriber
(account)
Publish
Subcribe
Publish
When the customer control the device:
Subscriber
(account)
Broker(King
Pigeon Cloud2.0)
Subscriber
(S27X)
Publish
Subcribe
Publish
Configuration:
Domain
:(
King Pigeon Cloud 2.0 default:mqtt.dtuip.com
)
Server Port :
Broker Server Port number
(
King Pigeon Cloud 2.0 default:1883
)
Subscribe topic:
Client subscribe topic
(
King Pigeon Cloud 2.0 default:login m
)
Publish topic:
Device publish data topic
(
King Pigeon Cloud 2.0 default:login message
)
MQTT Client ID:
The unique identity of the device, which can be a serial number, device ID, or IMEI(King
Pigeon Cloud 2.0 default is serial number)
MQTT user name:
Device's account on the broker server (King Pigeon Cloud 2.0 default is MQTT)
MQTT password:
Password of device's account on the broker server(King Pigeon Cloud 2.0 default is
MQTTPW)
After the configuration is complete, the client will initiate a connection to the server: