Go Down

Topic: XBee Retry in API mode (Read 2107 times) previous topic - next topic

surajpaul

Hello evryone,
I am using Xbee arduino Uno boards to communicate between two such nodes. (XBee 24)
I am stuck in two basic aspects regarding networking in XBee in API mode:-

1. I have set baudrate on both the nodes at 111111 bauds (16 Mhz/(16*111111.11)= 9, which is an integer value). I am using API mode to read data and send to receiving node. Even though i am using the same baud rates at transmitter and receiver i find that there is loss of data at receiver. API mode reports error sometimes indicating dropping of data packets. I want to know how to enable retries? is it by default enabled? I read that it takes 200ms to resend the ACK from receiver tot transmitter. I understand that its too basic to ask but i need clarification on this aspect. Plz help.

2. If i want to increase my data transfer rate, what other devices i can choose to acheive it without causing loss of data.

JChristensen

Which model XBees?
How much data is being sent? How often? XBees are low-bandwidth devices and have small buffers.
The XBee MAC layer does retries by default. If a transmission fails, retries at the application layer may not help depending on the cause.
Why the unusual baud rate? I usually use 115200 or 57600. There is no requirement that two XBees use the same baud rate. Whether they do or not should have no effect on reliability of transmission.
In my experience with XBee ZB (f.k.a. Series 2) modules, successful transmissions usually return the ack in < 50 ms. Where did the 200 ms number come from (link?)

surajpaul

I am using XBee model as shown in this link. Its XBEE OEM 802.15.4 RF module.
http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/point-multipoint-rfmodules/xbee-series1-module#overview


200Ms retries and the unusual baud rate i got from this document. its mentioned on page 17 and page 27 of the document-
http://www.jsjf.demon.co.uk/xbee/xbee.pdf

I am sending 16*8 bits of data every 25 ms. But i get loss of data packets. I wanted to know if any function call in API mode on processing software is available which can attempt retry if there is such loss of data packets?

JChristensen

Quote
If the transmitter does not receive an ACK within 200mS, it will retry up to three times.


Ah OK, didn't quite understand. But like I said, with the S2 modules, I typically see the ACKs come back in 30-50ms. Have not had the opportunity to check the S1 modules in this regard, but I wouldn't expect a significant difference.

Regarding the baud rates, since both the XBee and the Uno have 16MHz clocks, the errors in their baud rates should be similar and so they should work well together. Perhaps an XBee connected to a PC would not be as good a match, although I haven't noticed this either.

Bottom line, you are sending packets faster than it typically takes for the receiver to acknowledge, in my experience. So losing data is not surprising.

PaulS

Quote
1. I have set baudrate on both the nodes at 111111 bauds (16 Mhz/(16*111111.11)= 9, which is an integer value).

I miss the significance of the fact that 16 Mhz/(16*111111.11) (which is NOT the baud rate you are using) is approximately 9 (it isn't exactly 9). So what?

Quote
I am using API mode to read data and send to receiving node.

What kind of data? What does 16*8 mean? 8 ints? 16 bytes? 16 characters? Is it possible to compress the data?

Why do you need to send data every 25 milliseconds?

The more detail you provide, the more likely that we can define a solution to your problem.
The art of getting good answers lies in asking good questions.

JChristensen


I wanted to know if any function call in API mode on processing software is available which can attempt retry if there is such loss of data packets?


Simply wait for the Transmit Status packet to be received before sending another data packet. Inspect the status and if the transmission was successful, send the next data packet. If unsuccessful, the previous packet can be retried.

See the product manual, p62.

This will also throttle the transmissions so that the XBee's buffers are not overrun and data is not lost. I wouldn't expect to be able to send a packet every 25ms.

Go Up