XBee connection examples Get started with MQTT
Digi XBee3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
58
12. Enter the name of the data packet. Name the packet connect_frame or something similar.
13. Click the HEX input tab and type the following (these values are the same values from the
table in Example: MQTT connect):
10 10 00 04 4D 51 54 54 04 02 00 3C 00 04 44 49 47 49
14. Click Add packet. The new packet appears in the Send packets list.
15. Click the packet in the Send packets list.
16. Click Send selected packet.
17. A CONNACK packet response from the broker appears in the Console log. This is a connection
acknowledgment; a successful response should look like this:
You can verify the response from the broker as a CONNACK by comparing it to the structure of a
CONNACK packet in the MQTT documentation, which is available at http://docs.oasis-
open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718081).
Example: send messages (publish) with MQTT
A basic Python example of a node publishing (sending) a message is:
mqttc = mqtt.Client("digitest") # Create instance of client with client ID
“digitest”
mqttc.connect("m2m.eclipse.org", 1883) # Connect to (broker, port,
keepalive-time)