Xbee Series 2 packet length issue sending floats (converted to bytes with union)

Hello all,

I am sending a 40-byte payload from an S2 Xbee (XB24-ZB, ZigBee End Device AT, firmware 28A7) to an Pro S2B (XBP24BZ7, ZigBee Coordinator API, firmware 21A7) and I inconsistently receive either a 71 or 72 byte length frame packet on the receiving end.

Upon inspection with XCTU on the receiving end it seems like there is a second packet embedding the data payload - ZBRxResponse.getData() returns the embedded packet which also seems to start with 0x7E.

I'm a bit confused as my data starts at byte position 18 of the internal data packet, however the getDataOffset() returns 11. I verified this by sending an easily identifiable hardcoded 40-byte payload 99 99 99 99...

The only parameters I have set on the Xbee's are ID and NI, the rest are default values. Note that I get this same problem if I try to send a single float converted to 4-bytes using a union. The issue seems to be related to sending a float in a byte array as when I hard-code the 40-bytes the packets are consistent and work as expected.

Here are both packets in detail: http://pastebin.com/BzWT5NWU

And my code of course:

Tx Code: http://pastebin.com/jCUvedbJ Rx Code: http://pastebin.com/gsNxW5bk

Thanks for any help and have a great evening!

Solved my own problem. It was caused by using AT firmware on the transmitting Xbee. Once the latest API End Device firmware was implemented it worked precisely as expected.

rktect: Solved my own problem. It was caused by using AT firmware on the transmitting Xbee. Once the latest API End Device firmware was implemented it worked precisely as expected.

Great. In the future, though, please attach your code to your post. Don't put it in the rubbish bin and expect us to get it.

I have a similar problem: i have to create a network with 1 coordinator and 2 rooter (in API mode), can u give me the configuration of yours??? tnks