Digi International Inc XB3C1 Manuel D’Utilisation

Page de 146
Get started with MicroPython
About MicroPython
Digi XBee3 Cellular LTE Cat 1 Smart Modem User Guide
47
About MicroPython
MicroPython is an open-source programming language based on Python 3, with much of the same
syntax and functionality, but modified to fit on small devices with limited hardware resources, such as
microcontrollers, or in this case, a cellular modem.
Why use MicroPython
MicroPython enables on-board intelligence for simple sensor or actuator applications using digital and
analog I/O. MicroPython can help manage battery life. Cryptic readings can be transformed into useful
data, excess transmissions can be intelligently filtered out, modern sensors and actuators can be
employed directly, and logic can glue inputs and outputs together in an intelligent way.
For more information about MicroPython, see
For more information about Python, see
MicroPython on the XBee Smart Modem
The XBee Smart Modem has MicroPython running on the device itself. You can access a MicroPython
prompt from the XBee Smart Modem when you install it in an appropriate development board (XBDB
or XBIB), and connect it to a computer via a USB cable.
Note
MicroPython does not work with SPI.
The examples in this guide assume:
n
You have
on your computer. See
n
You have a terminal program installed on your computer. We recommend using the
This requires XCTU 6.3.7 or higher.
n
You have an XBee Smart Modem installed in an appropriate development board such as an
XBIB-U-DEV or an XBIB-2.
Note
Most examples in this guide require the XBIB-U-DEV board.
n
The XBee Smart Modem is connected to the computer via a USB cable and XCTU recognizes it.
n
The board is powered by an appropriate power supply, 12 VDC and at least 1.1 A.
Use XCTU to enter the MicroPython environment
To use the XBee Smart Modem in the MicroPython environment:
1. Use XCTU to add the device(s); see
and
.
2. The XBee Smart Modem appears as a box in the Radio Modules information panel. Each
module displays identifying information about itself.
3. Click this box to select the device and load its current settings.
4. To set the device's baud rate to 115200 b/s, in the BD field select 115200 [7] and click the
Write button
. We recommend using flow control to avoid data loss, especially when pasting
large amounts of code/text.