Raspberry Pi iBeacon 连接超时 [英] Raspberry Pi iBeacon connection timing out

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

问题描述

我目前正在尝试 RadiusNetworks 发布的 Raspberry Pi iBeacon 教程

I am currently attempting the Raspberry Pi iBeacon tutorial posted by RadiusNetworks at

http:///developer.radiusnetworks.com/2013/10/09/how-to-make-an-ibeacon-out-of-a-raspberry-pi.html

但我在几秒钟后遇到连接超时问题.我执行了一个全新的 raspbian 构建,并尝试了 2 个不同的加密狗(AZIO V400 和 IOGEAR GBU521),我已经尝试过根据教程使用 Bluez 5.8 以及 Bluez 5.11,两者都在新的 Raspbian 负载上.

but I am having issues with the connection timing out after a few seconds. I have performed a fresh build of raspbian, and have tried with 2 different dongles (AZIO V400 and IOGEAR GBU521), and I have tried with Bluez 5.8 per the tutorial as well as Bluez 5.11, both on fresh Raspbian loads.

当我调用启动脚本时,我看到:

When I call the start script I see:

pi@piBlueTest ~ $ ./start
Launching virtual iBeacon...
LE set advertise enable on hci0 returned status 12
< HCI Command: ogf 0x08, ocf 0x0008, plen 44
  1E 02 01 1A 1A FF 4C 00 02 15 E2 C5 6D B5 DF FB 48 D2 B0 60 
  D0 F5 A7 10 96 E0 00 00 00 00 C9 00 00 00 00 00 00 00 00 00 
  00 00 00 00 
> HCI Event: 0x0e plen 4
  01 08 20 00 
Complete

这会使用定位 iBeacon"应用在 iPhone 上触发进入"事件,并在几秒钟内以米为单位显示距离.然后它会显示距离:未知"作为范围,持续几秒钟,然后发生退出"事件.当我在运行hcidump"的情况下运行序列时,我得到

This triggers an "Entered" event on the iPhone using the "Locate iBeacon" app, and shows a distance in meters for a few seconds. It then shows "Distance: unknown" as the range for several more seconds, followed by an "exit" event occurring. When I run the sequence with "hcidump" running, I get

HCI sniffer - Bluetooth packet analyzer ver 5.11
device: hci0 snap_len: 1500 filter: 0xffffffff
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Advertise Enable (0x08|0x000a) ncmd 1
    status 0x0c
    Error: Command Disallowed
< HCI Command: LE Set Advertising Data (0x08|0x0008) plen 44
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Advertising Data (0x08|0x0008) ncmd 1
    status 0x00
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15
    min 1280.000ms, max 1280.000ms
    type 0x00 (ADV_IND - Connectable undirected advertising) ownbdaddr 0x00 (Public)
    directbdaddr 0x00 (Public) 00:00:00:00:00:00
    channelmap 0x07 filterpolicy 0x00 (Allow scan from any, connection from any)
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Advertising Parameters (0x08|0x0006) ncmd 1
    status 0x00
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
> HCI Event: Command Complete (0x0e) plen 4
    LE Set Advertise Enable (0x08|0x000a) ncmd 1
    status 0x00
> HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x00 handle 64, role slave
      bdaddr B8:F6:B1:1C:15:C8 (Public)
> ACL data: handle 64 flags 0x02 dlen 11
    ATT: Read By Type req (0x08)
      start 0x0001, end 0xffff
      type-uuid 0x2a00
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 64 reason 0x13
    Reason: Remote User Terminated Connection

似乎 iPhone 正在尝试启动与 pi 的连接,然后在协商该连接时失败,从而终止了广告.

It appears that the iPhone is trying to initiate a connection to the pi, and then fails at negotiating that connection which then ends the advertisement.

我已经完成了从教程到信件的步骤,似乎无法确定是什么导致了断开连接.我尝试更改 bluez 版本,并尝试不同的硬件,但无济于事.任何想法我可能会遗漏哪一步?我已经搜索了所有我能想到的线索,但还没有找到答案.提前感谢您的任何建议!

I have completed the steps from the tutorial to the letter, and cannot seem to determine what is causing the disconnect. I have tried changing bluez versions, and tried different hardware, but to no avail. Any ideas what step I may be missing? I have searched everything I can think of for clues, but have not found the answer yet. Thanks in advance for any advice!

推荐答案

尝试将设备设置为advertise and not-connectable"(3 而不是 0)而不是advertise and connectable"

Try setting the device to "advertise and not-connectable" (3 instead of 0) instead of "advertise and connectable"

sudo hciconfig $BLUETOOTH_DEVICE leadv 3

由于笔记本电脑尝试连接,我们突然发现一个信标在几秒钟后关闭.将设备设置为不可连接解决了问题.

We suddenly had a beacon going down after a few seconds due to a laptop trying to connect. Setting the device to not-connectable solved the problem.

这篇关于Raspberry Pi iBeacon 连接超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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