mixed up or invalid packet lengths ?

35 views
Skip to first unread message

claudemmm

unread,
Feb 20, 2012, 10:38:18 PM2/20/12
to xbee-api

I have a router note receiving IO samples from 2 other routers.
When both radios send samples roughly at the same time, the packets
get mixed up. Example:

RX: .7E.0.12.92.0.7D.33.A2.0.40.61.62.48.AB.ED.1.1.0.0.1.0.27.AB
(XBee ZB_IO_SAMPLE_RESPONSE from 0013a200-40616248)

TX: XBee TX http://192.168.0.10:8888/io/ios/create?macAddress=0013a200-40616248&a0=39
(should cause a ZB_RX_RESPONSE and ZB_TX_STATUS_RESPONSE normally, but
get errors if I get another IO sample now...)

RX: .7E.0.12.92.0.7D.33.A2.0.40.61.62.24.B9.4E.1.1.0.0.1.3.64.20
(XBee ZB_IO_SAMPLE_RESPONSE from 0013a200-40616224)

TX: XBee TX http://192.168.0.10:8888/io/ios/create?macAddress=0013a200-40616224&a0=868
(expects same as above)

RX: .7E.0.2D.90.0.7D.33.A2.0.40.60.47.56.0.0.1.7B.
22.73.74.61.74.75.73.22.3A.22.4F.4B.22.2C.22.6D.
65.73.73.61.67.65.22.7E
(XBee RX error 00000003: unexpected 7E)

.0.2D.90.0.7D.33.A2.0.40.60.47.56.0.0.1.7B.22.73.74.61.74.75.7E.
0.12.92.0.7D.33.A2.0.40.61.62.48.AB.ED.1.1.0.0.1.0.27.AB
(XBee RX error 00000001 -- not sure why it continued here)

RX: .7E.0.12.92.0.7D.33.A2.0.40.61.62.24.B9.4E.1.1.0.0.1.3.64.20
XBee ZB_IO_SAMPLE_RESPONSE

Any idea why this is happening?
It seems to work fine when receiving from only 1 radio.

Thanks,

--
CM

claudemmm

unread,
Feb 20, 2012, 10:40:29 PM2/20/12
to xbee-api
I should have mentioned that the TX is sent to an XIG on a
connectPort.
Also, this is running on an arduino.

On Feb 20, 10:38 pm, claudemmm <claudemontpe...@gmail.com> wrote:
> I have a router note receiving IO samples from 2 other routers.
> When both radios send samples roughly at the same time, the packets
> get mixed up. Example:
>
> RX: .7E.0.12.92.0.7D.33.A2.0.40.61.62.48.AB.ED.1.1.0.0.1.0.27.AB
> (XBee ZB_IO_SAMPLE_RESPONSE from 0013a200-40616248)
>
> TX: XBee TXhttp://192.168.0.10:8888/io/ios/create?macAddress=0013a200-40616248&a...
> (should cause a ZB_RX_RESPONSE and ZB_TX_STATUS_RESPONSE normally, but
> get errors if I get another IO sample now...)
>
> RX: .7E.0.12.92.0.7D.33.A2.0.40.61.62.24.B9.4E.1.1.0.0.1.3.64.20
> (XBee ZB_IO_SAMPLE_RESPONSE from 0013a200-40616224)
>
> TX: XBee TXhttp://192.168.0.10:8888/io/ios/create?macAddress=0013a200-40616224&a...

claudemmm

unread,
Feb 25, 2012, 10:04:37 PM2/25/12
to xbee-api
Ok, I found the problem.

First, I tried suggestions I got from the XIG group where I posted
something similar, that looked like incomplete responses from XIG.

Here is the conclusion I posted on this forum.

With suggestions I got there, I implemented RTS in the XBee library.
This reduced occurrence but problem still happened once in a while.
When it did, I could see the buffer fill up more than the maximum
number of bytes I was allowing to fill.

Then I increased baud rate between the xbee and the arduino from 9600
to 38400. This reduced occurrence some more.

I then realized I had a forgotten a "delay(1000)" somewhere in
my loop. So if a big response was coming in during that long delay,
the xbee was sending data through UART and my modified XBee library
with RTS support did not have a chance to stop incoming bytes (assert
(set High) RTS pin).

So I learned quite a lot in the process: RTS is a good thing
to understand, and long operations (delay(1000), for example) may
have
unwanted side effects.

Removing the delay makes the RTS less necessary, but I will recode
that support so it is more flexible, and will send a patch if this
could be useful in the library.

--
Claude
Reply all
Reply to author
Forward
0 new messages