EasyManuals Logo
Home>Digi>Control Unit>XBee 3 ZigBee

Digi XBee 3 ZigBee User Manual

Digi XBee 3 ZigBee
347 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 #30 background imageLoading...
Page #30 background image
Get started with MicroPython MicroPython networking and communication examples
Digi XBe 3 Zigbe RF Module
30
For the examples in this section, we use MicroPython to manage a Zigbee network and send and
receive data between modules. To follow the upcoming examples, we need to configure a second
XBee 3 Zigbee RF Module to use MicroPython.
XCTU only allows a single MicroPython terminal. We will be running example code on both modules,
which requires a second terminal window.
Open a second instance of XCTU, and configure a different XBee 3 device for MicroPython following
the steps in Use XCTU to enter the MicroPython environment.
WARNING! The upcoming examples form and join an unencrypted Zigbee network. If the
modules were previously associated with a network, they will be disassociated.
Example: forming and joining a Zigbee network using MicroPython
This example forms a two-node Zigbee network using MicroPython. This is a prerequisite for
subsequent networking examples.
This example assumes that you have two XBee 3 Zigbee RF Modules configured for MicroPython and
two terminals open, one for each radio.
Execute the following code on the first radio; it will be our network coordinator:
import xbee, time
# Set the identifying string of the radio
xbee.atcmd("NI", "Coordinator")
# Configure some basic network settings
network_settings = {"CE": 1, "ID": 0xABCD, "EE": 0, "NJ": 0xFF}
for command, value in network_settings.items():
xbee.atcmd(command, value)
xbee.atcmd("AC") # Apply changes
time.sleep(1)
while xbee.atcmd("AI") != 0:
time.sleep(0.1)
print("Network Established")
operating_network = ["OI", "OP", "CH"]
print("Operating network parameters:")
for cmd in operating_network:
print("{}: {}".format(cmd, xbee.atcmd(cmd)))
Run the following code on the second radio, it will be a router that will join the established network:
import xbee, time
# Set the identifying string of the radio
xbee.atcmd("NI", "Router")
# Configure some basic network settings
network_settings = {"CE": 0, "ID": 0xABCD, "EE": 0}
for command, value in network_settings.items():
xbee.atcmd(command, value)
xbee.atcmd("AC") # Apply changes
time.sleep(1)

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Digi XBee 3 ZigBee Specifications

General IconGeneral
BrandDigi
ModelXBee 3 ZigBee
CategoryControl Unit
LanguageEnglish

Related product manuals