How to display the rssi value with arduino lmic?

Hi The Things Network,

I’m using the arduino lmic with my RFM95. I’m trying to display the .rssi values with Arduino, but what lmic.rssi displays and what is shown in the things network is kind of different.

The RSSI value shown by the things network usually is around -40 to -50 while
the RSSI value shown by Arduino is about 20.

Where does that difference come from? Even with the explanation of the HOPE RFM95’s datasheet I couldn’t find a conclusion

The values are different because they measure different things.

The Things Network show the rssi of the signal (that was sent by the rfm95) measured at the gateway.
The Arduino shows the rssi of the signal (that was sent by the gateway) measured at the rfm95.

Also, lmic has changed how rssi is calculated, so the number will depend on which fork and which version of lmic you are using.

In addition to being the RSSI of the downlink not the uplink, a value of 20 is obviously not a reading of RF power in dBm, but probably a raw value from a chip register. Or else one converted by an incorrect formula.

RSSI values aren’t typical precisely calibrated power measurements anyway, but usually they bear some resemblance to one. A value of 20 clearly does not.

The R in RSSI stands for Received. Accordingly (as already mentioned above) RSSI shown on the TTN console is about the node’s signal (uplink messages) received by the gateway and RSSI shown on the node is about the gateway’s signal (downlink messages) received by the node and these values can be quite different.

But in addition, the biggest difference is caused by the fact that the original Arduino LMIC library does not correctly calculate RSSI and SNR values like is documented in the Semtech SX127x (and RFM95) datasheet.

When the correct calculations for SNR and RSSI are used, the RSSI values of downlinks shown on the node and RSSI values of uplinks shown on the console will look more similar.

There were plans (last year) to add improved calculations in MCCI’s LMIC library implementation. I have not checked recent versions of MCCI’s library for if these improved calculations have been actually implemented already.

Thank you all for your great answers.

That makes sense, thank you very much!

The datasheet states something like RSSI[dBm] = -137 + RSSI-Value, therefore my actual value in this case would be -117.

That was the calculation from the 2013 datasheet, the calculation was changed considerably in the 2015 datasheet (5 years ago!).

There is a “new” datasheet? Thanks!

I’ve found it and its calculation, but it still kind of does not change very much. It also takes 0.25 * Snr in its equation and snr was like 8.

Old = RSSI[dBm] = -137 + RSSI-Value
New = RSSI (dBm) = -157 + Rssi

Seems to be quite a difference to me.

But the values don’t really make sense, don’t they? The gateway is about 2 meters away from my node. -127 dBm means the signal is barely in reach.

That in itself is not a good (even a bad) thing.
Minimum distance between node and gateway should be 3m at (very) minimum.
(This is mentioned and explained in several posts on the forum.)

Or one of your antennas is not connected.

-127 is credible in some circumstances (though wouldn’t that actually be -117, as in -137 + 20?) certainly however, -157 + 20 is not credible in any.

Don’t worry overly much about the “too close” concern yet; there are situations in which it can be an issue.

Look instead to make sure that your antennas are actually connected and that you are using the correct frequency and IQ inversion.

What is the “20” number, is it the RAW register value, or has it already been interpreted by some effort in LMiC?

Exactly my thought.

I’m using the correct antenna, one self made and another one bought for the EU frequency. What exactly is IQ inversion?

Actually I have no idea to be honest, that’s why I ask, if this value is correctly interpreted by me. It’s from LMIC.rssi and I supposed it is not changed and comes from the chip’s rssi register itself.

It seems it was fixed, for the MCCI fork:

@crackl1ng as you’re not mentioning which LMIC you’re using: I think MCCI is the preferred fork (and not just for RSSI calculations).

Thank you, I will check it out. I’m using the arduino IBM lmic library, like this one: GitHub - matthijskooijman/arduino-lmic: ⚠ This library is deprecated, see the README for alternatives.

This is what you need to study the code yourself to determine

How are u getting the RSSI Values of the Arduino?
I know how to see them in the TTN but now i want to verify the values that i get on the Board

If u can help even just little i apreciate it !!

Thank you

On the node you can only get SNR and RSSI values for downlink messages, not for uplink messages.

For an implementation of how to calculate and when to display SNR and RSSI values with LMIC see:

Thank You very much!!