Author Topic: RFM69-ATC in multi node network  (Read 3096 times)

TimC

  • NewMember
  • *
  • Posts: 3
  • Country: us
RFM69-ATC in multi node network
« on: February 26, 2017, 01:46:00 PM »
I'm building a multi-node network with a central 'gateway' and several sensor nodes.

My question is this; Does the library maintain a per-destination table of received RSSI/required power levels?

For example, my gateway is in a fixed location, but the sensors will be spread throughout the house and some are outside at some distance.  If the gateway node throttles-back to reach the target RSSI on the 'close' nodes it may no longer be heard on the distant nodes.  Or, will it simply oscillate around an equilibrium xmit power between the near & far RSSI received values?

Thx.

T.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69-ATC in multi node network
« Reply #1 on: February 26, 2017, 03:58:48 PM »
If you want the details look at the code in RFM69_ATC (interruptHook specifically, follow the _ackRSSI field).
Basically each node will auto throttle based on ACK information from the gateway.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69-ATC in multi node network
« Reply #2 on: February 26, 2017, 10:21:23 PM »
Felix is correct.  Each node maintains their own target level and use the RSSI value that the Gateway receives from that node.  This value is returned, embedded in the ACK, the gateway sends back to the node's sendWithRetry() call.   The gateway (assuming it has the ATC code running in it) is totally unaware of any of this taking place (other than actually sending an ACK back to the node).

Tom

TimC

  • NewMember
  • *
  • Posts: 3
  • Country: us
Re: RFM69-ATC in multi node network
« Reply #3 on: February 27, 2017, 09:37:57 AM »
So the gateway node, with ATC enabled and a threshold set, does not adapt it's power-level for a target RSSI on the other nodes?  I assumed that ATC was symmetric; that both ends adjusted their xmit power to achieve a desired RSSI on the far end.

Please excuse my ignorance.  I guess I'm missing the bit that tells the gateway node it is a 'gateway node' and should not modify it's own power-level.  I suppose I could just set the target RSSI very high on the gateway (say, -30).

I'll have a look at the ATC code during lunch to see what I'm missing.

Thanks for your help.

T.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69-ATC in multi node network
« Reply #4 on: February 27, 2017, 09:46:09 AM »
The gateway just provides feedback to the end nodes, it does not adjust power itself because it has to be able to reach all nodes (this assumes some nodes are close by and although not full power is needed, some nodes can be far and full power is needed). Only the end nodes adjust power based on their signal strength that the gateway receives (and reports back to the node through an ACK, at which point the node decides if it needs to +/- the TX power output).

TimC

  • NewMember
  • *
  • Posts: 3
  • Country: us
Re: RFM69-ATC in multi node network
« Reply #5 on: February 28, 2017, 01:43:21 PM »
So after reviewing the node and gateway examples the light-bulb finally appeared over my addled head.

The nodes call 'radio.enableAutoPower(TARGET_RSSI)' but the gateway does not.  Sorry for missing this now-obvious point.

T.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69-ATC in multi node network
« Reply #6 on: February 28, 2017, 02:22:41 PM »
So after reviewing the node and gateway examples the light-bulb finally appeared over my addled head.
We're all about turning on light-bulbs!

Enjoy!

gussabina

  • NewMember
  • *
  • Posts: 42
  • Country: us
Re: RFM69-ATC in multi node network
« Reply #7 on: March 04, 2017, 12:47:47 PM »
Hello TomWS:
I looked at your RFM69_ATC.cpp code and I noticed setPowerLevel() is commented out. I understand this should replace the base class in RFM69.cpp but I don't see that happening. So how does this work?

Also, shouldn't be better to include some hysteresis for the targetRSSI? I mean, due several factors, the same power level configuration could get RSSI values differing in few units, so the library will react to each those small changes, trying to correct it, consuming active current. Having a small RSSI target range, it should only adjust when values are out of the range. Just a though...

Thanks
Gus

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69-ATC in multi node network
« Reply #8 on: March 04, 2017, 01:07:21 PM »
Hello TomWS:
I looked at your RFM69_ATC.cpp code and I noticed setPowerLevel() is commented out. I understand this should replace the base class in RFM69.cpp but I don't see that happening. So how does this work?
It's unlikely to be 'my' code at this point, but I do need to know where you got the code and the rest of the context before I can answer the question.

Quote
Also, shouldn't be better to include some hysteresis for the targetRSSI? I mean, due several factors, the same power level configuration could get RSSI values differing in few units, so the library will react to each those small changes, trying to correct it, consuming active current. Having a small RSSI target range, it should only adjust when values are out of the range. Just a though...

Thanks
Gus
Each node handles their own target level so, no, there is no 'conflict' and no 'hunting' except when the RSSI received by the other end is varying (due to movement of one of the nodes, obstructions, interference, etc).  But the node only adjusts it's powerlevel no more than +/- one tic per ACK so it doesn't over react to changes in the environment.

Tom


gussabina

  • NewMember
  • *
  • Posts: 42
  • Country: us
Re: RFM69-ATC in multi node network
« Reply #9 on: March 04, 2017, 01:09:26 PM »
Hello TomWS:

This is the code;
https://github.com/LowPowerLab/RFM69/blob/master/RFM69_ATC.cpp

Why the setPowerLevel() function is commented out?

Gus

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69-ATC in multi node network
« Reply #10 on: March 04, 2017, 01:25:51 PM »
Why the setPowerLevel() function is commented out?
Ah, yes.  Felix had a different opinion on how the range should be specified and made changes to the base class setPowerLevel() to address this when he merged the ATC code into the RFM69 library.  Consequently it was no longer needed in the ATC extension.   I recall discussing the question with Felix and didn't disagree with his conclusion (although I don't remember what it was).

Tom