Home/Support/Support Forum/Receiving KeyError when trying to unpack dictionary to configure xbee
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Receiving KeyError when trying to unpack dictionary to configure xbee

0 votes
I am getting a 'KeyError: N' when I try to run the following code,

CONTROLLER_CONFIG = {
'ID': 1986,
'CE': 1,
'NI': 'Controller',
'AP': 4
}

def configure_node(**kwargs):
for cmd, value in kwargs.items():
print(cmd, ' ', value)
xbee.atcmd(cmd, value)

configure_node(**CONTROLLER_CONFIG)

I can run this fine on my computer, but I get the error when trying to run it via XTCU micropython terminal. I am really clueless to what I am doing wrong.
asked Jul 7 in Python by DKuchen New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
Which XBee module are you working with, what firmware version and what is the AP command set to on that module?
answered Jul 7 by mvut Veteran of the Digi Community (13,332 points)
...