Some Clarification of Automatic Power Control (RFM69_ATC)

Started by jrdoner, November 30, 2015, 09:24:15 PM

Felix


TomWS

Quote from: Kilo95 on February 01, 2016, 09:30:52 PM
I set the target to -69. I watched on the serial monitor and it doesn't dial down. I put the #include rfm69_atc.h and put the radio.autopower(-69); after setup() on the node but can't get it to dial down. Also placed rfm69_atc.h in pigateway node. Also substituted rfm69_atc radio for rfm69 radio. I downloaded latest libs from GitHub. I figured it'd drop a little more than -53 or -54 at 30 feet. Maybe I'm wrong
At 30 feet, it's unlikely to be able to drop the transmit power low enough to get -69 RSSI on the receive end; -54 seems reasonable to me.   The most telling parameter is radio._transmitLevel, if this is at the minimum then that's perfect - you're not wasting any power in the connection.  Print out that value as you start up the connection and you can watch it track to its final value.

Tom


Kilo95

Ok. I didn't do anything different. Checked this morning and it's tuned down to -61. I might swap out to a half wave antenna for kicks and giggles. I know it should make more difference on the gateway moteino. Thanks for the suggestions

Kilo95

to get ATC to work, do i need to add #define ENABLE_ATC to the sketch, or just the radio.sendwithretry, enableautopower(RSSI), and the ATC radio command?

Felix


TomWS

Quote from: Kilo95 on March 16, 2016, 01:48:07 PM
to get ATC to work, do i need to add #define ENABLE_ATC to the sketch, or just the radio.sendwithretry, enableautopower(RSSI), and the ATC radio command?
Did you monitor radio._transmitLevel as I had suggested earlier?  THAT will tell you directly what the ATC is doing.

Tom

Kilo95

im using the weathershield node sketch. I assume I should put it in this section?
-------------
radio.encrypt(ENCRYPTKEY);

  sprintf(buffer, "WeatherMote - transmitting at: %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);

---------------
Would this be the correct command?

  sprintf(buffer, radio._transmitLevel);

Kilo95

ok, so i looked back into one of tom's other posts and tried to add the command to get my radio tx level. using the serial monitor in arduino, it showed tx level of 31 and RSSI 0 but it only showed that once. i'm attaching my WS sketch and PiGateway sketch. maybe someone has the time to tell me what i'm doing wrong. thanks!


Kilo95

i've been trying this to no avail. made more changes to WS sketch and it still shows the tx level is 31 and my RSSI as0. it never tunes it down. below is the WS sketch. you can disregard the WS sketch in the previous post. Any suggestions?

This is what i get in the Arduino serial monitor:
My TX level:31, my RSSI:0
BAT:4.86v F:7151 H:41 P:29.20 (packet length:29)
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
WAKEUP
My TX level:31, my RSSI:0
BAT:4.86v F:7183 H:41 P:29.20 (packet length:29)
WAKEUP

Kilo95

Sorry for all the posts. Looks like 2 of 3 nodes (possibly the third) are tuning down. Just would like to know how to check the tx power of the nodes. (Got one node tuned down to -80)😁

Felix

Quote from: Kilo95 on March 22, 2016, 08:12:15 AM
Sorry for all the posts. Looks like 2 of 3 nodes (possibly the third) are tuning down. Just would like to know how to check the tx power of the nodes. (Got one node tuned down to -80)😁
Uncomment the Serial.println statements in the RFM69_ATC.cpp interruptHook().
That will print the transmit level each time it tunes up/down.


TomWS

Quote from: Kilo95 on March 21, 2016, 08:58:30 PM
<snip>
My TX level:31, my RSSI:0
BAT:4.86v F:7183 H:41 P:29.20 (packet length:29)
WAKEUP
First, don't follow Felix's last suggestion, printing within an interrupt handler is a very bad idea.  I'm not sure why that code didn't get removed.

Secondly, where you are printing the TX level is fine, what is wrong is that your RSSI data returned by getAckRssi() is returning a 0 value, meaning that your far end is NOT sending the received RSSI, therefore no ATC will take place.  Are you using the ATC library on the far end as well?

Tom

Kilo95

Yes. I am using the ATC lib on the gateway moteino also. A couple of posts back, I attached my pigateway.ino. Only change is I disabled radio.enableautopower on the gateway and used the radiohighpower function right now. That's only on the gateway. The nodes are autopower

TomWS

Quote from: Kilo95 on March 22, 2016, 09:47:52 AM
Yes. I am using the ATC lib on the gateway moteino also. A couple of posts back, I attached my pigateway.ino. Only change is I disabled radio.enableautopower on the gateway and used the radiohighpower function right now. That's only on the gateway. The nodes are autopower
Are you able to print 'DEBUG' statements on the gateway?  Make sure that it is successfully Acking each of the nodes and, on the nodes, check the radio.sendWithRetry() return values to make sure you're receiving the ACK.

Basically, if ATC is loaded, enableAutopower is called, and you get successful ACKs from the other end, then the library will try to adjust the TX levels.

Tom