yj-16009 iBeacon 接近 BLT 信标

发布于 2025-01-16 21:29:21 字数 877 浏览 6 评论 0原文

我正在使用 Esp32 whroom 制作一个项目,所以我购买了 yj-16009 iBeacon DataSheet 我正在尝试让它作为无线蓝牙接近传感器工作,就像这样 视频

我使用了这个 代码 来自视频,esp32 正在监控并显示 BLT 扫描像 this 这样的结果显示的结果是在我关闭周围的任何 BLT 设备之后,所以首先我不'我不明白它在读什么,在我打开 iBeacon 后,无论我将 iBeacon 拉得更近还是更远,结果都保持相同的数字范围,因此我得出的结论是它无法识别 iBeacon 传感器为了出于某种原因。

我还下载了一个名为 LightBlue 的应用程序,它可以识别 iBeacon 传感器。

我的问题是是否有人知道如何让 esp32 识别 iBeacon 传感器。另一件事是我试图找到有关该传感器的任何信息,但在任何地方都没有有关它的信息。我在这里读到其他问题,它可能需要以某种方式进行编程,但我不知道该怎么做,因为网上没有信息。因此,如果有人熟悉这种传感器并且可以帮助我弄清楚如何使 ibeacon 像上面的视频一样作为蓝牙近距离设备工作,那将是一件幸事。

I'm making a project with Esp32 whroom, so I bought the yj-16009 iBeacon DataSheet and I'm trying to get it to work as wireless Bluetooth proximity sensor like in this Video

I used the this code from the video and the esp32 is monitoring and showing BLT scanning results like this the results shown are after I turned off any BLT device around so first I don't understand what it is reading, and second after I turn on the iBeacon the results remain with the same range of numbers no matter if I get the iBeacon closer or farther, therefor I came to the conclusion that it doesn't recognize the iBeacon sensor for some reason.

I also download an app named LightBlue which does recognize the iBeacon sensor.

My question is if anyone knows how to make the esp32 recognize the iBeacon sensor. Another thing I tried to find any information about this sensor and there is no info about it anywhere. I have read on other questions here that it might need to be programmed somehow which I don't know how to do because there is no info online. So if anyone is familiar with this kind of sensor and can help me figure how to make the ibeacon to work like the video above as a Bluetooth Proximity device it would be a blessing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不再见 2025-01-23 21:29:21

您引用的代码只是扫描任何 BLE 广告(iBeacon 或其他)并打印出每次检测的 RSSI 信号强度。当您移动信标时,您看不到 RSSI 变化的原因是 ESP32 可能从您的手机、笔记本电脑和附近未移动的其他支持蓝牙的设备中接收到非 iBeacon 广告(您周围的设备比您周围的设备多)你认为!)

为了使设备仅检测 iBeacon(而不是所有其他设备),您需要更改 C 代码以执行更多操作:

  1. 访问广告有效负载的字节并按如下方式使用它们:
  2. 比较这些的开始字节以查看它们是否包含 iBeacon 字节序列 FF 4C 00 02 15
  3. 如果上述字节序列不在广告数据中,则忽略该检测 - 它不是 iBeacon 广告
  4. 如果它确实包含该字节序列,则解码接下来的 16 个字节作为 iBeacon uuid,接下来的两个字节作为主要字节,接下来的两个字节作为次要字节。请在此处查看我的答案:什么是 iBeacon 蓝牙配置文件
  5. 打印出标识符与代码已经打印的RSSI。

The code you reference is just scanning for any BLE advertisements (iBeacon or otherwise) and printing out the RSSI signal strength of each detection. The reason you do not see the RSSI change when you move the beacon is because the ESP32 is probably picking up non-iBeacon adverts from your phone, laptop and other Bluetooth enabled devices in the vicinity which are not moving (there are more around you than you think!)

In order to make the device detect iBeacon only (and not all the other devices) you need to change the C code to do a few more things:

  1. Access the bytes of the advertisement payload and use them as follows:
  2. Compare the beginning of these bytes to see if they include the iBeacon byte sequence FF 4C 00 02 15
  3. If the above byte sequence is not in the advertising data, ignore that detection — it is not an iBeacon advert
  4. If it does include that byte sequence, decode the next 16 bytes as the iBeacon uuid, the next two bytes as the major and the next two bytes as the minor. See my answer here: What is the iBeacon Bluetooth Profile
  5. Print out the identifiers along with the RSSI that the code already prints.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文