Possible reason for the problem
My BT keyboard (Logitech diNovo Keyboard) also stopped working in Ubuntu 20.04 with recent kernel 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
. I can see in the syslog
Jul 6 10:20:20 localhost bluetoothd[1337919]: Can't get HIDP connection info
Jul 6 10:20:25 localhost bluetoothd[1337919]: connect error: Host is down (112)
Jul 6 10:20:30 localhost bluetoothd[1337919]: Can't get HIDP connection info
Jul 6 10:20:30 localhost bluetoothd[1337919]: connect error: Device or resource busy (16)
There is no such problem with other BT devices. I'm not entirely sure what changed. I only see that I can't browse available services on the BT device anymore
shell> sdptool browse <bt-keyboard-sanitized>
Failed to connect to SDP server on <bt-keyboard-sanitized> Host is down
I can't browse services on other BT devices as well, though it worked well before. I suspect that somewhere down the BT stack this makes the trouble.
Workaround
I was able to connect the keyboard again. The steps below describe the procedure, YMMV.
Open both the blueman-applet (applet) window and a terminal with the command bluetoothctl (cli).
In the applet, remove the device if paired.
In the cli, set the adapter pairable and discoverable. Then enable the agent and start scanning. (For some reason the utility shows a connected BT device as a prompt, e.g. "MX Master 2S" in this case).
[MX Master 2S]# pairable on
Changing pairable on succeeded
[CHG] Controller <bt-adapter-sanitized> Pairable: yes
[MX Master 2S]# discoverable on
Changing discoverable on succeeded
[CHG] Controller <bt-adapter-sanitized> Discoverable: yes
[MX Master 2S]# agent on
Agent is already registered
[MX Master 2S]# default-agent
Default agent request successful
[MX Master 2S]# show
Controller <bt-adapter-sanitized> (public)
...
Class: 0x000c0000
Powered: yes
Discoverable: yes
DiscoverableTimeout: 0x000000b4
Pairable: yes
...
Discovering: no
Start the pairing of the keyboard. For a couple of seconds press and hold the connect button on the keyboard.
In the applet, press the search button and wait for the keyboard to appear in the list. Still in the applet, right-click the keyboard entry and select "pair".
In the cli, you'll see the PIN from the agent, e.g. [agent] PIN code: 143052
. Enter the pin on the keyboard you try to pair. You should see that the keyboard is connected, the services are (somehow) resolved, and paired.
[CHG] Device <bt-keyboard-sanitized> Connected: yes
[CHG] Device <bt-keyboard-sanitized> Modalias: usb:v046DpB303d2306
[CHG] Device <bt-keyboard-sanitized> UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device <bt-keyboard-sanitized> UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device <bt-keyboard-sanitized> ServicesResolved: yes
[CHG] Device <bt-keyboard-sanitized> Paired: yes
- In the applet, set the keyboard trusted. You should see
[CHG] Device <bt-keyboard-sanitized> Trusted: yes
- But the setup in the applet does not work. You should see the brief messages in the cli but there is no window in the applet to set up the device
[CHG] Controller <bt-adapter-sanitized> Discovering: yes
[CHG] Controller <bt-adapter-sanitized> Discovering: no
This is very probably the result of sdptool not being able to browse the services on the device. Despite this fact, the keyboard connected and resolved (somehow) the services
[CHG] Device <bt-keyboard-sanitized> Connected: yes
[CHG] Device 00:07:61:31:EA:A8 ServicesResolved: yes
- You might want to disable the agent and set pairable, and discoverable off as well. Set it on again when needed.
[MX Master 2S]# agent off
[MX Master 2S]# pairable off
[MX Master 2S]# discoverable off