【问题标题】:Raspberry Pi Bluetooth LE connection to RedBearLab shieldRaspberry Pi 蓝牙 LE 连接到 RedBearLab shield
【发布时间】:2014-02-13 12:50:51
【问题描述】:

我正在尝试从 RaspPi 连接到 RedBearLab BLE shield。我在用 CSR4.0 USB加密狗http://www.adafruit.com/products/1327 带有 Raspbian OS 的 Raspberry Pi Rev-B 板 Bluez-5.11

我将 RedBearLab BLE 扩展板连接到 Arduino UNO R3。我正在尝试从 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]>

非常感谢!

【问题讨论】:

    标签: bluetooth arduino raspberry-pi bluetooth-lowenergy bluez


    【解决方案1】:

    您的适配器似乎很忙。有东西在使用它。是否有任何其他设备连接到您的适配器?尝试使用以下方法重置您的适配器:

    $ sudo hciconfig hci0 reset
    

    【讨论】:

    • 有时您需要在 USB 级别重置它(只需拔下加密狗并重新插入即可物理完成)。我遇到了加密狗问题,以至于 HCI 重置没有做任何事情。
    • @tim-tisdall 做到了!
    • 我使用 bluez 4.99 得到 hciconfig: invalid option -- 'i',但省略 -i 似乎可以解决问题 :-)
    • 这解决了我的问题。谢谢。
    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 2014-02-22
      • 2014-02-16
      • 1970-01-01
      • 2019-05-24
      • 2015-03-27
      • 1970-01-01
      • 2021-05-01
      • 2014-10-04
      • 1970-01-01
      相关资源
      最近更新 更多