2

I can't get bluetooth keyboards to connect in Ubuntu 16.04. A bluetooth mouse connects fine without issue. I have tried 3 different dongles and two different keyboards. One keyboard is a standard bluetooth keyboard and the other (which I'm keen to get to work) is a Recreated Spectrum - which is pretty much a standard bluetooth keyboard. The dongles and keyboards all work fine on my Windows machine. I've tried the different PIN setting with no joy. They show up OK but when I try to connect they eventual come up with 'failed'. Tried "sudo hciconfig hci0 sspmode 0" and it tells me "Can't set Simple Pairing mode on hci0: Input/Output error (5)"

Any thoughts? Thanks!

1 Answers1

2

I was able to make it work through the command line based on this Ask Ubuntu answer and this Ubuntu Forums thread.

First unplug the bluetooth dongle and delete configuration files:

sudo \rm -rf /var/lib/bluetooth/*

Then replug the bluetooth dongle and run bluetoothctl. In the bluetoothctl prompt, type the following commands:

power on
agent on
default-agent 
scan on

Turn on the bluetooth keyboard in discovery mode. Soon bluetoothctl will print the keyboard device ID in the format FF:EE:DD:CC:BB:AA. Then proceed with pairing:

pair FF:EE:DD:CC:BB:AA

It will request a PIN code, type that code in the keyboard and hit enter. You will get a success message. Then finalize the configuration:

trust FF:EE:DD:CC:BB:AA
connect FF:EE:DD:CC:BB:AA

The keyboard should now work.

raugfer
  • 136
  • Thanks! Well.. it half worked. My "Logik" keyboard seems to be working fine however my "Recreated ZX Spectrum", no chance. All I get when trying to pair is "Authorization cancelled" after typing the PIN and waiting a few seconds. Looks like a Windows win for the Recreated ZX Spectrum! – Simon Leah May 22 '16 at 08:36
  • Thanks! your approach is only one worked for me: Ubuntu 16.04, MX Master Logitech mouse – Kostanos Jan 25 '18 at 15:15
  • Thank you. Worked for me on Linux Mint 21.2. Instead of unplugging the bluetooth dongle (which is internal to my laptop), I made a "power off" in the beginning. – Sohail Feb 08 '24 at 13:58