gpt4 book ai didi

raspberry-pi - Raspberry Pi iBeacon连接超时

转载 作者:行者123 更新时间:2023-12-04 04:59:30 27 4
gpt4 key购买 nike

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

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上进行了全新加载。

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

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”的序列时,我得到
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的连接,然后无法协商该连接,从而终止了广告。

我已经完成了从教程到撰写信函的步骤,似乎无法确定是什么原因导致了断开连接。我曾尝试更改bluez版本,并尝试了不同的硬件,但无济于事。有什么想法我可能会缺少的步骤吗?我已经搜索了所有我能想到的线索,但是还没有找到答案。在此先感谢您的任何建议!

最佳答案

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

sudo hciconfig $BLUETOOTH_DEVICE leadv 3

几秒钟后,由于一台笔记本电脑试图连接,我们突然有一个信标掉了下来。将设备设置为不可连接可解决此问题。

关于raspberry-pi - Raspberry Pi iBeacon连接超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20252587/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com