The new Digi XBee3
line of embedded RF modules feature edge intelligence to help execute business rules and a whole lot more. By running simple Python-based scripts on Digi XBee3, you can save money, extend battery life, improve responsiveness and enhance system reliability.
The best way to understand the power of edge intelligence is hands-on. In this series well take you through some simple examples that you can use directly, then customize and extend to bring the power of programming to everyones favorite line of radio modules.
MicroPython is an open-source programming language based on Python 3, modified to fit on small devices and optimized for microcontrollers. Using MicroPython, an scripting and programming language, you can rapidly prototype intelligent behaviors at the edges of your network. sensor readings can be transformed into useful data, excess transmissions can be intelligently filtered out, and sensors and actuators can be employed directly, with complex procedures carried out locally when needed.
Getting Started with Digi XBee MicroPython Programming
XCTU v6.3.8 and later feature a new MicroPython terminal, allowing the user to interact with MicroPython on the Digi XBee3 modules. Through the serial interface in the terminal, users can write, test, load, and run MicroPython code using the familiar REPL interactive prompt.
Its simple to get started. Well begin with the
. (Other Digi XBee3 Cellular Kits are similar.)
- Assemble the hardware and connect it to the XCTU configuration software. Complete instructions, if needed, can be found in the Getting Started Guide.
- Open the XCTU program.
- Add a device (help).
- The XBee Cellular Modem appears as a box in the Radio Modules information panel. Click this box to select the device and load its current settings.
- Set the devices baud rate to 115200 bps for the best experience. In the BD field, select 115200  and click the Write button.
- To put the XBee Cellular Modem into MicroPython mode, in the AP field select MicroPython REPL  and click the Write button.
- Note what COM port(s) the XBee Cellular Modem is using, because you will need this information when you use terminal communication. The Radio Modules information panel lists the COM port in use.
To use the MicroPython
Terminal in XCTU:
- Click the Tools drop-down menu and select MicroPython Terminal.
- Click Open. If you have not already added devices to XCTU:
- In the Select the Serial/USB port area, click the COM port that the device uses.
- Verify that the baud rate and other settings are correct.
- Click OK. (The Open icon changes to Close, indicating that the device is properly connected.)
- Press Ctrl+B to get the MicroPython version banner and prompt.
Hello World Example
Lets upload some simple "Hello World" code to confirm everything is working. Using a text editor, such as Notepad in Windows or TextEdit on MacOS, type in this short script:
contact us to discuss your needs.