0
\$\begingroup\$

I've a ATmega368, currently working on top of a Arduino Uno, which its final purpose will be to process some sensor information and send it through XBee (configured as a router) to the coordinator.

So, basically I've a arduino, which its Tx pin is connected to the pin 3 on XBee (configured as a ROUTER AT). All information I'm writing through the Serial.println() method is received perfectly on the coordinator in API ZigBee Receive Packet frames (0x90).

Now, considering that the API 0x90 packet is capable to hold 6 bytes of data, I was expecting that if I limited the output on the Arduino also to 6 bytes I would get only 1 frame with the full 6 bytes. But what it happens is that normally I get the full message sent from the arduino, broken into the several frames.

I think is mostly due to the packetization timeliness (set by RO) of data while waiting on the buffer. But considering I'm only sending data every 5 seconds or so, the packetization period always timeouts.

An option could be to configure the XBee as a ROUTER API, and build up the frame myself.

Any thoughts?

\$\endgroup\$
1
\$\begingroup\$

Yes, the only reliable option I have found to avoid packets being split is to use the API mode. There is an Arduino library to help you with that already, xbee-arduino from Andrew Rapp. Don't forget to configure API mode escaped, otherwise the frames will be considered wrong, nothing will be received, and you'll not understand why. On the computer side, the xbee-api library (Java) from the same author is great for debugging.

I have set together a page with the XBee tips and resources I found most useful when I was doing something similar with an XBee.

\$\endgroup\$
  • \$\begingroup\$ Thank you Erion. I was suspecting just that, and after reading the XBee spec manual from top to bottom (per say), and a lot of googling I couldn't find any other (elegant) solution. Actually I'll be using a C++ library I'm developing myself https://code.google.com/p/zigbeelib/, but thanks for the Java reference. I'll give one last look at the documentation, and get back to tag you answer as the solution . \$\endgroup\$ – cvicente Dec 10 '13 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.