Digi XB3M1 User Manual

Digi XBee3® Cellular LTE-M
Smart Modem
User Guide
Revision history—900002258
Revision Date Description
A
December 2017 Initial release of the document.
Trademarks and copyright
© 2017 Digi International Inc. All rights reserved.
Disclaimers
Information in this document is subject to change without notice and does not represent a commitment on the part of Digi International. Digi provides this document “as is,” without warranty of any kind, expressed or implied, including, but not limited to, the implied warranties of fitness or merchantability for a particular purpose. Digi may make improvements and/or changes in this manual or in the product(s) and/or the program(s) described in this manual at any time.
Warranty
To view product warranty information, go to the following website:
www.digi.com/howtobuy/terms
Send comments
Documentation feedback: To provide feedback on this document, send your comments to
techcomm@digi.com.
Customer support
Digi Technical Support: Digi offers multiple technical support plans and service packages to help our
customers get the most out of their Digi product. For information on Technical Support plans and pricing, contact us at +1 952.912.3444 or visit us at www.digi.com/support.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
2
Contents
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
Applicable firmware and hardware 9 SIM cards 9
Getting started with the XBee Smart Modem Development Kit
Identify the kit contents 11 XBIB-U-DEV reference 12 Cellular service 13 Connect the hardware 14 Configure the device using XCTU 15
Add a device 15 Check for cellular registration and connection 16 Update to the latest firmware 16
Send an SMS message to a phone 18
Debugging 19
Connect to the ELIZA server 20
Debugging 21
Connect to the echo server 22
Debugging 23
Connect to the Daytime server 24
Debugging 25
Connect to a TCP/IP address 26
Debugging 27
Perform a (GET) HTTP request 28
Debugging 29
Get started with MQTT 30
Example: MQTT connect 30 Send a connect packet 32 Example: send messages (publish) with MQTT 34 Example: receive messages (subscribe) with MQTT 34 Use MQTT over the XBee Cellular Modem with a PC 35
Get started with CoAP 39
CoAP terms 39 CoAP quick start example 39 Configure the device 40 Example: manually perform a CoAPrequest 40 Example: use Python to generate a CoAP message 41
Configure the XBee Smart Modem using Digi Remote Manager 44
Create a Remote Manager account 44
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
3
Get the XBee Smart Modem IMEI number 44 Add a XBee Smart Modem to Remote Manager 44 Update the firmware 45
Software libraries 45
Get started with MicroPython
About MicroPython 47
Why use MicroPython 47 MicroPython on the XBee Smart Modem 47 Use XCTU to enter the MicroPython environment 47 Use the MicroPython Terminal in XCTU 48 Example: hello world 48 Example: turn on an LED 48 Example: code a request help button 49
Enter MicroPython paste mode 50
Catch a button press 50
Send a text (SMS) when the button is pressed 52
Add the time the button was pressed 53 Exit MicroPython mode 54 Other terminal programs 54
Tera Term for Windows 54 Use picocom in Linux 55
Technical specifications
Interface and hardware specifications 58 Cellular RF characteristics 58 Bluetooth RF characteristics 58 Cellular Networking specifications 58 Power requirements 59 Power consumption 59 Electrical specifications 59 Regulatory approvals 60
Hardware
Mechanical drawings 62 Pin signals 62
Pin connection recommendations 64 RSSI PWM 64 SIM card 64 The Associate LED 65
Antenna recommendations
Antenna placement 67
Design recommendations
Power supply considerations 69 Minimum connection diagram 69
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
4
Heat considerations and testing 69 Heat sink guidelines 71
Bolt-down style 71
Adhesive style heat sink 71 Add a fan to provide active cooling 72
Cellular connection process
Connecting 74 Cellular network 74 Data network connection 74 Data communication with remote servers (TCP/UDP) 74 Disconnecting 74
Modes
Select an operating mode 77 Transparent operating mode 78 API operating mode 78 Bypass operating mode 78
Enter Bypass operating mode 78
Leave Bypass operating mode 79
Restore cellular settings to default in Bypass operating mode 79 USB direct mode 79
Configure the data pins 79
Enable USB direct mode 79
Enable the VBUS option 80 Command mode 80
Enter Command mode 80
Send AT commands 81
Apply command changes 81
Make command changes permanent 81
Exit Command mode 82
Sleep modes
About sleep modes 84 Normal mode 84 Pin sleep mode 84 Cyclic sleep mode 84 Cyclic sleep with pin wake up mode 84 Airplane mode 84 SPI mode and sleep pin functionality 84 The sleep timer 85 MicroPython sleep behavior 85
Serial communication
Serial interface 88 Serial data 88 UART data flow 88 Serial buffers 89 CTS flow control 89
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
5
RTS flow control 89 Enable UART or SPI ports 89
SPI operation
SPI communications 92 Full duplex operation 93 Low power operation 94 Select the SPI port 94 Force UART operation 95 Data format 95
AT commands
Special commands 97
AC (Apply Changes) 97
FR (Force Reset) 97
RE command 97
WR command 97 Cellular commands 98
PH (Phone Number) 98
S# (ICCID) 98
IM (IMEI) 98
MN (Operator) 98
MV (Modem Firmware Version) 99
DB (Cellular Signal Strength) 99
AN (Access Point Name) 99
AM (Airplane Mode) 99 Network commands 100
IP (IP Protocol) 100
TL (SSL/TLS Protocol Version) 100
TM (IP Client Connection Timeout) 100
TS (IP Server Connection Timeout) 101
DO (Device Options) 101
EQ (Device Cloud FQDN) 102 Addressing commands 102
SH (Serial Number High) 102
SL (Serial Number Low) 102
MY (Module IP Address) 102
P# (Destination Phone Number) 103
N1 (DNS Address) 103
N2 (DNS Address) 103
DL (Destination Address) 103
OD (Operating Destination Address) 104
DE (Destination Port) 104
C0 (Source Port) 104
LA (Lookup IP Address of FQDN) 105 Serial interfacing commands 105
BD (Baud Rate) 105
NB (Parity) 106
SB (Stop Bits) 106
RO (Packetization Timeout) 106
TD (Text Delimiter) 107
FT (Flow Control Threshold) 107
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
6
AP (API Enable) 107 I/O settings commands 107
D0 (DIO0/AD0) 108
D1 (DIO1/AD1) 108
D2 (DIO2/AD2) 108
D3 (DIO3/AD3) 109
D4 (DIO4) 109
D5 (DIO5/ASSOCIATED_INDICATOR) 110
D6 (DIO6/RTS) 110
D7 (DIO7/CTS) 110
D8 (DIO8/SLEEP_REQUEST) 111
P0 (DIO10/PWM0 Configuration) 112
P1 (DIO11/PWM1 Configuration) 112
P2 (DIO12 Configuration) 113
P3 (DIO13/DOUT) 113
P4 (DIO14/DIN) 113
PD (Pull Direction) 114
PR (Pull-up/down Resistor Enable) 114
M0 (PWM0 Duty Cycle) 115 I/O sampling commands 115
TP (Temperature) 115 Sleep commands 116
SM (Sleep Mode) 116
SP (Sleep Period) 116
ST (Wake Time) 116 Command mode options 117
CC (Command Sequence Character) 117
CT (Command Mode Timeout) 117
GT (Guard Times) 117 MicroPython commands 117
PS (Python Startup) 118
PY (MicroPython Command) 118 Firmware version/information commands 119
VR (Firmware Version) 119
VL (Verbose Firmware Version) 119
HV (Hardware Version) 119
AI (Association Indication) 119
DI (Device Cloud Indicator) 120
CI (Protocol/Connection Indication) 120
HS (Hardware Series) 122
CK (Configuration CRC) 122 Execution commands 122
!R (Modem Reset) 122
IS (Force Sample) 123
Operate in API mode
API mode overview 125 Use the AP command to set the operation mode 125 API frame format 125
API operation (AP parameter = 1) 125
API operation with escaped characters (AP parameter = 2) 126 Frame descriptions 129
AT Command - 0x08 129
AT Command: Queue Parameter Value - 0x09 130
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
7
Transmit (TX) Request: IPv4 - 0x20 131
AT Command Response - 0x88 132
Transmit (TX) Status - 0x89 133
Modem Status - 0x8A 134
Receive (RX) Packet: IPv4 - 0xB0 135
Socket behavior
Supported sockets 137 Socket timeouts 137 Socket limits in API mode 137 Enable incoming TCP sockets in API mode 137 API mode behavior for outgoing TCP and SSL connections 137 API mode behavior for outgoing UDP data 138 API mode behavior for incoming TCP connections 138 API mode behavior for incoming UDP data 139 Transparent mode behavior for outgoing TCP and SSL connections 139 Transparent mode behavior for outgoing UDP data 139 Transparent mode behavior for incoming TCP connections 140 Transparent mode behavior for incoming UDP connections 140
Troubleshooting
Cannot find the serial port for the device 142
Condition 142
Solution 142 Correct a macOS Java error 144
Condition 144
Solution 144 Unresponsive cellular component in Bypass mode 145
Condition 145
Solution 145 Syntax error at line 1 145
Solution 145 Network connection issues 145
Condition 145
Solution 145
Set the APN value 145
Regulatory information
United States (FCC) 148
OEM labeling requirements 148
FCC notices 148
FCC-approved antennas 149
RF exposure 150 IC (Industry Canada) 150
Labeling requirements 150
RF Exposure 150
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
8

Digi XBee3 Cellular LTE-M Global Smart Modem User Guide

The XBee Smart Modem provides OEMs with a simple way to integrate low-power cellular connectivity into their devices. Features include:
n FCC certified and carrier end-device certified
n Excellent coverage and building penetration
n Digi XBee Transparent and API modes simplify design
n Low power consumption optimized for long battery life
n Reduced hardware complexity with only 1 antenna required
n Integrated MicroPython programmability enables custom scripting directly on the modem
n Enhanced with Digi TrustFence™ security framework
n Manage and configure with XCTU and Digi Remote Manager®
n Available with Digi provided SIM cards and data plans

Applicable firmware and hardware

This manual supports the following firmware:
n 311xx
It supports the following hardware:
n XB3-C-A2-UT-xxx

SIM cards

The XBee Smart Modem requires a 4FF (Nano) size SIM card. The SIM interface supports both 1.8 V and 3 V SIM types.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
9

Getting started with the XBee Smart Modem Development Kit

This section describes how to connect the hardware in the XBee Smart Modem Development Kit, and provides some examples you can use to communicate with the device.
Identify the kit contents 11 XBIB-U-DEV reference 12 Cellular service 13 Connect the hardware 14 Configure the device using XCTU 15 Send an SMS message to a phone 18 Connect to the ELIZA server 20 Connect to the echo server 22 Connect to the Daytime server 24 Connect to a TCP/IP address 26 Perform a (GET) HTTP request 28 Get started with MQTT 30 Get started with CoAP 39 Configure the XBee Smart Modem using Digi Remote Manager 44 Software libraries 45
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
10
Getting started with the XBee Smart Modem Development Kit Identify the kit contents

Identify the kit contents

The Developer's kit includes the following:
One XBIB-U-DEV board
One 12 V power supply
One cellular antenna with U.FL connector
One Bluetooth Low Energy (BLE) antenna (BLE support is forthcoming but not currently available)
One USB cable
One XBee Smart Modem
One SIMcard
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
11
Getting started with the XBee Smart Modem Development Kit XBIB-U-DEV reference

XBIB-U-DEV reference

This picture shows the XBee USB development board and the table that follows explains the callouts in the picture.
Number Item Description
1 Programmingheader Header used to program XBee Programmable devices.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
12
Getting started with the XBee Smart Modem Development Kit Cellular service
Number Item Description
2 Self power module
3 Current testing Depopulating R31 allows a current probe to be inserted across P6
4 Loopback jumper Populating P8 with a loopback jumper causes serial transmissions
5 DC barrel plug: 6-20V Greater than 500 mA loads require a DC supply for correct
6 LED indicator
7 USB
8 RSSI indicator
Advanced users only—voids the warranty. Depopulate R31 to power the device using V+ and GND from J2 and J5. You can connect sense lines to S+ and S- for sensing power supplies.
CAUTION: Voltage is not regulated. Applying the incorrect
voltage can cause fire and serious injury.
terminals. The current though P6/R31 powers the device only. Other supporting circuitry is powered by a different trace.
both from the device and from the USB to loopback.
operation. Plug in the external power supply prior to the USB connector to ensure that proper USB communications are not interrupted.
Yellow: Modem sending serial/UART data to host. Green: Modem receiving serial/UART data from host. Red: Associate.
1
9 User buttons Connected to DIO lines for user implementation.
10 Reset button
11 SPI power Connect to the power board from 3.3 V.
12 SPI Only used for surface-mount devices.
13 Indicator LEDs
14 Through-hole XBee
sockets
15 20-pin header Maps to standard through-hole XBee pins.

Cellular service

The XBee Cellular kit includes six months of free cellular service.
1
Powering the board with J2 and J5 without R31 removed can cause shorts if the USB or barrel plug power are connected. Applying too high a voltage destroys electronic circuitry in the device and other board components and/or can cause injury.
DS5: ON/SLEEP DS2: DIO12, the LED illuminates when driven low. DS3: DIO11, the LED illuminates when driven low. DS4: DIO4, the LED illuminates when driven low.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
13
Getting started with the XBee Smart Modem Development Kit Connect the hardware

Connect the hardware

1. The XBee Smart Modem should already be plugged into the XBIB-U-DEV board.
2. The SIMcard should be already be inserted into the XBee Smart Modem. If not, install the
SIMcard into the XBee Smart Modem.
WARNING! Never insert or remove the SIM card while the device is powered!
3. Connect the antennas to the XBee Smart Modem by aligning the U.FL connectors carefully,
then firmly pressing straight down to seat the connector. You should hear a snap when the
antenna attaches correctly. U.FL is fragile and is not designed for multiple insertions, so
exercise caution when connecting or removing the antennas. We recommend using a U.FL
removal tool.
4. Plug the 12 V power supply to the power jack on the development board.
5. Connect the USB cable from a PC to the USB port on the development board. The computer
searches for a driver, which can take a few minutes to install.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
14
Getting started with the XBee Smart Modem Development Kit Configure the device using XCTU

Configure the device using XCTU

XBee Configuration and Test Utility (XCTU) is a multi-platform program that enables users to interact with Digi radio frequency (RF) devices through a graphical interface. The application includes built-in tools that make it easy to set up, configure, and test Digi RF devices.
XCTU does not work directly over an SPI interface.
For instructions on downloading and using XCTU, see the XCTU User Guide.
Note If you are on a macOS computer and encounter problems installing XCTU, see Correct a macOS
Java error.

Add a device

These instructions show you how to add the XBee Smart Modem to XCTU. If XCTU does not find your serial port, see Cannot find the serial port for the device.
Launch XCTU .
1.
Click the Discover radio modules button .
2.
3. In the Discover radio devices dialog, select the serial ports where you want to look for XBee
modules, and click Next.
4. In the Set port parameters window, maintain the default values and click Finish.
5. As XCTU locates radio modules, they appear in the Discovering radio modules dialog box.
If your module could not be found, XCTU displays the Could not find any radio module dialog providing possible reasons why the module could not be added.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
15
Getting started with the XBee Smart Modem Development Kit Configure the device using XCTU

Check for cellular registration and connection

In the following examples, proper cellular network registration and address assignment must occur successfully. The LED on the development board blinks when the XBee Smart Modem is registered to the cellular network; see The Associate LED. If the LEDremains solid, registration has not occurred properly. Registration can take several minutes.
Note Make sure you are in an area with adequate cellular network reception or the XBee Smart
Modem will not make the connection.
In addition to the LED confirmation, you can check the AT commands below in XCTU to check the registration and connection. To view these commands:
1. Open XCTU and Add a device.
Click the Configuration working mode button.
2.
3. Select a device from the Radio Modules list. XCTU displays the current firmware settings for
that device.
On the Configuration toolbar, click the Default button to load the default values
4.
established by the firmware, and click Yes to confirm.
The relevant commands are:
n AI (Association Indication) reads zero when the device successfully registers to the cellular
network. If it reads 0x23 it is connecting to the Internet; 0x22 means it is registering to the
cellular network.
n MY (Module IPAddress) should display a valid IPaddress. If it reads 0.0.0.0, it has not
registered yet.
Note To search for an ATcommand in XCTU, use the search box.

Update to the latest firmware

Firmware is the program code stored in the device's persistent memory that provides the control program for the device. Use XCTU to update the firmware.
Click the Configuration working modes button .
1.
2. Select a local XBee module from the Radio Modules list.
Click the Update firmware button .
3.
The Update firmware dialog displays the available and compatible firmware for the selected
XBee module.
4. Select the product family of the XBee module, the function set, and the latest firmware version.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
16
Getting started with the XBee Smart Modem Development Kit Configure the device using XCTU
5. Click Update. A dialog displays update progress. Click Show details for details of the firmware
update process.
See How to update the firmware of your modules in the XCTU User Guide for more information.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
17
Getting started with the XBee Smart Modem Development Kit Send an SMS message to a phone

Send an SMS message to a phone

The XBee Smart Modem can send and receive Short Message Service (SMS) transmissions (text messages) while in Transparent mode. This allows you to send and receive text messages to and from an SMS capable device such as a mobile phone.
The following table explains the AT commands that you use in this example.
Command Value Description
AP (APIEnable)
IP (IP Protocol)
P#
(DestinationPhone Number)
TD (Text Delimiter)
PH (Module's SIM
phone number)
1. Ensure that the device is set up correctly with the SIM card installed and the antennas
connected as described in Connect the hardware.
2. Open XCTU and Add a device.
Click the Configuration working mode button.
3.
4. Select a device from the Radio Modules list. XCTU displays the current firmware settings for
that device.
0 Set the device's API mode to Transparent mode.
2 Set the expected transmission mode to SMScommunication.
<Target phone number>
D (0x0D)
Read only
The target phone number that you send to, for example, your cellular phone. See P# (Destination Phone Number) for instructions on using this command.
The text delimiter to be used for Transparent mode, as an ASCII hex code. No information is sent until this character is entered, unless the maximum number of characters has been reached. Set to zero to disable text delimiter checking. Set to D for a carriage return.
The value that represents your device's phone number as supplied by the SIM card. This is used to send text messages to the device from another cellular device.
To switch to SMS communication, in the IP field, select 2 and click the Write button .
5.
6. To enter your cell phone number, in the P# field, type the <target phone number> and click
the Write button. Type the phone number using only numbers, with no dashes. You can use the
+ prefix if necessary. The target phone number is the phone number you wish to send a text to.
7. In the TD field, type D and click the Write button.
8. Note the number in the PH field; it is the XBee Smart Modem phone number, which you see
when it sends an SMS to your phone.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
18
Getting started with the XBee Smart Modem Development Kit Send an SMS message to a phone
Click the Consoles working mode button on the toolbar to open a serial console to the
9.
device. For instructions on using the Console, see the AT console topic in the XCTU User Guide.
Click the Open button to open a serial connection to the device.
10.
11. Click in the left pane of the Console log, type hello world and press Enter. The XBee Smart
Modem sends the message to the destination phone number set by the P# command.
12. When the phone receives the text, you can see that the sender's phone number matches the
value reported by the XBee Smart Modem with the PH command.
13. On the phone, reply with the text connect with confidence and the XBee Smart Modem
outputs this reply from the UART.

Debugging

If you experience problems with the settings in this example, you can load the default settings in XCTU:
On the Configuration toolbar, click the Default button to load the default values
1.
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.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
19
Getting started with the XBee Smart Modem Development Kit Connect to the ELIZA server

Connect to the ELIZA server

You can use the XBee Smart Modem to chat with the ELIZA Therapist Bot. ELIZAis an artificial intelligence (AI) bot that emulates a therapist and can perform simple conversations.
The following table explains the AT commands that you use in this example.
At command Value Description
IP (IP Protocol) 1 Set the expected transmission mode to TCP
communications.
DL (Destination Address)
DE (Destination Port) 0x2328 The target port number of the Eliza server.
To communicate with the ELIZA Therapist Bot:
1. Ensure that the device is set up correctly with the SIM card installed and the antennas
connected as described in Connect the hardware.
2. Open XCTU and Add a device.
Click the Configuration working mode button.
3.
4. Select a device from the Radio Modules list. XCTU displays the current firmware settings for
that device.
To switch to TCP communication, in the IP field, select 1 and click the Write button .
5.
6. To enter the destination address of the ELIZATherapist Bot, in the DL field, type 52.43.121.77
and click the Write button.
52.43.121.77 The target IP address of the Eliza server.
7. To enter the destination IP port number, in the DE field, type 2328 and click the Write button.
Click the Consoles working mode button on the toolbar to open a serial console to the
8.
device. For instructions on using the Console, see the AT console topic in the XCTU User Guide.
Click the Open button to open a serial connection to the device.
9.
10. Click in the left pane of the Console log, then type in the Console to talk to the ELIZA Therapist
Bot. The following screenshot provides an example of this chat.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
20
Getting started with the XBee Smart Modem Development Kit Connect to the ELIZA server

Debugging

If you experience problems with the settings in this example, you can load the default settings in XCTU:
On the Configuration toolbar, click the Default button to load the default values
1.
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.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
21
Getting started with the XBee Smart Modem Development Kit Connect to the echo server

Connect to the echo server

This server echoes back the messages you type.
The following table explains the AT commands that you use in this example.
At command Value Description
IP (IP
Protocol)
TD
(Text
Delimiter)
DL
(Destination Address)
DE
(Destination Port)
To communicate with the echo server:
1. Ensure that the device is set up correctly with the SIM card installed and the antennas
connected as described in Connect the hardware.
2. Open XCTU and Add a device.
Click the Configuration working mode button.
3.
4. Select a device from the Radio Modules list. XCTU displays the current firmware settings for
that device.
1 Set the expected transmission mode to TCP communications.
D (0x0D)
52.43.121.77 The target IPaddress of the echo server.
0x2329 The target port number of the echo server.
The text delimiter to be used for Transparent mode, as an ASCII hex code. No information is sent until this character is entered, unless the maximum number of characters has been reached. Set to zero to disable text delimiter checking. Set to D for a carriage return.
To switch to TCP communication, in the IP field, select 1 and click the Write button .
5.
6. To enable the XBee Smart Modem to recognize carriage return as a message delimiter, in the
TD field, type D and click the Write button.
7. To enter the destination address of the echo server, in the DL field, type 52.43.121.77 and click
the Write button.
8. To enter the destination IP port number, in the DE field, type 2329 and click the Write button.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
22
Getting started with the XBee Smart Modem Development Kit Connect to the echo server
Click the Consoles working mode button on the toolbar to open a serial console to the
9.
device. For instructions on using the Console, see the AT console topic in the XCTU User Guide.
Click the Open button to open a serial connection to the device.
10.
11. Click in the left pane of the Console log, then type in the Console to talk to the echo server.
The following screenshot provides an example of this chat.

Debugging

If you experience problems with the settings in this example, you can load the default settings in XCTU:
On the Configuration toolbar, click the Default button to load the default values
1.
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.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
23
Getting started with the XBee Smart Modem Development Kit Connect to the Daytime server

Connect to the Daytime server

The Daytime server reports the current Coordinated Universal Time (UTC) value responding to any user input.
The following table explains the AT commands that you use in this example.
At command Value Description
IP (IP
Protocol)
DL
(Destination Address)
DE
(Destination Port)
TD (Text Delimiter)
To communicate with the Daytime server:
1. Ensure that the device is set up correctly with the SIM card installed and the antennas
connected as described in Connect the hardware.
2. Open XCTU and Add a device.
Click the Configuration working mode button.
3.
4. Select a device from the Radio Modules list. XCTU displays the current firmware settings for
that device.
1 Set the expected transmission mode to TCP communications.
52.43.121.77 The target IP of the Daytime server.
0x232A The target port number of the Daytime server.
0
The text delimiter to be used for Transparent mode, as an ASCII hex code. No information is sent until this character is entered, unless the maximum number of characters has been reached. Set to zero to disable text delimiter checking.
To switch to TCP communication, in the IP field, select 1 and click the Write button .
5.
6. To enter the destination address of the daytime server, in the DL field, type 52.43.121.77 and
click the Write button.
7. To enter the destination IP port number, in the DE field, type 232A and click the Write button.
8. To disable text delimiter checking, in the TD field, type 0 and click the Write button.
Click the Consoles working mode button on the toolbar to open a serial console to the
9.
device. For instructions on using the Console, see the AT console topic in the XCTU User Guide.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
24
Getting started with the XBee Smart Modem Development Kit Connect to the Daytime server
Click the Open button to open a serial connection to the device.
10.
11. Click in the left pane of the Console log, then type in the Console to query the Daytime server.
The following screenshot provides an example of this chat.

Debugging

If you experience problems with the settings in this example, you can load the default settings in XCTU:
On the Configuration toolbar, click the Default button to load the default values
1.
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.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
25
Getting started with the XBee Smart Modem Development Kit Connect to a TCP/IP address

Connect to a TCP/IP address

The XBee Smart Modem can send and receive TCP messages while in Transparent mode; see
Transparent operating mode.
You can use this example as a template for sending and receiving data from a user. The following table explains the AT commands that you use in this example.
Command Value Description
IP (IP
Protocol)
DL
(Destination IPAddress)
DE
(Destination Port)
To connect to a TCP/IP address:
1. Ensure that the device is set up correctly with the SIM card installed and the antennas
connected as described in Connect the hardware.
2. Open XCTU and Add a device.
Click the Configuration working mode button.
3.
4. Select a device from the Radio Modules list. XCTU displays the current firmware settings for
that device.
1 Set the expected transmission mode to TCPcommunication.
<Target IPaddress>
<Target portnumber>
The target IP address that you send and receive from. For example, a data logging server’s IP address that you want to send measurements to.
The target port number that the device sends the transmission to. This is represented as a hexadecimal value.
In the IP field, select 1 and click the Write button .
5.
6. In the DL field, type the <target IP address> and click the Write button. The target IP address
is the IPaddress that you send and receive from.
7. In the DE field, type the <target port number>, converted to hexadecimal, and click the Write
button.
8. Exit Command mode; see Exit Command mode.
After exiting Command mode, any UART data sent to the device is sent to the destination IP address and port number after the RO (Packetization Timeout) occurs.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
26
Getting started with the XBee Smart Modem Development Kit Connect to a TCP/IP address

Debugging

If you experience problems with the settings in this example, you can load the default settings in XCTU:
On the Configuration toolbar, click the Default button to load the default values
1.
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.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
27
Getting started with the XBee Smart Modem Development Kit Perform a (GET) HTTP request

Perform a (GET) HTTP request

You can use the XBee Smart Modem to perform a GET Hypertext Transfer Protocol (HTTP) request using XCTU. This example uses http://httpbin.org/ as the target website that responds to the HTTP request.
To perform a GETrequest:
1. Ensure that the device is set up correctly with the SIM card installed and the antennas
connected as described in Connect the hardware.
2. Open XCTU and Add a device.
Click the Configuration working mode button.
3.
4. Select a device from the Radio Modules list. XCTU displays the current firmware settings for
that device.
5. To enter the destination address of the target website, in the DL field, type httpbin.org and
click the Write button .
6. To enter the HTTP request port number, in the DE field, type 50 and click the Write button.
Hexadecimal 50 is 80 in decimal.
7. To switch to TCP communication, in the IP field, select 1 and click the Write button.
8. To move into Transparent mode, in the APfield, select 0 and click the Write button.
9. Wait for the AI (Association Indication) value to change to 0 (Connected to the Internet).
Click the Consoles working mode button on the toolbar.
10.
From the AT console, click the Add new packet button in the Send packets dialog. The
11.
Add new packet dialog appears.
12. Enter the name of the data packet.
13. Type the following data in the ASCII input tab:
GET /ip HTTP/1.1
Host: httpbin.org
14. Click the HEX input tab and add 0A (zero A) after each 0D (zero D), and add an additional 0D 0A
at the end of the message body. For example, copy and past the following text into the HEX
input tab:
47 45 54 20 2F 69 70 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 68 74 74 70 62 69 6E 2E 6F 72 67 0D 0A 0D 0A
Note The HTTP protocol requires an empty line (a line with nothing preceding the CRLF) to terminate
the request.
15. Click Add packet.
Click the Open button .
16.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
28
Getting started with the XBee Smart Modem Development Kit Perform a (GET) HTTP request
17. Click Send selected packet.
18. A GETHTTP response from httpbin.org appears in the Console log.

Debugging

If you experience problems with the settings in this example, you can load the default settings in XCTU:
On the Configuration toolbar, click the Default button to load the default values
1.
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.
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
29
Getting started with the XBee Smart Modem Development Kit Get started with MQTT

Get started with MQTT

MQ Telemetry Transport (MQTT) is a messaging protocol that is ideal for the Internet of Things (IoT) due to a light footprint and its use of the publish-subscribe model. In this model, a client connects to a broker, a server machine responsible for receiving all messages, filtering them, and then sending messages to the appropriate clients.
The first two MQTTexamples do not involve the XBee Smart Modem. They demonstrate using the MQTTlibraries because those libraries are required for Use MQTT over the XBee Cellular Modem with
a PC.
The examples in this guide assume:
n Some knowledge of Python.
n An integrated development environment (IDE)such as PyCharm, IDLE or something similar.
The examples require:
n An XBee Smart Modem.
n A compatible development board, such as the XBIB-U.
n XCTU. See Configure the device using XCTU.
n That you install Python on your computer. You can download Python from:
https://www.python.org/downloads/.
n That you install the pyserial and paho-mqtt libraries to the Python environment. If you use
Python 2, install these libraries from the command line with pip install pyserial and pip
install paho-mqtt. If you use Python 3, use pip3 install pyserial and pip3 install paho-mqtt.
n The full MQTT library source code, which includes examples and tests, which is available in the
paho-mqtt github repository at https://github.com/eclipse/paho.mqtt.python. To download this
repository you must have Git installed.

Example: MQTT connect

This example provides insight into the structure of packets in MQTT as well as the interaction between the client and broker. MQTT uses different packets to accomplish tasks such as connecting, subscribing, and publishing. You can use XCTU to perform a basic example of sending a broker a connect packet and receiving the response from the server, without requiring any coding. This is a good way to see how the client interacts with the broker and what a packet looks like. The following table is an example connect packet:
Description Hex value
CONNECT packet fixed header
byte 1 Control packet type 0x10
byte 2 Remaining length 0x10
CONNECT packet variable header
Protocol name
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
30
Loading...
+ 121 hidden pages