Get started with MicroPython About MicroPython
Digi XBee® 3 Zigbee® RF Module
26
About MicroPython
MicroPython is an open-source programming language based on Python 3.0, with much of the same
syntax and functionality, but modified to fit on small devices with limited hardware resources, such as
an XBee 3 Zigbee RF Module.
For more information about MicroPython, see www.micropython.org.
For more information about Python, see www.python.org.
MicroPython on the XBee 3 Zigbee RF Module
The XBee 3 Zigbee RF Module has MicroPython running on the device itself. You can access a
MicroPython prompt from the XBee 3 Zigbee RF Module when you install it in an appropriate
development board (XBDB or XBIB), and connect it to a computer via a USB cable.
Note MicroPython is only available through the UART interface and does not work with SPI.
Note MicroPython programming on the device requires firmware version or newer.
The examples in this user guide assume:
n You have XCTU on your computer. See Configure the device using XCTU.
n You have a serial terminal program installed on your computer. For more information, see Use
the MicroPython Terminal in XCTU. This requires XCTU 6.3.10 or higher.
n You have an XBee 3 Zigbee RF Module installed on an appropriate development board such as
an XBIB-U-DEV or an XBDB-U-ZB.
n The XBee 3 Zigbee RF Module is connected to the computer via a USB cable and XCTU
recognizes it.
Use XCTU to enter the MicroPython environment
To use the XBee 3 Zigbee RF Module in the MicroPython environment:
1. Use XCTU to add the device(s); see Configure the device using XCTU and Add devices to XCTU.
2. The XBee 3 Zigbee RF Module 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.
Note To ensure that MicroPython is responsive to input, Digi recommends setting the XBee
UART baud rate to 115200 baud. To set the UART baud rate, select 115200 [7] in the BD field
and click the Write button. We strongly recommend using hardware flow control to avoid data
loss, especially when pasting large amounts of code or text. For more information, see UART
flow control.
4. To put the XBee 3 Zigbee RF Module into MicroPython mode, in the APfield select MicroPython
REPL [4] and click the Write button .
5. Note which COM port the XBee 3 Zigbee RF Module is using, because you will need this
information when you use the MicroPython terminal.