Bluetooth LE on Raspbian

后端 未结 2 1443
野性不改
野性不改 2021-01-06 04:29

I installed bluez-5.15 from source with the following configuration:

$ ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc \\
--localstatedir         


        
2条回答
  •  囚心锁ツ
    2021-01-06 05:06

    First off, I spoke with a colleague about my configuration and for Raspbian (or more specifically, Debian) he recommended the following configuration settings:

    ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-library --with-systemdsystemunitdir=/lib/systemd/system --with-systemduserunitdir=/usr/lib/systemd
    

    Afterward, upon further inspection, here is how I was able to successfully connect. So what was happening was that the device I was trying to connect to (an NRF-based BLE device) required the LE address flag to be set to 'random'. See below:

    gatttool -t random -b EA:FB:B5:CE:B0:13 -I
    

    Then the result:

    [EA:FB:B5:CE:B0:13][LE]> connect
    Attempting to connect to EA:FB:B5:CE:B0:13
    Connection successful
    [EA:FB:B5:CE:B0:13][LE]> characteristics
    handle: 0x0002, char properties: 0x0a, char value handle: 0x0003, uuid: 00002a00
    -0000-1000-8000-00805f9b34fb
    

    Huzzah! Also, there may be a need to set the security level to something lower than high:

    [EA:FB:B5:CE:B0:13][LE]> sec-level medium
    

提交回复
热议问题