LowPowerLab Forum

Hardware support => Moteino => Topic started by: sab on May 04, 2014, 09:15:26 AM

Title: Moteino RFM69 ACK delay
Post by: sab on May 04, 2014, 09:15:26 AM
Hey all,

I've got a strange issue with delayed ACKs from a moteino gateway. Here's my situation:

I have a bunch of nodes and one gateway all running RFM69 radios at 433MHz with sketches based on Felix's examples and rfm69 library. I noticed (by monitoring in promiscuous mode)  that my gateway sometimes takes a long time to ack messages from the nodes causing then to retransmit.

I modified the gateway to log the number of mS it takes to return from radio.sendACK() and found that it goes from 5mS all the way up to 1200mS with an average of about 30mS.

I then tried the same gateway hardware plugged into USB on different PC and the acks go back to 5mS with little or no variance. I tried a bunch of different PCs and with all of them the gateway behaves properly and acks in around 5mS. I even tried using the USB power from an iPhone charger to power the gateway (and measuring the ack time at the node) and its still 5mS.

The PC that has wild inconsistencies in ACK times is a small stand alone Ubuntu server (media center type box). When the moteino gateway is plugged into any USB port on that host the ACK response times again go crazy. Sometimes its at 5mS, other times up in the 100+ mS.

The only thing I can see in the rfm69 lib that might cause such a variance in delays is the "while (!canSend())" in the send function. canSend waits for "readRSSI() < CSMA_LIMIT".

CSMA_LIMIT is set to -90 in the header file, so I assume if there is too much background chatter then canSend never returns true.

If this is the case, then the issue does not seem to be RF based, as I have tried the gateway in exactly the same position, but connected to a different computer and all works fine with 5mS acks. If I connect it back to the Ubuntu media box then the acks go all over the place again.

Could this be some kind of noise on the USB power line coming through form the computer and upsetting the radio??

I have also tried adding some additional decoupling capacitors on the RFM69 radio module, but to no avail.

Any ideas of what else to try or pointers would be greatly appreciated! :)

Cheers,
Sab.

Title: Re: Moteino RFM69 ACK delay
Post by: hdphilip on May 04, 2014, 10:39:02 AM
sab,
I've notice some odd behaviors too, when I'm just experimenting with the node and gateway modules on the bench, i keep the Rf  Power level at 2, and even with that i need to keep them about 4 feet apart.

my nokia 5110 lcd display comes in real handy displaying information from the gateway. something I'm going to try is connecting one of those Bluetooth modules to the moteino's as a way to read out the serial information.

philip   
Title: Re: Moteino RFM69 ACK delay
Post by: Felix on May 04, 2014, 04:15:08 PM
To me it sounds like faulty radios. Unless all things equal the issue is the same on different hardware.
Title: Re: Moteino RFM69 ACK delay
Post by: Nuudeli on December 16, 2015, 02:12:57 PM
Sorry for posting this old thread, but I've faced similar problems with ACK's as OP.

I've noticed that it's related to RXBW settings --> by narrowing down RXBW (or increasing the DCC cut-off frequency) you end up to have longer delay before ACK and vice versa. Found this behavior when I was adjusting the DC cut-off frequency for highest coverage.

Some quick testing revealed following behavior with temperature compensated radios, having BR=1200 and FDEV=5000:

Better, ACK ~166ms:
{ REG_RXBW, RF_RXBW_DCCFREQ_111 | RF_RXBW_MANT_20 | RF_RXBW_EXP_2 }, RXBW = 100kHz

Worse, ACK ~300-500ms, fluctuating a lot:
{ REG_RXBW, RF_RXBW_DCCFREQ_111 | RF_RXBW_MANT_16 | RF_RXBW_EXP_6 }, RXWB = 7.8kHz

Also printed out the RSSI readings while in canSend() loop and it seems to read the same RSSI as last packet did have (much longer when worse settings used) and suddenly it realizes that there's no activity and measured a low RSSI, for eg. -120dBm and sends the ACK. I've disabled the "sniffing feature" from the library as I'm sending only ocassionally... and it has not failed since.
if (_mode == RF69_MODE_RX && PAYLOADLEN == 0 /*&& readRSSI() < CSMA_LIMIT*/)

For higher RXBW and bitrate settings this is not a problem but might be a "good to know" when trying to achieve highest range and want to use ACK's.