EasyManua.ls Logo

Digi XBee 3 User Manual

Digi XBee 3
293 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 #43 background imageLoading...
Page #43 background image
Get started with MicroPython Example: debug the secondary UART
Digi XBe 3 Cellular LTE Cat 1 AT&T Smart Modem User Guide
43
Note You can easily copy and paste code from the online version of this guide. Use caution with the
PDF version, as it may not maintain essential indentations.
Now you have a system based on the XBee Smart Modem that sends an SMS in response to a certain
input, in this case a simple button press.
Note If you have problems pasting the code, see Syntax error at line 1. For SMS failures, see Error
Failed to send SMS.
Example: debug the secondary UART
This sample code is handy for debugging the secondary UART. It simply relays data between the
primary and secondary UARTs.
from machine import UART
import sys, time
def uart_init():
u = UART(1)
u.write('Testing from XBee\n')
return u
def uart_relay(u):
while True:
uart_data = u.read(-1)
if uart_data:
sys.stdout.buffer.write(uart_data)
stdin_data = sys.stdin.buffer.read(-1)
if stdin_data:
u.write(stdin_data)
time.sleep_ms(5)
u = uart_init()
uart_relay(u)
You only need to call uart_init() once.
Call uart_relay() to pass data between the UARTs.
Send Ctrl-C to exit relay mode.
When done, call u.close() to close the secondary UART.
Exit MicroPython mode
To exit MicroPython mode:
1.
In the XCTU MicroPython Terminal, click the green Close button .
2. Click Close at the bottom of the terminal to exit the terminal.
3.
In XCTU's Configuration working mode , change AP API Enable to another mode and click
the Write button . We recommend changing to Transparent mode [0], as most of the
examples use this mode.

Table of Contents

Other manuals for Digi XBee 3

Question and Answer IconNeed help?

Do you have a question about the Digi XBee 3 and is the answer not in the manual?

Digi XBee 3 Specifications

General IconGeneral
ModelXBee 3
CategoryModem
Frequency Bands2.4 GHz, 868 MHz, 900 MHz
InterfaceUART, SPI, I2C
Operating Temperature-40° C to +85° C
Power Supply2.1V to 3.6V
AntennaExternal or onboard
Transmit Powerup to 20 dBm
SecurityAES encryption
ProtocolsZigbee, 802.15.4, DigiMesh

Summary

Getting Started with the XBee Smart Modem

Connect Hardware and Install XCTU

Step-by-step instructions for connecting hardware and installing XCTU utility.

Update Firmware and Check Connection

Procedures for updating device firmware and verifying cellular connection status.

XBee Connection Examples

Getting Started with MicroPython

MicroPython Basics and Setup

Introduction to MicroPython and setting up the environment using XCTU.

Update the Firmware

Update Device and Cellular Firmware

Procedures for updating device and cellular firmware using XCTU.

Update Telit Modem Firmware with XFP Utility

Instructions for updating the Telit modem firmware using the XFP utility.

AT Commands Reference

Special, Cellular, and Network Commands

Reference for special, cellular, and network configuration AT commands.

I/O, Sleep, and Mode Commands

Configuration commands for I/O settings, sleep modes, and operating modes.

File System, BLE, Socket, and API Commands

Commands for file system, BLE, sockets, and API frame management.

Troubleshooting Guide

Related product manuals