Raspberry Pi iBeacon扫描解析响应 [英] Raspberry Pi iBeacon Scan Parsing Response

查看:140
本文介绍了Raspberry Pi iBeacon扫描解析响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用树莓派来检测ibeacons,并阅读了Radius Networks提供的教程

I have used the raspberry pi to detect the ibeacons and gone through the tutorial provided by Radius Networks here. I made a small script that first turns on lescan and redirects output to /dev/null. Then it turns the hcidump on piping to the output to the script.

脚本显示的输出很慢.尽管广告数据包以毫秒为单位进行传输,但是在终端上的结果却很慢.因此,即使关闭变送器,该命令仍会继续显示新的输出.我的理解告诉我,解析需要花费时间,而HCIDUMP数据在sed队列中等待.

The output shown by the script is slow. While the advertisement packets are transmitted in magnitude of milliseconds, the result however on the terminal is slow. consequently, the command keeps on showing new output even if you turn off the transmitter. My understanding tells me that parsing takes its time, while the HCIDUMP data waits in the sed queue.

为了根据接近性触发适当的操作,需要最少的解析时间,以便在接收到所有数据包时对其进行解析.

For proper action to trigger according to proximity, minimum parsing time is necessary so that all packets are parsed as they are received.

如果有人使用Radius Networks提供的蓝牙开发套件,我是否错过了某些事情或解析速度更快?如果是这样,什么使它更快?

Have i missed something or parsing is faster if one uses the bluetooth development kit provided by Radius Networks? if so, what makes it faster?

谢谢

推荐答案

您是正确的,当检测到大量iBeacon广告时,脚本的输出确实会滞后.为了简化起见,解析脚本是用bash编写的,因此,它的速度会受到影响-传递到sed来存储每个标识符的过程缓慢且效率低下.该脚本已在Ruby中针对 Beacon开发套件(现称为PiBeacon)进行了重写.并且速度更快,响应速度更快. Ruby和其他高级编程语言更适合于解析和转换原始iBeacon数据包数据.可以在此处.

You are correct, the output of the script does lag behind when detecting a large magnitude of iBeacon advertisements. The parsing script was written in bash for simplicity, and its speed suffers as a result -- piping to sed to store each identifier is slow and inefficient. The script was rewritten in Ruby for the Beacon Development Kit (now called the PiBeacon) and is much faster and more responsive. Ruby and other high-level level programming languages are more well suited for parsing and converting the raw iBeacon packet data. A disk image of the development kit with this new script is available to download here.

您还可以尝试实现另一个用Python编写的iBeacon Raspberry Pi扫描脚本,该脚本可以在

You can also try implementing another iBeacon Raspberry Pi scanning script, written in Python, that can be found here. I have yet to try this out myself, but it appears to be another good solution.

这篇关于Raspberry Pi iBeacon扫描解析响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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