Bluetooth Keyboard Connects and immediately disconnects

Using BSP 5.x, On an Apalis iMX8, I can pair to a Bluetooth keyboard but when I connect the keyboard immediately disconnects.

Having UserpaceHID disabled I get the following output

[bluetooth]# pair 08:95:42:EF:B2:1C 
Attempting to pair with 08:95:42:EF:B2:1C
[CHG] Device 08:95:42:EF:B2:1C Connected: yes
Request confirmation
[agent] Confirm passkey 443127 (yes/no): yes
[CHG] Device 08:95:42:EF:B2:1C UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device 08:95:42:EF:B2:1C UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 08:95:42:EF:B2:1C ServicesResolved: yes
[CHG] Device 08:95:42:EF:B2:1C Paired: yes
Pairing successful
[CHG] Device 08:95:42:EF:B2:1C ServicesResolved: no
[CHG] Device 08:95:42:EF:B2:1C Connected: no
[bluetooth]# trust 08:95:42:EF:B2:1C 
[CHG] Device 08:95:42:EF:B2:1C Trusted: yes
Changing 08:95:42:EF:B2:1C trust succeeded
[bluetooth]# connect 08:95:42:EF:B2:1C 
Attempting to connect to 08:95:42:EF:B2:1C
[CHG] Device 08:95:42:EF:B2:1C Connected: yes
Connection successful
[CHG] Device 08:95:42:EF:B2:1C ServicesResolved: yes
[CHG] Device 08:95:42:EF:B2:1C ServicesResolved: no
[CHG] Device 08:95:42:EF:B2:1C Connected: no

Having UserspaceHID enabled, I get the following output

[bluetooth]# pair 08:95:42:EF:B2:1C 
Attempting to pair with 08:95:42:EF:B2:1C
[CHG] Device 08:95:42:EF:B2:1C Connected: yes
Request confirmation
[agent] Confirm passkey 932012 (yes/no): yes
[CHG] Device 08:95:42:EF:B2:1C UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device 08:95:42:EF:B2:1C UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 08:95:42:EF:B2:1C ServicesResolved: yes
[CHG] Device 08:95:42:EF:B2:1C Paired: yes
Pairing successful
[Magic Keyboard]# trust 08:95:42:EF:B2:1C 
[CHG] Device 08:95:42:EF:B2:1C Trusted: yes
Changing 08:95:42:EF:B2:1C trust succeeded
[CHG] Device 08:95:42:EF:B2:1C ServicesResolved: no
[CHG] Device 08:95:42:EF:B2:1C Connected: no
[bluetooth]# connect 08:95:42:EF:B2:1C 
Attempting to connect to 08:95:42:EF:B2:1C
[CHG] Device 08:95:42:EF:B2:1C Connected: yes
[CHG] Device 08:95:42:EF:B2:1C ServicesResolved: yes
Failed to connect: org.bluez.Error.NotAvailable
[CHG] Device 08:95:42:EF:B2:1C ServicesResolved: no
[CHG] Device 08:95:42:EF:B2:1C Connected: no

I can use bluetoothctl on my Ubuntu laptop and connect no issues to the same keyboard.
I’ve also tried a different bluetooth keyboard and get similar results.

Edit 1: I’ve tested on both a 1.0B and a 1.1E and get the same results.

The build I was using was 5.7.6+build.29 from 2024/03/27

Hi @matthewh, when you ran your test, were two antennas connected to the WiFi/BT module? If not, please connect them and redo the tests.

I have only the AUX antenna connected as that is the antenna used for bluetooth, the MAIN is only used for WIFI.

And as another point, I can pair and connect successfully to other devices such as my phone without issue. The issue only occurs with keyboards.

I’m going to try to reproduce your issue locally. Could you please provide more details about the OS image you are using? Referring to it as BSP 5.x is too ambiguous. Are you using one of the Toradex-built images, or did you build your own?

In the first case, please let us know exactly which image you have flashed. In the second case, which image did you use as the basis of your build, and what changes did you apply?

I tested both a custom image built off of tdx-reference-minimal-image using dunfell.
I also tested with the quarterly release of BSP 5 maintenance releases Downstream Linux Reference Minimal for the iMX8 here

@alex.tx Have you been able to reproduce the issue?

Yes, we have informed our R&D team to investigate this issue.

Will we be informed of any updates? Is there an expected time they’ll get to looking into it?

This issue has been assigned a low priority, so it’s difficult to predict when it will be resolved. However, according to the R&D report, the upstream image is not affected by this issue.