【问题标题】:Connecting BLE device to Raspberry fails将 BLE 设备连接到 Raspberry 失败
【发布时间】:2016-04-30 05:49:44
【问题描述】:

尝试通过 BLE 从 Rasperry Pi B+ 连接 Redbear Blend Micro Arduino 板 Raspbian Jessie 内核 4.1.13+(也尝试过 wheezy w 相同的问题) 蓝兹 5.37

尝试了几种不同的方式来安装 Bluez,但基本上都遵循了 http://www.elinux.org/RPi_Bluetooth_LE

pi@raspberrypi:~ $ sudo hciconfig
hci0:   Type: BR/EDR  Bus: USB
    BD Address: 5C:F3:70:75:A3:EA  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING 
    RX bytes:1722 acl:0 sco:0 events:85 errors:0
    TX bytes:788 acl:0 sco:0 commands:70 errors:0

pi@raspberrypi:~ $ sudo hcitool lescan
LE Scan ...
EC:EA:FA:D8:F9:77 BlendMicro
EC:EA:FA:D8:F9:77 BlendMicro

pi@raspberrypi:~ $ sudo gatttool -b EC:EA:FA:D8:F9:77 -t random -I
[EC:EA:FA:D8:F9:77][LE]> connect
Attempting to connect to EC:EA:FA:D8:F9:77
Error: connect: Connection refused (111)
[EC:EA:FA:D8:F9:77][LE]> 

在我的 Ubuntu 上执行相同的程序:

ubuntu:~$ sudo gatttool -b EC:EA:FA:D8:F9:77 -t random -I
[   ][EC:EA:FA:D8:F9:77][LE]> connect
[CON][EC:EA:FA:D8:F9:77][LE]> primary
[CON][EC:EA:FA:D8:F9:77][LE]> 
attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x0011 uuid: 713d0000-503e-4c75-ba94-3148f18d941e
attr handle: 0x0012, end grp handle: 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb
[CON][EC:EA:FA:D8:F9:77][LE]>

我尝试了什么: 不同版本的 Bluez5 安装,不认为这是问题。 我读到 Raspberian 内核版本不支持 Bluez 5 并降级到 3.10.25+ 导致 Raspberry 的 USB 端口断开连接

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=120539&p=819468

尝试了三种不同的蓝牙加密狗(包括可插拔和 CSR),它们在 RBi 上都给出了相同的错误,并且在 Ubuntu 上运行良好。

我知道这个堆栈发布。Cannot connect to BLE device on Raspberry Pi

【问题讨论】:

    标签: raspberry-pi bluetooth-lowenergy


    【解决方案1】:

    解决了。

    Bluez 5 与 Raspbian Jessie 或 Wheezy 的默认内核版本 4.1.13 不兼容。

    解决方案是退回到较早的内核。就我而言,我首先尝试了内核 3.10.25+,它杀死了我的 RBi B+ 上的所有 USB 端口。然后降级到内核 3.12.36+ 并解决了问题,我现在可以从 gatttool 连接。

    降级很容易。做吧:

    sudo rpi-update f74b92120e0d469fc5c2dc85b2b5718d877e1cbb
    sudo reboot
    

    以及下面的连接

    pi@raspberrypi:~ $ sudo gatttool -b EC:EA:FA:D8:F9:77 -t random -I
    [EC:EA:FA:D8:F9:77][LE]> connect
    Attempting to connect to EC:EA:FA:D8:F9:77
    Connection successful
    [EC:EA:FA:D8:F9:77][LE]> primary
    attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
    attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb
    attr handle: 0x000c, end grp handle: 0x0011 uuid: 713d0000-503e-4c75-ba94-3148f18d941e
    attr handle: 0x0012, end grp handle: 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb
    

    【讨论】:

      猜你喜欢
      • 2017-06-02
      • 2016-01-02
      • 1970-01-01
      • 1970-01-01
      • 2014-10-15
      • 2014-05-03
      • 2015-05-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多