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

查看:238
本文介绍了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

这会使用"Locate iBeacon"应用程序触发iPhone上的"Entered"事件,并以秒为单位显示距离(以米为单位).然后,它将距离:未知"显示为范围,持续几秒钟,然后发生退出"事件.当我在运行"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!

推荐答案

尝试将设备设置为广告且不可连接"(3而不是0),而不是广告且可连接"

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天全站免登陆