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 #52 background imageLoading...
Page #52 background image
XBee connection examples Get started with CoAP
Digi XBee3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
52
n Method: GET
n URI: example
n Given message token: test
1.
Click the Consoles working mode button on the toolbar to add a customized packet.
2.
From the AT console, click the Add new packet button in the Send packets dialog. The
Add new packet dialog appears.
3. Click the HEX tab and type the name of the data packet: GET_EXAMPLE.
4. Copy and past the following text into the HEX input tab:
44 01 C4 09 74 65 73 74 B7 65 78 61 6D 70 6C 65
This is the CoAP protocol message decomposed by bytes to perform a GET request on an
example URI with a token test.
5. Click Add packet.
6.
Click the Open button .
7. Click Send selected packet. The message is sent to the public CoAP server configured in
Configure the device. A response appears in the Console log. Blue text is the query, red text is
the response.
The payload is Get to uri: example, which specifies that this is a successful CoAP GET to URI end
example, which was specified in the query.
Click the Close button to terminate the serial connection.
Example: use Python to generate a CoAP message
This example illustrates how the CoAP protocol can perform GET/POST/PUT/DELETE requests
similarly to the HTTP protocol and how to do this using the XBee Smart Modem. In this example, the
XBee Smart Modem talks to a CoAP Digi Server. You can use this client code to provide an abstract
wrapper to generate a CoAP message that commands the XBee Smart Modem to talk to the remote
CoAP server.
Note It is crucial to configure the XBee Smart Modem settings. See Configure the device and follow
the steps. You can target the IP address to a different CoAP public server.
1. Install Python 2.7. The Installation guide is located at: python.org/downloads/.
2. Download and install the CoAPthon library in the python environment from
pypi.python.org/pypi/CoAPthon.
3. Download these two .txt files: Coap.txt and CoapParser.txt. After you download them, open the
files in a text editor and save them as .py files.
4. In the folder that you place the Coap.py and CoapParser.py files, press Shift + right-click and
then click Open command window.
5. At the command prompt, type python Coap.py and press Enter to run the program.
6. Type the USB port number that the XBee Smart Modem is connected to and press Enter. Only
the port number is required, so if the port is COM19, type 19.

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