Digi XB3-C-A2-UT series User Manual page 38

Smart modem
Table of Contents

Advertisement

Getting started with the XBee Smart Modem Development Kit
The thread that reads the serial port forwards any data received onward to the client socket, and the
thread reading the client socket forwards any data received onward to the serial port. This is
represented in the figure above.
The proxy script needs to be running before running an MQTT publish or subscribe script.
1. With the proxy script running, run the subscribe example from
(subscribe) with
1883, 60) to client.connect("127.0.0.1", port=17300, keepalive=20). This connects the
MQTT client to the proxy script, which in turn connects to a broker via the XBee Smart
Modem's internet connection.
2. Run the publish example from
instance (while the publish script is running you will have three Python scripts running at the
same time).
The publish script runs over your computer's normal internet connection, and does not use the XBee
Smart Modem. You are able to see your published message appear in the subscribe script's output
once it is received from the broker via the XBee Smart Modem. If you watch the output of the proxy
script during this process you can see the receptions and transmissions taking place.
The proxy script must be running before you run the subscribe and publish scripts. If you stop the
subscribe script, the socket closes, and the proxy script shows an error. If you try to start the proxy
script after starting the subscribe script, you may also see a socket error. To avoid these errors, it is
best to start the scripts in the correct order: proxy, then subscribe, then publish.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
MQTT, but change the connect line from client.connect("m2m.eclipse.org",
Example: send messages (publish) with MQTT
Get started with MQTT
Example: receive messages
in a third Python
38

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the XB3-C-A2-UT series and is the answer not in the manual?

This manual is also suitable for:

Xbee3 cellular lte-m

Table of Contents