如何测量像iBeacon的iPhone与Android设备之间的距离 [英] How to measure the distance between an iPhone acting like an iBeacon and an Android device

查看:137
本文介绍了如何测量像iBeacon的iPhone与Android设备之间的距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的iPhone用作iBeacon设备,另一方面,我有一个Android 4.4.2设备扫描来自iPhone的Bluetooth LE iBeacon信号.我搜索了一种简便易行的方法来计算iBeacons与Android手机之间的距离,但是找不到任何可以帮助我解决此问题的方法.

I'm using my iPhone as an iBeacon device, and on the other side I have an Android 4.4.2 device scanning for the Bluetooth LE iBeacon signal from the iPhone. I searched for a good and easy way to calculate the distance between iBeacons and my Android phone, but I couldn't find anything that can help me with this.

在这件事上您能帮我吗?

Could you help me on this matter?

推荐答案

我们在 Android信标库的格式为:d=A*(r/t)^B+C,其中d是以米为单位的距离,r是设备测量的RSSI,t是在1米处的参考RSSI. A,B和C是常数.您可以在此处阅读更多信息.与库中,您可以找到一个信标,然后只需调用:

We built a distance estimation formula into the Android Beacon Library of the form: d=A*(r/t)^B+C, where d is the distance in meters, r is the RSSI measured by the device and t is the reference RSSI at 1 meter. A, B, and C are constants. You can read more about it here. To use it with the library, you range for a beacon and then simply call:

beacon.getDistance();

这将返回以米为单位的距离估算值.库代码是开源的,因此,如果您不想使用库,则可以复制公式并直接使用它.

This returns a distance estimate in meters. The library code is open source, so if you don't want to use the library you can copy the formula and use it directly.

正如@TwoStraws所指出的那样,距离估计值是对信标距离的粗略估计,您得到的结果受许多因素影响而有所不同:

As @TwoStraws notes, distance estimates are pretty rough guesses of how far a beacon is away, and the results you get vary with lots of factors:

  1. 接收设备上天线的增益. (每个Android设备型号略有不同)
  2. 用于测量蓝牙信号强度的电话内A/D转换器上的噪声.
  3. 房间里的无线电噪音.
  4. 发射器和接收器之间的任何障碍物.
  5. 任何反射无线电信号的表面(尤其是金属).

只要确保您设置了正确的期望即可.距离估计有助于确定一个信标是近还是远,或者一个信标比另一个信标更近.但是它们在测量绝对距离时不太有用.

Just be sure you set your expectations properly. Distance estimates are good for deciding if a beacon is close or far, or whether one beacon is closer than another. But they are less useful for measuring absolute distance.

这篇关于如何测量像iBeacon的iPhone与Android设备之间的距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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