This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SDK7.1 keypad connect ubunt14.4 success!

I try to use SDK8.1.1 example connect ubuntu14.4 with CSR dongle. Seems it create connection fail. I downgrade to SDK7.1, it connection pair correctly. But it'll terminate connection once finish pair.

Here is hcidump

HCI Event: Number of Completed Packets (0x13) plen 5 handle 63 packets 1 ACL data: handle 63 flags 0x02 dlen 10 ATT: Read By Type resp (0x09) length: 4 handle 0x0005, value 0xc1 0x03 < HCI Command: Disconnect (0x01|0x0006) plen 3 handle 63 reason 0x13 Reason: Remote User Terminated Connection HCI Event: Command Status (0x0f) plen 4 Disconnect (0x01|0x0006) status 0x00 ncmd 1 HCI Event: Disconn Complete (0x05) plen 4 status 0x00 handle 63 reason 0x16 Reason: Connection Terminated by Local Host

WireShark have same result. It also indicate Host terminate connect reason 0x13.

Parents
  • I tried now with SDK 8.1, ubuntu 14.04, bluez 4.101-0ubuntu13.1 and the CSR dongle, and I didn't have any problems connecting. Which tools and commands do you use to connect?

    Make sure you delete any bond info. In the terminal write:

    bluez-test-device remove xx:xx:xx:xx:xx:xx
    

    Then I did the following to connect and enable notifications:

    gatttool -b xx:xx:xx:xx:xx:xx -t random -I
    
    > connect
    > sec-level high
    > char-write-req 0x0017 01
    

    EDIT:

    The reason why it disconnects while holding down button 0 is because connection_buttons_configure() in bsp_btn_ble.c configure a long push on button 0 to disconnect.

    #define BTN_ID_DISCONNECT  0;  
    #define BTN_ACTION_DISCONNECT  BSP_BUTTON_ACTION_LONG_PUSH
    

    connection_buttons_configure() is called in the function bsp_btn_ble_on_ble_evt() whenever the BLE event says BLE_GAP_EVT_CONNECTED. This is a part of the bsp library, but I agree that it doesn't go along well with the hids demos since you push the buttons a lot in the demos. You can simply set the BTN_ID_DISCONNECT define to something else than the 4 buttons, and it will not bother you anymore.

    When it comes to Linux not being able to reconnect, I'm not sure what the problem is. I am not able to reproduce the error here. I've tried with Bluez 4 and 5, Ubuntu and Debian, as well as Android. What I noticed was that in Bluez 5, if I wrote the connect command before the pair command, I had troubles getting Linux to recognize it as a HID device. So, in bluetoothctl I just wrote pair XX:XX:XX:XX:XX:XX without connecting first.

  • Sure Stian, I try it on Android phone 4.4 also. Phone BT is onboard chip. So problem narrow down to BLE device side. Not CSR dongle problem, not bluez problem.

Reply Children
No Data
Related