XBee connection examples
Get started with MQTT
Digi XBee3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
56
Description
Hex value
byte 1
Length MSB (0)
0x00
byte 2
Length LSB (4)
0x04
byte 3
(M)
0x4D
byte 4
(Q)
0x51
byte 5
(T)
0x54
byte 6
(T)
0x54
Protocol level
byte 7
Level (4)
0x04
Connect flags
byte 8
CONNECT flags byte, see the table below for the bits.
0X02
Keep alive
byte 9
Keep Alive MSB (0)
0X00
byte 10
Keep Alive LSB (60)
0X3C
Client ID
byte 11
Length MSB (0)
0x00
byte 12
Length LSB (4)
0x04
byte 13
(D)
0x44
byte 14
(I)
0x49
byte 15
(G)
0x47
byte 16
(I)
0x49
The following table describes the fields in the packet:
Field name
Description
Protocol Name The connect packet starts with the protocol name, which is MQTT. The length of
the protocol name (in bytes) is immediately before the name itself.
Protocol Level
Refers to the version of MQTT in use, in this case a value of 4 indicates MQTT
version 3.1.1.
Connect Flags
Indicate certain aspects of the packet. For simplicity, this example only sets the
Clean Session flag, which indicates to the client and broker to discard any previous
session and start a new one.
Keep Alive
How often the client pings the broker to keep the connection alive; in this example
it is set to 60 seconds.