niolabs / python-xbee

Python tools for working with XBee radios
MIT License
101 stars 45 forks source link

Doesn't seem to set the network address like is indicated in the manual #61

Closed anderwm closed 6 years ago

anderwm commented 6 years ago

The frame that gets generated when I use:

xbee.tx_long_addr(id='\x10',` frame_id='\x11', dest_addr=xbeeAddress[0:], data=xbeePacket[0:])

doesn't seem to set the network address like is indicated in the manual https://www.digi.com/resources/documentation/Digidocs/90000991/Default.htm#reference/r_frame_0x10.htm%3FTocPath%3DOperate%2520in%2520API%2520mode%7CAPI%2520frames%7C_____5

And I'm not getting at the destination radio like I expect

jamesleesaunders commented 6 years ago

Hi Andrew, what results do you get?

One of the most common reasons for unpredicted behaviour is when the Xbee API settings are not correct.

What AP and AO settings have you got? Try: API Enable (AP): 2 API Output Mode (AO): 3

Depending on what the above is you may also need to play with the ‘escaped=True’ setting when when constructing...

xbee = ZigBee(ser, escaped=True)

jamesleesaunders commented 6 years ago

p.s Yes this code is current!

anderwm commented 6 years ago

In a frame to be written (as in just before it goes out the serial). I am only seeing 1 byte between the address and the data. According to the manual linked above for transmit request frame (0x10) there should be a 16 bit network address (usually 0xFFFE), a broadcast radius byte, and an options byte.

I am using 802.15.4 firmware with API: 1, (not escaped) and I don't believe that there is a setting for AO except in digimesh mode. However, I'm sure I could just use 0x11 for explicit addressing if that makes a difference.

Thanks for your time

anderwm commented 6 years ago

Ok, my mistake was mixing up the ieee (802.15.4) and digimesh manuals. Works great thanks.

jamesleesaunders commented 6 years ago

Cool, glad you figured it out. Thanks for letting us know.