### Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

• Hi there, i am not the expert. I am using 2 node and 1 gateway where using rssi value to calculate the distance. Distance calculated using the formula :
Distance = 10 ^ ((Tx power - RSSI) / (10*n))

The tx power i obtained in the lora.stats() show me 20dBm in the range of 0 - 2m. tx power keep on 20 dBm with the change of distance. Is it i can use the tx power as well?

• @mj Depends on the antenna an it's set-up. With a short wavelength/4 antenna, I had values between 25 and 39 dBm, even depending on how I was placing myself. The wavlength/4 antennas are typicall about 10cm (4") long, whereas wavelength/2 antennas have a length of about 20 cm (8").

• @robert-hh I have tested again by pointing the antenna straight upward in 1m the rssi value that i obtained is around -37dBm. Is it looks reasonable?

and the derivation of the inital formula furtehr down the side, it seems that TxPower in the formula cites by MJ is the RSSI seen at a distance of 1 m. In my tests with two LoPy, that was in the range of 25dBm. Assuming that the power decrease by the suqre of the distance, 60dBm for a 10m distance seems not complete off, maybe a littel bit higher than expected (40dBm difference -> factor 100 == 10**2).

• @burgeh

Yes -60dBm is a reasonable value for LoRa

• @seb When I have two LoPys close together, and connect through raw LoRa my RSSI is still around -30dBm that seems bad for such a close range. Putting them even further away (10m) puts them around -60dbM. Is this about right?

• @mj

What do you mean by RX power? The RSSI is the power of the signal that was received measured in dBm.

• @seb
But from lora.stat() it does not have the RX power. how can i obtain? Is there a way to obtain?

• @mj

The RSSI value from `lora.stats()` is "the received signal strength in dBm" as per: https://docs.pycom.io/chapter/firmwareapi/pycom/network/lora.html#lorastats

• @seb
Is there any chances to obtain the RX power?

• Please see the `tx_power` parameter of the lora constructor.

• @seb
As u mentioned the TX power will remained the same unless we change it. But how can we change the TX power in the module?

• @mj said in Nano- gateway rssi:

@bmarkus
Using rssi to calculate the distance is just a test. So is it still can make it to get the distance?

Sure, the only question is the accuracy and what do you want to achive :)

• @bmarkus
Using rssi to calculate the distance is just a test. So is it still can make it to get the distance?

• @mj said in Nano- gateway rssi:

@jcaron
I am using the RSSI in order to get the distance. But which formula should i refer to? Because this is a backup for my project which in the jungle their will be no signal so using the rssi value i can get the distance.

You can't use RSSI to calculate distance on a reliable way. Environment has an ifluence, like rain, vegetation plus if device is moving changing antenna position.

• @jcaron
I am using the RSSI in order to get the distance. But which formula should i refer to? Because this is a backup for my project which in the jungle their will be no signal so using the rssi value i can get the distance.

• The basic principle is that you reverse a link budget equation to find the free space path loss component, and then find the distance for that component.

``````RSSI = TX Power + TX gain - TX loss - Path loss + RX gain - RX loss
``````

So

``````Path loss = TX Power + TX Gain - TX loss + RX gain - RX loss - RSSI
``````

If you change antenna, the same TX Power and path loss give a different RSSI (and vice versa). This affects the computation (the value of `n` in the OP's formula).

• Are you talking about ERP? No antenna gain in the formula.

• In your formula, you should use the TX power of the sender (usually fixed, known in advance), and the RSSI measured on the receiver (this one will vary).

However be aware that this will give you very approximate results. Even with a fixed setup, RSSI can vary quite a bit, and of course there are lots of parameters that will have an effect on the result, including antenna gains, cable losses, obstacles, multi path, etc.

• @mj

Yes the tx should not change with the distance. The gateway will always transmit at the same power because it does not know how far away the nodes are.