Home/Support/Support Forum/Python XBee Library ERROR when attempting to set the AP parameter in XBee device
New and improved user forum site coming soon
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Python XBee Library ERROR when attempting to set the AP parameter in XBee device

0 votes
I have an XBee3 ZigBee network setup. I have both firmware flashed (MicroPython) and a main Python project. So, my goal is to send a message on auto-start (PS = 1) with one of my router devices to the coordinator device.

First question is, in order for MicroPython to run at all do you have to have the device in REPL mode (AP=4)? or can you have it in API (AP=1) mode the whole time and thats fine? The MicroPython will run in API mode?

Separate more specific question:

So when I go to reset the AP parameter of the router device after the flashed firmware runs at auto-start I get an error.. I want the router to initially be in REPL mode to run the firmware at auto-start correct?? so that's AP = 4.

Then after that runs I want the device to be set as AP=1 (API mode)

So when I do:

remote_device.set_parameter("AP", bytearray('\x01'))

I get "TypeError: string argument without an encoding"

I tried this instead:

tower_1.set_parameter("AP", 'utf8', bytearray('\x01'))

same error..
what is the proper syntax to do this?

thanks much! :D
asked Aug 3, 2020 in Python by edunn106 New to the Community (25 points)

Please log in or register to answer this question.

2 Answers

0 votes
In order to use Micro Python on the module with an app running on it, you do have to have the radio in Micro Python mode.
answered Aug 3, 2020 by mvut Veteran of the Digi Community (15,515 points)
0 votes
I have just been setting AT commands with something like ("AP", 1) does that work for you?
answered Nov 17, 2020 by plater Community Contributor (64 points)