Author Topic: RFM69 reception issues due to broken AGC  (Read 1572 times)

joelucid

  • Hero Member
  • *****
  • Posts: 867
RFM69 reception issues due to broken AGC
« on: May 12, 2016, 07:41:26 AM »
I've documented previously how AGC is broken in RFM69 (https://lowpowerlab.com/forum/index.php/topic,1767.0.html). Essentially the RSSIThresh of 220 causes RSSI detection to ALWAYS detect a signal even if it's only the noise floor. It then selects maximum gain.

Back then my assumption was that this would primarily affect nodes closely spaced together. For those maximum gain is too much, causing distortion in the receiver. However even with the distortion reception is still ok at 55k, so I thought it wasn't too much of an issue.

Forward to today when I did some range tests. I wanted to compare my low noise gateway to a Moteino, so i positioned both closely together and measured success rates receiving packets from another mote far away.

I must have spent hours figuring out why the receiving motes would often lock up causing the test to fail. Here's the cause:

Both receivers receive the packet from the sender. One is the correct target and sends an ack. Now the other also received the packet because of the promiscuous implementation of rfm69. It immediately goes back to RX starting RSSI detection.

Since the ack packet comes in immediately when the node starts RX now AGC does trigger a lower gain. However if the ack isn't received correctly by the RX'ing node it will stick with the lower AGC until it receives another packet. Which in my setup never happened.

So there you go: a real life problem cause by the AGC issues. Solution was to always set AGC to max gain. And I think there are really only two options: either set RSSIThresh below the noise floor but set AGC to max gain. Or raise RSSIThresh above the noise floor. The current behavior of RFM69 definitely causes problems.

Realistically raising RSSIThresh needs to be done in the context of the mote - so it's probably too much to ask of RFM69. Therefore RFM69 should always select max gain in the LNA.

Joe 

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: RFM69 reception issues due to broken AGC
« Reply #1 on: May 12, 2016, 10:00:03 AM »
You wrote:

Quote
However if the ack isn't received correctly by the RX'ing node it will stick with the lower AGC until it receives another packet

If I'm following you correctly, you mean the strong ACK packet coming in from the adjacent test node. Won't a failure to receive this correctly get caught by the CRC and loop back to another Rx cycle with a fresh start on working out the AGC value?


joelucid

  • Hero Member
  • *****
  • Posts: 867
Re: RFM69 reception issues due to broken AGC
« Reply #2 on: May 12, 2016, 12:11:18 PM »
Quote
Won't a failure to receive this correctly get caught by the CRC and loop back to another Rx cycle with a fresh start on working out the AGC value?

It depends on whether a failed CRC check causes the RX cycle to restart or just to continue. Certainly if RX starts so late that the radio misses the sync word, RX would just continue with the low gain setting.

In any case always forcing high gain fixed this issue in my case. If you wanted to restart on failed RX in all cases you'd have to wait for RSSI, then set a timeout and restart RX when the timeout hits before payload available.

Joe