如何获得wifi接入点和移动设备之间的距离 [英] how to get Distance between wifi access point and Mobile Device

查看:338
本文介绍了如何获得wifi接入点和移动设备之间的距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个android应用程序,该应用程序具有搜索所有最近/检测到的wifi热点的模块。

i am developing an android application which have module to search all nearest / detected wifi hotspot.

我可以从搜索到的wifi热点中获取所有详细信息,例如
SSID,BSSID,功能,频率,级别和时间戳

i can get all detail from searched wifi hotspot like, SSID, BSSID, capabilities, frequency, level and timestamp

有了这些信息,我还需要wifi的距离(wifi接入点和移动设备之间的距离)

with these information, i also need Distance of wifi ( The distance between wifi accesspoint and Mobile Device )

我是

double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(levelInDb)) / 20.0;
double distanceM = Math.pow(10.0, exp);

这将返回以米为单位的距离。

我通过从许多页面在Google上重新搜索获得了这些代码。

i got these code by reserch on google from many pages.

但是我认为我做错了,此代码返回的距离错误。我也在Google搜索上尝试了很多,但没有得到准确的输出。

but i think i am going wrong, this code is returning wrong distance. i also tried a lot on google search but not getting accurate output.

请帮助我。我如何获得Wifi AP和移动设备之间的距离?

Please help me. how can i get Distance between Wifi AP and Mobile device?

推荐答案

此代码:


double exp =(27.55-(20 * Math.log10(freqInMHz))+ Math.abs(levelInDb))/ 20.0;
double distanceM = Math.pow(10.0,exp);

double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(levelInDb)) / 20.0; double distanceM = Math.pow(10.0, exp);

在两个之间存在自由空间路径衰减的假设下工作各向同性天线和AP以20dBm的功率发射(数学甚至不正确;自由空间路径损耗的频率依赖性不同;对于W-LAN频段而言,这并不重要,使用时,校正是在 27.55 )。

Works under the assumption of free space path attenuation between two isotropic antennas and the AP transmitting at a power of 20dBm (and the math is not even correct; the frequency dependence of free space path loss is different; not that is matters for the bands of W-LAN, uses, the correction is in the 27.55).

实际上,您正在处理各向异性天线,路径中的障碍物,衍射效应以及AP改变其功率输出的问题。

In reality you're dealing with anisotropic antennas, obstacles in your path, diffraction effects and the AP varying it's power output to save energy if no high bandwidth is required.

换句话说:仅查看接收功率来获取可靠的距离数字是完全不切实际的。它可以给您一个大概的数量级,但远不能准确。这只是基础物理学。

Or in other words: It's totally impractical to obtain a reliable distance figure just looking at the received power. It can give you a ballpark, order of magnitude, but not something that's remotely accurate. This is just basic physics.

唯一的可靠距离测量方法是飞行时间。为此,您必须测量设备与接入点之间的往返时间。由于我们要处理的光速和距离(以米为单位)长达100m(顶部),因此这意味着要测量纳秒。可以完成,但需要一些工作。请参见SatelliteSD给您的链接(该链接为德语,但图表和关键字应该可以理解)。

The only reliable way of measuring distance is time-of-flight. For this you have to measure the roundtrip time between the device and the access point. Since we're dealing with the speed of light and distances in the order of meters up to 100m (top), this means measuring nanoseconds. Can be done but requires some work. See the link SatelliteSD gave you (it's in German but the diagrams and keywords should be understandable).

这篇关于如何获得wifi接入点和移动设备之间的距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆