Home/Support/Support Forum/Can xbee3 get NI by micropython?

Can xbee3 get NI by micropython?

0 votes
hi, everyone.
I don't know getting NI by micropython.
Example,"get_parameter("NI")" by python.
I thank you in advance for your reply.
asked Sep 10 in XBee3 ZigBee by qwerty New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
Best answer
This is right from the example found in PyCharm

import xbee

print(" +
print(" | XBee MicroPython AT Commands Sample |")
print(" +

# Read the module's firmware version.
fw_version = hex(xbee.atcmd("VR"))
print("Firmware version: " + fw_version)

# Read the module's hardware version.
hw_version = hex(xbee.atcmd("HV"))
print("Hardware version: " + hw_version)

# Read the module's temperature.
temperature = xbee.atcmd("TP")
# convert unsigned 16-bit value to signed temperature
if temperature > 0x7FFF:
temperature = temperature - 0x10000
print("The XBee is %.1F C (%.1F F)" % (temperature, temperature * 9.0 / 5.0 + 32.0))

# Configure the module's node identifier and read it.
xbee.atcmd("NI", "XBee3 module")
print("Configured node identifier: " + xbee.atcmd("NI"))
answered Sep 10 by mvut Veteran of the Digi Community (14,578 points)
selected Sep 11 by qwerty
Thank you.
I missed that sample.