Author Topic: RFM69 library extensions for finer power granularity with RFM69-HW (RFM69_ATC)  (Read 318516 times)

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #15 on: November 14, 2015, 11:33:01 AM »
Yes, I'm not using the high-powered radio so there is no define or setHighPower() function called.

I do have one other question.  Is there any possibility of OTA updates not working now?  I used to update the outdoor unit OTA before the ATC upgrade.  I just tried this morning and I can't seem to connect OTA.  Do I need to setup the Moteino that I use as the OTA gateway to also use ATC?

Or did I break something somewhere else?
If you are using the same 'radio' object, now defined as RFM69_ATC type, in your CheckForWirelessHEX() call it should work just as any other case.  I will admit, however, I do not use WirelessHEX69 library so maybe something is broken, but it shouldn't be, the RFM69 methods are virtualized (I'm assuming that you did pick up the latest virtualized version) so the WirelessHEX69 functions will call the base class through the RFM69_ATC methods.

Tom


syrinxtech

  • Sr. Member
  • ****
  • Posts: 347
  • Country: us
    • Syrinx Technologies
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #16 on: November 14, 2015, 12:05:44 PM »
The node running the CheckForWirelessHEX() code is running the new RFM69_ATC radio type.  The node running the OTA gateway is still using the "old" RFM69 radio type.

Just out of curiosity, do you program OTA, and if yes, what do you use if not the WirelessHEX69 library?




TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #17 on: November 14, 2015, 01:03:34 PM »
The node running the CheckForWirelessHEX() code is running the new RFM69_ATC radio type.  The node running the OTA gateway is still using the "old" RFM69 radio type.
This combination should work.  Unfortunately, I'm not in a position to test it and won't be for a while.  If you're stuck, then probably the best bet is to back out to the standard library for the time being.

Quote
Just out of curiosity, do you program OTA, and if yes, what do you use if not the WirelessHEX69 library?
Yes, I do program OTA but with my own method...  I use the std Moteino bootloader (at least until I get Joe's running), but put the image in flash with a different set of functions.

Tom

Tom

syrinxtech

  • Sr. Member
  • ****
  • Posts: 347
  • Country: us
    • Syrinx Technologies
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #18 on: November 14, 2015, 02:07:37 PM »
Thanks.

I was able to plugin directly and updated the code.  I did update the WirelessHEX library code.  I haven't tried it again but I will give it another shot.

Nuudeli

  • NewMember
  • *
  • Posts: 14
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #19 on: November 25, 2015, 04:39:46 PM »
Thanks for great addition to library!

One suggestion: for HW/HCW it could be better to use range from 16-31 instead of 0-15. In HW/HCW datasheet it is said that "Only the 16 upper values of OutputPower are accessible" and John found out that it gives more output power when using values from 16-31. See this post: https://lowpowerlab.com/forum/index.php/topic,362.msg2136.html#msg2136

Tested this shortly with RSSI measurement and at least RSSI is showing 1-2dB improvement.. For more accurate results it should be measured with SA or power meter.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #20 on: November 25, 2015, 07:05:52 PM »
Thanks for great addition to library!

One suggestion: for HW/HCW it could be better to use range from 16-31 instead of 0-15. In HW/HCW datasheet it is said that "Only the 16 upper values of OutputPower are accessible" and John found out that it gives more output power when using values from 16-31. See this post: https://lowpowerlab.com/forum/index.php/topic,362.msg2136.html#msg2136

Tested this shortly with RSSI measurement and at least RSSI is showing 1-2dB improvement.. For more accurate results it should be measured with SA or power meter.
Thanks, I'll have to check out the range difference. IIRC I didn't notice a significant difference between the two ranges (other than the wrap at 16), but I can't say my test environment at the time was very sophisticated either.  If you're confident in your measurements, I'll be happy to update the library because it's going to be a while before I can test it again.

Tom

Nuudeli

  • NewMember
  • *
  • Posts: 14
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #21 on: November 26, 2015, 03:01:34 PM »
Hi,

Tested that again with different setup and it seems to work at least for highest power levels. So I'm going to continue by using 16-31. :)

***
    if (powerLevel < 48) {
      //_powerLevel = powerLevel & 0x0f;  // just use 4 lower bits when in high power mode
     _powerLevel = powerLevel - 16;
      _PA_Reg = 0x20;
    } else {
      _PA_Reg = 0x60;
      if (powerLevel < 50) {
        _powerLevel = powerLevel - 18;  // leaves 14-15
        //_powerLevel = powerLevel - 34;  // leaves 14-15
      } else {
        if (powerLevel > 51)
          powerLevel = 51;  // saturate
        _powerLevel = powerLevel - 20;  // leaves 14-15
        //_powerLevel = powerLevel - 36;  // leaves 14-15
      }
***

Cheers,
Tommi

Jferns

  • NewMember
  • *
  • Posts: 5
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #22 on: December 05, 2015, 12:28:27 AM »
Found an issue with ATC https://lowpowerlab.com/forum/index.php/topic,1447.msg10090.html#msg10090

Power is being adjusted only on Acks. Deadlocks can occur. See my post above.

---JFerns

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #23 on: December 05, 2015, 10:55:18 AM »
Found an issue with ATC https://lowpowerlab.com/forum/index.php/topic,1447.msg10090.html#msg10090

Power is being adjusted only on Acks. Deadlocks can occur. See my post above.

---JFerns

Thanks JFerns,
I am aware of this and it was discussed with TomWS before I merged his changes. There is an assuption that the ATC nodes are stationary or not moving significantly between transmissions. If you want the best chance of receiving a packet on a very mobile node then I suggest using the regular RFM69 library without including ATC.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #24 on: December 05, 2015, 10:59:38 AM »
Found an issue with ATC https://lowpowerlab.com/forum/index.php/topic,1447.msg10090.html#msg10090

Power is being adjusted only on Acks. Deadlocks can occur. See my post above.

---JFerns
The 'deadlock', as you describe it, is no different than using a fixed transmission level and moving out of range.  See my response in https://lowpowerlab.com/forum/index.php/topic,1447.msg10099.html#msg10099.

Tom

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #25 on: April 04, 2016, 11:30:40 AM »
I've just added a change to the ATC lib to allow the mote dialing power up when it can't get the ACK through. Without this change, a lower threshold would effectively lockup the end mote. You may want to try this or increase your ATC threshold.
See this comment and Tom's response for more details.

Jferns

  • NewMember
  • *
  • Posts: 5
Re: RFM69 library extensions for finer granularity of power with HW devices
« Reply #26 on: April 14, 2016, 07:55:09 PM »
Thanks Felix.
Perfect.   :)

SaffellBot

  • NewMember
  • *
  • Posts: 9
  • Country: us
The ATC library seems amazing, but I can't get it to compile on codebender (haven't tried anywhere else yet). I copied the library off of the github, along with the node code. Oh both my own code, and the node code, I get the following errors:

Code: [Select]
(personal library file) RFM69_ATC/RFM69_ATC.cpp:111:18: error: use of undeclared identifier 'RFM69_CTL_SENDACK'
    SPI.transfer(RFM69_CTL_SENDACK | (sendRSSI?RFM69_CTL_RESERVE1:0));  // TomWS1  TODO: Replace with EXT1
                 ^
(personal library file) RFM69_ATC/RFM69_ATC.cpp:118:32: error: use of undeclared identifier 'RFM69_CTL_REQACK'
    SPI.transfer(_targetRSSI ? RFM69_CTL_REQACK | RFM69_CTL_RESERVE1 : RFM69_CTL_REQACK);
                               ^
(personal library file) RFM69_ATC/RFM69_ATC.cpp:118:72: error: use of undeclared identifier 'RFM69_CTL_REQACK'
    SPI.transfer(_targetRSSI ? RFM69_CTL_REQACK | RFM69_CTL_RESERVE1 : RFM69_CTL_REQACK);
                                                                       ^

Any help?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Sorry but I can't keep up with codebender, they should pull the latest releases automatically.
You might want to use a local Arduino IDE for more control.

SaffellBot

  • NewMember
  • *
  • Posts: 9
  • Country: us
I didn't realize that the codebender code wasn't necessarily maintained. It worked fine without ATC. I've updated the RFM69 library as a personal library from github and it compiles now. Thanks!