6

I am using Ubuntu 20.04.1 and I am trying to pair my MX Keys keyboard via Bluetooth.

I start the process with the Bluetooth control panel, and I get stuck in this window.

enter image description here

Even though I type the right PIN and press ENTER, still the process does not complete. In fact, it gets stuck in that mode, with the PIN window unable to be closed.

I have also tried using "Blueman" with a similar result. I start the "Setup" process, and this is what I get in the end.

enter image description here

I have also tried with bluetoothctl

➜ bluetoothctl connect CB:DD:B4:5C:4E:E3
Attempting to connect to CB:DD:B4:5C:4E:E3
[CHG] Device CB:DD:B4:5C:4E:E3 Connected: yes
Connection successful

~ took 8s 
➜ bluetoothctl trust CB:DD:B4:5C:4E:E3
[CHG] Device CB:DD:B4:5C:4E:E3 Trusted: yes
Changing CB:DD:B4:5C:4E:E3 trust succeeded

~ 
➜ bluetoothctl pair CB:DD:B4:5C:4E:E3
Attempting to pair with CB:DD:B4:5C:4E:E3
[CHG] Device CB:DD:B4:5C:4E:E3 ServicesResolved: yes
[CHG] Device CB:DD:B4:5C:4E:E3 ServicesResolved: no
[CHG] Device CB:DD:B4:5C:4E:E3 Connected: no
Failed to pair: org.bluez.Error.AuthenticationCanceled

~ took 30s 

What could be done about it, to get it to work?

UPDATE

I have managed to get a PIN with bluetoothctl if I reset Bluetooth in my PC, but even if I type the PIN, the authentication fails. It is as if it was ignoring what I type...

[bluetooth]# pair CB:DD:B4:5C:4E:E3
Attempting to pair with CB:DD:B4:5C:4E:E3
[CHG] Device CB:DD:B4:5C:4E:E3 Connected: yes
[agent] Passkey: 610148
[CHG] Device CB:DD:B4:5C:4E:E3 Connected: no
Failed to pair: org.bluez.Error.AuthenticationCanceled

5 Answers 5

6

This is what worked for my Logitech MX Keys Mini on Xubuntu (Ubuntu 20.04.3 LTS).

Open your terminal and run these commands:

bluetoothctl
power off
power on
agent KeyboardOnly
default-agent
pairable on
scan on
pair <mac address>
## the passkey will be printed, enter it on your keyboard ##
trust <mac address>
connect <mac address>
quit
5

I had the same kind of issue with a Lenovo keyboard. basically I could enter the pin code but after hitting return nothing happened.

$bluetoothctl
[bluetooth]# agent KeyboardDisplay
[bluetooth]# default-agent 
[bluetooth]# scan on
[bluetooth]# pair <MAC-address>
Attempting to pair with <MAC-address>
[CHG] Device <MAC-address> Connected: yes
[agent] Passkey: xxxxxx
[agent] Passkey: xxxxx
[agent] Passkey: xxxx
[agent] Passkey: xxx
[agent] Passkey: xx
[agent] Passkey: x
[agent] Passkey: 
[CHG] Device <MAC-address> Modalias: usb:<ALIAS>
[CHG] Device <MAC-address> UUIDs: <UUID>
[CHG] Device <MAC-address> ServicesResolved: yes
[CHG] Device <MAC-address> Paired: yes
Pairing successful
[CHG] Device <MAC-address> ServicesResolved: no
[CHG] Device <MAC-address> Connected: no
[CHG] Device <MAC-address> Class: 0x00000540
[CHG] Device <MAC-address> Icon: input-keyboard
[CHG] Device <MAC-address> Connected: yes
Authorize service
[agent] Authorize service <UUID> (yes/no): yes

It looks like the last step [agent] Authorize serviceis not shown in the GUI

2
  • Extremely helpful! Once I ran this, I started getting the codes needed to type into my MX Keys keyboard. I am guessing the solution was the "agent KeyboardDisplay" plus the "default-agent".
    – Gardener
    Dec 23, 2021 at 17:37
  • this helped me on Linux Mint 21 Cinnamon, which uses Bluez instead of that interface (which used to work fine for me under Mint 20 Mate)... Go wonder. Mar 16, 2023 at 20:41
2

I fixed it, installing some missing firmware. All I had to do is run this command:

cd /lib/firmware/brcm && sudo wget https://github.com/winterheart/broadcom-bt-firmware/raw/master/brcm/BCM20702A1-0a5c-21e8.hcd

and unplug and plug again my bluetooth dongle

1

This solves Logitech devices issues for me:

https://pwr-solaar.github.io/Solaar/

1
  • Tried the bluetoothctl, did't work for me. Solaar solved it (on arch based distro). Aug 14, 2023 at 23:39
0

In my case the issue was I had bluetooth low energy (LE) turned off, and the keyboard was not showing up in my bluetooth device search. Running this fixed it

sudo btmgmt le on

The keyboard showed up in the device list and I could pair successfully after that.

Credits due to this answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .