zigbee address 64 bit or 16 bit?

Hi,

On both an X2 and X4, sometimes when there seems to be quite a lot of zigbee traffic the system returns a 16 bit address on a read instead of the normal 64 bit address. For example the following code reads a data buffer:

    buf, addr = sock.recvfrom(MAX_ZIG_PACKET_SIZE, 0)
    address = str(addr[0])

Sometimes it returns something like [4385]! instead of the normal [00:0d:6f:00:01:65:xx:xx]!

However that returned 16 bit address cannot be used in a sendto

                try:
                    print 'sending via zig SN ' + t[0] + ' cmd  ' + t[1]
                    sock.sendto(struct.pack('BBB',1,0,0)+HexToBin(data), 0,
                       (eui64, self.endpoint, self.profileid, self.cluster))
                except socket.error:
                    print 'sendto FAILED: '

If the address (here called eui64) is used from the recvfrom address, the send fails.

So how do I get around this?

Why does the digi python sometimes give me 16 bit addresses and sometimes 64?

Is there a way to go from the 16 bit address to the 64 bit?

Is there a way to send via the 16 bit address?

My understanding of how this works - the gateway gives you the format it received the message from the XBee.

If your XBee (in your X2/X4) has AO=0, then it returns what it saw from the radio. Which means they might be 16-bit or 64-bit format.

If your XBee (in your X2/X4) has AO=1, then it should always return the 64-bit address.

The AO setting is hidden in the Web UI, but by telnet you can read it by typing ‘set xbee AO’, and you can set it by ‘set xbee AO=1’

Thanks for trying.

When I set AO=0, my system no longer receives any message from the custom zigbee device.

When I set AO=1, I get the current behavior (mainly 64 bit addrs, but some 16 bits).

What the heck is AO and what is it supposed to do?

Is there something non-standard that the Digi x2/x4 devices are doing on reception from non-Digi remote devices?

Thanks,

Hi,

I don’t understand what good is it supplying a 16 bit address for a device if I cannot reply to the device with the 16 bit address. Is there a way to lookup the 64 bit mac address of the device given its 16 bit address?

Is there more info on the python zigbee interface? Is the digi python socket extended code available somewhere?

Thanks.

So we know AO=1, that is good. I have never seen a 16-bit address response under a ZB socket in Python, but you should be able to send using it the same as a 64-bit. In fact it is faster, other then at some time in the future it will change.

check the other message I sent you, talk to Aaron & see if you can get a direct contact.

Actually, I should point out that this use is using a non-standard Xbee module in the X4 (the S2C), so it is possibly a difference in how the S2C works over the S2B normally found in the X2/X4.