EasyManuals Logo
Home>Digi>Modem>XBee3 XB3M1

Digi XBee3 XB3M1 User Manual

Digi XBee3 XB3M1
252 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #63 background imageLoading...
Page #63 background image
XBee connection examples Debugging
Digi XBee3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
63
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 Example: receive messages
(subscribe) with MQTT, but change the connect line from client.connect("m2m.eclipse.org",
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 Example: send messages (publish) with MQTT in a third Python
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.
Debugging
If you experience problems with the settings in the examples, you can load the default settings in
XCTU.
Note If you load the default settings, you will need to reapply any configuration settings that you have
previously made.
1.
On the Configuration toolbar, click the Default button to load the default values
established by the firmware, and click Yes to confirm.
2. Factory settings are loaded but not written to the device. To write them, click the Write button
on the toolbar.
Software libraries
One way to communicate with the XBee device is by using a software library. The libraries available
for use with the XBee Smart Modem include:
n XBee Java library
n XBee Python library
The XBee Java Library is a Java API. The package includes the XBee library, its source code and a
collection of samples that help you develop Java applications to communicate with your XBee devices.
The XBee Python Library is a Python API that dramatically reduces the time to market of XBee
projects developed in Python and facilitates the development of these types of applications, making it
an easy process.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Digi XBee3 XB3M1 and is the answer not in the manual?

Digi XBee3 XB3M1 Specifications

General IconGeneral
BrandDigi
ModelXBee3 XB3M1
CategoryModem
LanguageEnglish

Related product manuals