Full duplex lockups

Have had a real hard time getting full duplex operation to work reliably on a series 2. At some point the module locks up & doesn’t receive anymore.

The packets are all in broadcast mode. A ground beacon sends every 21ms and a remote receiver responds after the beacon is received. On the ground, the response is sent out the UART when the next ground beacon is being sent.

The problem has been narrowed down to having the ground UART send & receive simultaneously. If the send & receive are in a single thread, the number of lockups decreases but it still happens within 8 hours.

The problem can probably be reduced by spacing out ground beacons even more, but it’s still a high risk. Attached are soundcard recordings of the UART activity.

Quick question: are you using hardware flow control?

This is not using hardware flow control. Also, it’s a series 1, not a series 2.

If you are sending data hard and fast you will need to use hardware flow control in order to reliably make sure that you are not overwhelming the radio’s receive UART buffer.

What radio firmware version are you using?

What baud rate are you running the radio at?

The module says

XBee-PRO 802.15.4 RELEASE V 1084, Build: Jul 25 2007 16:30:34
Hardware Version: X42 MC13213
Software Compatibility: 01
MAC FFDNBNS V1061 Build: Jul 18 2007 17:25:25
PHY XBEE4 V1061 Build: Jul 25 2007 16:29:31

The baud rate is 115200. The output is 1 packet of 22 bytes sent every 21ms. There is virtually no data loss when it works.

Couple things you’ll want to be aware of. first, the 802.15.4 radios do not support full duplex operation. The radios are half duplex only. Second, when the baud rate is set to 115200, the actual baud rate of the radio is set to 111,111. This difference in baud rate can cause some loss of data, but shouldn’t cause a lock up.

You can solve the baud rate mismatch by setting your processor baud rate to match closer to the actual baud rate of the radio, or set two stop bits on the host.

Managed to get some lockups even though the packets were spaced out enough to not have the module doing 2 things simultaneously. It seems a number of circumstances may cause a lockup, like using a high powered RF source nearby, using a microwave oven nearby, using the module for many hours, a stray packet coming out simultaneously with a sent packet. The reset pin seems to be the only solution.