Hi,
Should the test for RSSI be ">" not "<" in canSend() since these are negative numbers?
bool RFM69::canSend()
{
if (_mode == RF69_MODE_RX && PAYLOADLEN == 0 && readRSSI() < CSMA_LIMIT) //if signal stronger than -100dBm is detected assume channel activity
{
setMode(RF69_MODE_STANDBY);
return true;
}
return false;
}
Lower (more negative) is less signal strength (ie a farther transmitting node will have lower value than a closer transmitting node, receiving base being the same).
To give some numbers ... -100dBm is very weak, compared to -60dBm. A -30dBm signal is very strong.
So if I get -30 from readRSSI(), isn't that greater than -100 for the condition to be true and canSend returns true?
Yes -30 > -100
How you interpret it is up to you.
So... should the code I referred to be change to > from <?
No
Thanks - was thinking in reverse (that it needed a good RSSI)
well the farther a transmitter is the weaker signal and (RSSI lower as in more towards -100 which is the limit in the lib by default). The decrease is logarithmic not linear, quite important to mind that detail.
Yes, I understand. Wondering if a great way to save power & battery life is to have code to adjust the transmitter power based on the RSSI received (-30db means that the gateway would not need to be full power, but at -80db keep all PA's on)?
Thanks
RX mode doesn't have power levels only the TX mode. So you'd have to tell your node to turn power lower. Doable, but I'd like metrics before I recommend that.