2014-01-23 34 views
1

我想连接到RaspPi的RedBearLab BLE shield。我使用 CSR4.0 USB加密狗http://www.adafruit.com/products/1327 树莓裨启-B板与Raspbian OS 配合bluez-5.11树莓派蓝牙LE连接到RedBearLab shield

我具有连接到Arduino的UNO R3的RedBearLab BLE屏蔽。我试图连接RaspPi(附加CSR4.0)的屏蔽。但它无法连接 - 连接尝试超时/资源繁忙。

下面的步骤我用

$ sudo hcitool lescan 

LE Scan ... 
xx:xx:xx:xx:xx:xx BLE Shield 
$ sudo hcitool lecc xx:xx:xx:xx:xx:xx 

无法建立连接:连接超时

使用gatttool不能解决问题,或者

$ sudo gatttool -b xx:xx:xx:xx:xx:xx --interactive 

[ ][xx:xx:xx:xx:xx:xx][LE]> **connect** 

Attempting to connect to xx:xx:xx:xx:xx:xx 

Error: connect error: Device or resource busy (16) 

[xx:xx:xx:xx:xx:xx][LE]> 

感谢一大堆!

回答

2

好像你的适配器很忙。有东西在使用它。有没有其他设备连接到您的适配器?尝试重置您的适配器:

$ sudo hciconfig hci0 reset 
+1

有时您需要在USB级别重置它(可以通过拔下dongle并重新插入来实现)。我遇到了加密狗的问题,因此HCI重置没有做任何事情。 –

+0

@ tim-tisdall做到了! – nad

+1

我得到'hciconfig:无效选项 - '我'使用蓝色4.99,但省略'-i'似乎做了诀窍:-) – ssc

1

某些BLE设备在连接时需要一个随机地址。请尝试:

sudo gatttool -t random -b xx:xx:xx:xx:xx:xx --interactive