-1

I am unable to establish an ble connection between my Raspberrypi4B and Laptop. Configuration is as below:

Laptop: Ubuntu-20.04.2 LTS, bluez version: 5.53 Raspberrypi4B: Ubuntu-21.04 bluez version: 5.56

Bluetoothctl logs @Raspberrypi4B:

nagesh@nagesh-desktop:~$ sudo bluetoothctl
[sudo] password for nagesh: 
Agent registered
[CHG] Controller DC:A6:32:F2:CB:46 Pairable: yes
[bluetooth]# info 6C:6A:77:48:40:08
Device 6C:6A:77:48:40:08 (public)
    Name: root1-Nitro-AN515-55
    Alias: root1-Nitro-AN515-55
    Class: 0x0000010c
    Icon: computer
    Paired: yes
    Trusted: no
    Blocked: no
    Connected: no
    LegacyPairing: no
    UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
    UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
    UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
    Modalias: usb:v1D6Bp0246d053A
[bluetooth]# connect 6C:6A:77:48:40:08
Attempting to connect to 6C:6A:77:48:40:08
[CHG] Device 6C:6A:77:48:40:08 Connected: yes
[CHG] Device 6C:6A:77:48:40:08 ServicesResolved: yes
Failed to connect: org.bluez.Error.NotAvailable
[CHG] Device 6C:6A:77:48:40:08 ServicesResolved: no
[CHG] Device 6C:6A:77:48:40:08 Connected: no
[bluetooth]# 

btmon logs @Raspberrypi4B: as attached

I see in the btmon ouptut, always connection is terminated but no reason is present which specifies the cause for it.

Initially i was using Ubuntu 20.04.2 LTS on my Raspberrypi4b which i later upgraded to 21.04 but still no luck. Couple of posts pointed to bug in bluez which was pretty old and i am assuming would have already fixed in the bluez 5.56 version.

Can someone help me in resolving this issue?

5
  • > HCI Event: Number of Completed Packets (0x13) plen 5 #37 [hci0] 48.886867 Num handles: 1 Handle: 12 Count: 1 < ACL Data TX: Handle 12 flags 0x00 dlen 12 #38 [hci0] 50.627130 L2CAP: Disconnection Request (0x06) ident 5 len 4 Destination CID: 64 Source CID: 64 – nagesh shamnur May 12 at 12:41
  • > ACL Data RX: Handle 12 flags 0x02 dlen 12 #39 [hci0] 50.644660 L2CAP: Disconnection Response (0x07) ident 5 len 4 Destination CID: 64 Source CID: 64 > HCI Event: Number of Completed Packets (0x13) plen 5 #40 [hci0] 50.886900 Num handles: 1 Handle: 12 Count: 1 – nagesh shamnur May 12 at 12:42
  • < HCI Command: Disconnect (0x01|0x0006) plen 3 #41 [hci0] 52.661019 Handle: 12 Reason: Remote User Terminated Connection (0x13) > HCI Event: Command Status (0x0f) plen 4 #42 [hci0] 52.661672 Disconnect (0x01|0x0006) ncmd 1 Status: Success (0x00) – nagesh shamnur May 12 at 12:42
  • > HCI Event: Disconnect Complete (0x05) plen 4 #43 [hci0] 52.746521 Status: Success (0x00) Handle: 12 Reason: Connection Terminated By Local Host (0x16) – nagesh shamnur May 12 at 12:43
  • @ MGMT Event: Device Disconnected (0x000c) plen 8 {0x0001} [hci0] 52.746586 BR/EDR Address: 6C:6A:77:48:40:08 (Intel Corporate) Reason: Connection terminated by local host (0x02) – nagesh shamnur May 12 at 12:43
0

I managed to figure out the root cause of this issue. Thanks to help from colleagues and bluez folks. The problem is need to register a profile in bluetoothctl @ RPi and initiate a connect from Laptop did the trick.

Change @ RPi:

nagesh@nagesh-desktop:~$ sudo bluetoothctl
[sudo] password for nagesh: 
Agent registered
[CHG] Controller DC:A6:32:F2:CB:46 Pairable: yes
[bluetooth]# info 6C:6A:77:48:40:08
Device 6C:6A:77:48:40:08 (public)
    Name: root1-Nitro-AN515-55
    Alias: root1-Nitro-AN515-55
    Class: 0x0000010c
    Icon: computer
    Paired: yes
    Trusted: no
    Blocked: no
    Connected: no
    LegacyPairing: no
    UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
    UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
    UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
    UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
    UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
    UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
    Modalias: usb:v1D6Bp0246d053A
[bluetooth]#  menu gatt
[bluetooth]#  register-service 0xaaaa
[NEW] Primary Service (Handle 0x0000)
        /org/bluez/app/service0
        0xaaaa
        Unknown
[/org/bluez/app/service0] Primary (yes/no): yes
[bluetooth]#  register-characteristic 0xbbbb read
[NEW] Characteristic (Handle 0x0000)
        /org/bluez/app/service0/chrc0
        0xbbbb
        Unknown
[/org/bluez/app/service0/chrc0] Enter value: 0xc
[bluetooth]#  register-application
[CHG] Primary Service (Handle 0x0013)
        /org/bluez/app/service0
        0xaaaa
        Unknown
[CHG] Characteristic (Handle 0x0015)
        /org/bluez/app/service0/chrc0
        0xbbbb
        Unknown
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000aaaa-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
Application registered
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000aaaa-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Controller CC:C0:79:B3:E4:0C UUIDs: 0000111e-0000-1000-8000-00805f9b34fb

@Laptop run bluetoothctl, scan for devices, once BD address is found, pair using the BD address and then connect using the BD address and the connection would be successful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.