# Use rssi measure the distance

Hello there
I do not have iphone, do I want to use Raspberry indoor positioning
I want to use RSSI to measure the distance, but found that the measured conversion per meter distance error is large, may I ask how did you measure?

formula:
d = 10 ^ ((P-Rssi) / 10n) (n ranges from 2 to 4)
This is most commonly seen rssi change the distance formula

How do I calculate an accurate distance

thank you

1 Like

Hey,

The formula youâ€™re using is indeed one of the most popular (slightly more about where it comes from in this post: Determine accurate distance of signal)

From now on you have everything you need to calculated distance. P in your formula is TxPower which beacons are transmitting as part of the package and Rssi you should get from your device. The most common n Iâ€™ve seen is 2-2.5.

As of accurate distance thatâ€™s longer story. Beacon signal is quite â€śunstableâ€ť and youâ€™ll get a lot of jumping of values. So you should probably take a few values and average them over time, i.e. over last second (so called â€śsmoothingâ€ť). And still if you have a lot of interference in your area, itâ€™s still gonna be a bit off. Beacons are not great for calculating accurate distance. Theyâ€™re more about saying youâ€™re in close proximity or not of some object.

3 Likes

Hi
Thank you, I understand
But the beacon to the TxPower
I actually different Rssi values measured one meter
It is recommended to use the actual measurement or beacon provided TxPower

Beacon TxPower: -60dbm
The actual measured 1 meter: -47dbm

Iâ€™m sorry English is not good > <

Yeah, youâ€™re not gonna get perfect results. Itâ€™s not very precise. Using higher broadcast power should give you better accuracy at short distances, but it wonâ€™t make thing drastically better.

Whatâ€™s your use case, what do you want to use the distance for? Maybe weâ€™ll be able to suggest some other solution.

Because I want to know the track and the distance between the target
butâ€¦ now
Why I can not adjust the release time interval

There may be my battery remaining 108 days it?

Iâ€™m just curious what do you want to use the distance for? Is there any specific use case you have in mind (e.g., you want to open the door with your Raspberry Pi when somebody gets close enough to it), or are you simply playing the technology, exploring whatâ€™s possible?

Why I can not adjust the release time interval

Hmm, are you getting any error?

I want to use three beacon to Locate
soâ€¦ I ned distance

but now Why I can not adjust the release time interval
I change the time interval to 201ms
He will own and then jump back to 953ms

Well, yes, but why do you need the location? Is the Raspberry Pi attached to something, a robot you want to steer and thus you need to know its position? Weâ€™ll be happy to help you all the way we can, but we need to know what youâ€™re trying to do

Knowing the location is just a tool, but you surely have something specific you want to use this tool, the location, for, and thatâ€™s where we might be able to helpâ€”suggest a better alternative, etc.

As for the more immediate problem, the intervalâ€”which app is that? Estimote iOS? Estimote Android?

Thanks Piotr
I want to use is positioned within a space in which people can know the position, and then the means to achieve control, such as lights, doors, fans â€¦ and so on, so from Beacon achieve a positioning function.

Home automation, thatâ€™s a nice idea! But uh, you want to be carrying Raspberry Pi with you at all times? (:

Thatâ€™s rather impractical, I think using your phone for indoor positioning would be better. You said you donâ€™t have an iPhone, do you have an Android phone? You can try our Proximity app template to see how you can detect when somebody moves from one beacon to another:

You could use that to control the home appliances, e.g., if the app detects you moved from the beacon in the kitchen to the beacon in the living room, turn the lights off in the kitchen, etc.

What do you think?

Hi!
Yes I want to be carrying Raspberry Pi with you at all times,because I will be installed sensor (Measuring body sensor)

I want know yours Locate app how to work
only need to beacon
Do not need any senser

1 Beacon Error Accuracy
ex: 2m maybe 1.5~2.5 error 0.5
Have you tried it??

Thanks

To give this a legitimate answer there are a few steps you need to take to create an accurate localization system using these beacons.

The first thing youâ€™ll need is to develop a path loss model, this is similar to what youâ€™re doing in the original post. A pathloss model can help calculate distances based on transmit power and Rssi (received signal strength).
Once you have a solid pathloss model (youâ€™ll need to do empirical testing with these devices to help find the shadow fading), youâ€™ll need to adopt an algorithm. This could be trilateration, least means squares, maximum likelihood, thereâ€™s many algorithms to choose from. Essentially youâ€™ll be calculating distances from your three points and using these distances in your algorithm to determine a point of localization.
For simplicity to start Iâ€™d recommend trilateration or Least Means with channel modeling:

Hereâ€™s where it gets interesting. You want extreme accuracy? Thatâ€™s actually cutting edge research at the moment, everyone is hiring for indoor localization google, amazon, estimote, etc. So if you can figure this out youâ€™ve got a pretty guaranteed job.

To give you a starting point and some search terms, youâ€™re going to need a probability/statistical analysis associated with your algorithm. One example is Cramer Rao lower bound. When using estimated distances, which is what your pathloss model is calculating, we can use statistical analysis to determine a maximum likelihood of certain point to be accurate. This would require you to take empirical measurements within the building youâ€™re trying to localize. Basically you find points where your accuracy is very good to all 3 beacons or access points. You can calculate centroids based off of this data set and create a model to determine probabilities of accuracy.

I understand this is all gibberish without learning the basics behind it. Iâ€™m in the process of finishing a paper on this exact topic that has lots of great examples and will link it here when Iâ€™m done.

Hello waxds0056

what units you are using for Tx-Power (W,mW or dBm)?
and
what units you used for RSSI (dBm or dB)?