A.vk
A.vk

Reputation: 11

Wifi RSSI signal to distance calculation method with javascript

Is there a method to convert a RSSI signal to an exact distance? We tryed several formulas but all with a different result.

The formula where i'm talking about:

public double calculateDistance(double signalLevelInDb, double freqInMHz) { double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(signalLevelInDb)) / 20.0; return Math.pow(10.0, exp); }

Upvotes: 1

Views: 3118

Answers (1)

jk72
jk72

Reputation: 31

RSSI and dBm measure strength, which is dependent on many factors, one of which is of course distance from the source. RSSI is relative to the chipset of the device (see http://www.metageek.com/training/resources/understanding-rssi.html). Unless you javascript can know the chipset of the device, I don't beleive there is a way that you can do what you want.

If you have the signal strength in dBm, you could attempt to classify an "effective" distance, which would approximate the distance based on the signal strength, but even that is mitigated by other factors such as the medium through which the signal travels, the frequency band used by the signal (2.4 penetrates better than 5Ghz e.g.)

It sounds like you really need geolocation services so you can identify the actual distance between the device and the access point.

Upvotes: 2

Related Questions