is there a way to have the transmit power level of the nodes reported to the gateway? I've got one node ~175 feet from the house and it shows RSSI between -89 and -100. I have ATC enabled but would like to see what the output power is. It'd be fun if it showed up like the RSSI on the gateway page.
Sure, just send a new metric, and define it in metrics.js.
The transmit level is in RFM69_ATC._transmitLevel.
It was something I was thinking to add, so you can compare the transmit level vs RSSI.
if you were thinking of it adding it, i'll probably just wait til you get around to it.
Should be very simple:
TXLV : { name:'TXLV', regexp:/\bTXLV\:(-?\d+)\b/i, value:'', duplicateInterval:3600, unit:'', pin:0, graph:1, graphValSuffix:'TXLV', graphOptions:{ legendLbl:'TXLevel', lines: { lineWidth:1 } }},
Then just read the level and send it as a new token:
TXLVL:value (should be 0 to 31).
i will give that a try. thanks
so, would it be as simple as placing:
DEBUG(" [TXLVL:");DEBUG(RFM69_ATC._transmitLevel);DEBUG("]");
right after this:
DEBUG(" [RX_RSSI:");DEBUG(radio.RSSI);DEBUG("]");
??
DEBUG is for ... serial DEBUGging.
Your transmitting node needs to send that metric.
And all metrics (except the special RSSI) should be nam:value without [] or any other characters.
Quote from: Felix on December 19, 2017, 03:27:26 PM
And all metrics (except the special RSSI) should be nam:value without [] or any other characters.
TXLVL:25in weather node
sprintf(buffer, "BAT:%sv F:%s H:%s P:%s", BATstr, Fstr, Hstr, Pstr);
sendLen = strlen(buffer);
radio.sendWithRetry(GATEWAYID, buffer, sendLen, 1); //retry one timein variable
buffer you put
BAT:5.02v F:53.2 H:72.4 P:28.5then you calculate what is the length of
bufferthen you send to gateway,
BAT:5.02v F:53.2 H:72.4 P:28.5, and length of this
bufferOn gateway itself (PI) you need to "teach it" to understand what to do with "TXLV" and you do this with
TXLV : { name:'TXLVL', regexp:/\bTXLVL\:(-?\d+)\b/i, value:'', duplicateInterval:3600, unit:'', pin:0, graph:1, graphValSuffix:'TXLV', graphOptions:{ legendLbl:'TXLevel', lines: { lineWidth:1 } }},in userMetrics/_example.js
AND NOTE THIS: you need to send TXLV or TXLVL
It has to be one or the other (the same) on PI gateway and what is node sending
so all i need to change on the weathershield node is:
sprintf(buffer, "BAT:%sv F:%s H:%s P:%s", BATstr, Fstr, Hstr, Pstr);
sendLen = strlen(buffer);
radio.sendWithRetry(GATEWAYID, buffer, sendLen, 1); //retry one time
?? then change the metrics.js. I think I could have fumbled my way through the metrics.js work but the node would have given me trouble
or is this correct?
sprintf(buffer, "BAT:%sv F:%s H:%s P:%s TXLVL:%s", BATstr, Fstr, Hstr, Pstr, TXLVLstr);
sendLen = strlen(buffer);
radio.sendWithRetry(GATEWAYID, buffer, sendLen, 1); //retry one time
Kilo95, your last piece of code should work.
You can always try it right away too ;)
You could do this...
sendlen = sprintf(buffer, "BAT:%sv F:%s H:%s P:%s TXLVL:%s", BATstr, Fstr, Hstr, Pstr, TXLVLstr);
radio.sendWithRetry(GATEWAYID, buffer, sendLen, 1); //retry one time
Tom
Quote from: Felix on December 20, 2017, 10:38:48 AM
Kilo95, your last piece of code should work.
You can always try it right away too ;)
lol. you are correct. i am at work though and won't be home until tomorrow. that's why i replied with what I hoped would work. i'll try it the next day or so. i can remote in and at least do the metrics.js file
thanks to tom too. gives me a couple of ideas to try out!
Or this...
sendlen = sprintf(buffer, "BAT:%sv F:%s H:%s P:%s TXLVL:%i", BATstr, Fstr, Hstr, Pstr, RFM69_ATC._transmitLevel);
radio.sendWithRetry(GATEWAYID, buffer, sendLen, 1); //retry one time
On a second thought, keeping tokens as short as possible would be preferred.
So maybe a shorter metric name TXP:value rather than TXLVL? Could even be 1 letter or character (unque from other metrics) but that's less human readable.
Whatever works though..
will this be universal for all in next build?
If so, TXP sounds ok so does TXL, short and also human readable
I'll try it the other way since I have it setup already on my gateway. If it doesn't work well, I'll try shortening the name. Thanks for the thought
TXP would imply power, ie dBs, which is not the case. It's just a range of levels which translate to different dBs depending if it's a W/CW or HW/HCW.
I would keep TXL. The metric description/legend can elaborate.
Either way it's customizable if one really wants that, this is just my own preference.
is there a chart somewhere with the conversions for TXL to dbm? i vaguely remember seeing it somewhere. i'll have some time this next week to work on fixing the code for the nodes. i was able to remote into my RPi the other day to fix the metrics.js. i'll update when i get it done
I tried the last piece of code I suggested but when I compile it says it's not declared. I assume that means I need to tie it to rfm69atc file. How do I do that?
What's not declared?
#import <RFM69ATC.h>