LowPowerLab Forum

Hardware support => Moteino => Topic started by: Hank on August 15, 2013, 08:57:15 PM

Title: Power Settings? [SOLVED]
Post by: Hank on August 15, 2013, 08:57:15 PM
Felix,

Received the two RFM69HW units very fast,  thank you. Great user experience - worked right of of the box, just like you said. I have been experimenting with jeenodes - they very nice, although the learning curve for me was pretty steep ( i am an enthusiastic amateur level - it took me days and days to understand how to get usable data from one device to the other). I can see that that my learning curve with moteino is going to be drastically less. there's going to be more moteinos in my future, for sure.

OK, now my dumb question .... how can i manipulate the power level of the transmitter? I am using the latest RFM69 Node sketch from the github library. I see there are some references in the .h and .cpp files to setpowerlevel and sethighpower, etc., but I am not knowledgeable enough to figure it out. Do i need to change the .h or .cpp files, or can i can change power settings from the Node sketch in the RFM69 library?

In particular this line (line #43 in RFM69.cpp) seems to indicate that the default power settings are at their lowest level:

///* 0x11 */ { REG_PALEVEL, RF_PALEVEL_PA0_ON | RF_PALEVEL_PA1_OFF | RF_PALEVEL_PA2_OFF | RF_PALEVEL_OUTPUTPOWER_11111},

If I change PA1 and PA2 to "ON" , does that boost power? Should I also then turn off PA0? Is there also another "high power setting"?

Thanks in advance for your time and congratulations on developing a great  device. Did I mention how incredibly tiny it is?
Title: Re: Power Settings?
Post by: Hank on August 15, 2013, 09:20:45 PM
ooopsie, i should read before i write ..... there it is right in the sketch:

//radio.setHighPower(); //uncomment only for RFM69HW!

followup question, though ... does this command set the moteino to its highest power? can i set the power scale from 1 to 31, plus "boost."
Title: Re: Power Settings?
Post by: Felix on August 15, 2013, 09:46:44 PM
Hank, awesome, thanks for the feedback!
setHighPower() is a way to tell the library that it's a HW and not a W. The RFM69HW uses a different output for the amplifier so a few registers need to be used differently with a HW, otherwise the HW will not work. I updated that line that you referenced so it's more clear that it has to be uncommented if the unit has a RFM69HW.
Maybe I'll figure out a better way to do that.

To set the power output level - that is different. You need to call setPowerLevel(byte mode) - with mode = [0 .. 31]. Min=0, max=31. By default at initialization the power level is 31. So the radio outputs maximum power, so 13dBm for RFM69W and 20dBm for RFM69HW. The power is proportionally reduced by the 32 levels mentioned above using a formula that you can find in the datasheet.
Title: Re: Power Settings?
Post by: Hank on August 16, 2013, 12:37:29 PM
Got it. Thanks so much for the quick reply, Felix. I appreciate it ....

On a similar note. I took a moteino RFM69HW (433mhz) out with me while I walked the dogs last night. Basic wire antenna included with the moteino. The other was in my home office. I was getting approx. 200 meter range with half a dozen single story wood frame houses and many large trees in between. The range, even without considering substantial obstructions, blew me away. Me thinks I am going to need a very big open area for a line of sight experiment.

Thanks again ....
Title: Re: Power Settings?
Post by: Felix on August 16, 2013, 01:00:32 PM
Yeah it's pretty insane how much range you can get with these...  :D