Bluetooth Won't Connect Unless I Manually Remove and Reconnect Every Time

My Keyboard will not connect to my computers bluetooth unless I manually run some bluetoothclt commands. All of my bluetooth devices other then my keyboard do not exhibit this behavior. Sometimes when I restart into EndevourOS I can run a connect command and my keyboard will connect as long as I put it into pairing mode. When that Fails I need to run a remove command and reconnect to get my keyboard up and running again.

I was using Fedora and my keyboard functioned normally. I am currently running EndevourOS’ KDE Plasma.

This was me attempting to connect before unpairing.

[dylan@Dilltop-Linux ~]$ bluetoothctl
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffb4 (-76)
[CHG] Device DC:2C:26:E3:0B:05 Class: 0x00002540 (9536)
[CHG] Device DC:2C:26:E3:0B:05 Icon: input-keyboard
[bluetooth]# connect DC:2C:26:E3:0B:05
Attempting to connect to DC:2C:26:E3:0B:05
[CHG] Device DC:2C:26:E3:0B:05 Connected: yes
[Seer PRO]# connect DC:2C:26:E3:0B:05
Attempting to connect to DC:2C:26:E3:0B:05
Failed to connect: org.bluez.Error.InProgress br-connection-busy
Failed to connect: org.bluez.Error.Failed br-connection-create-socket
[CHG] Device DC:2C:26:E3:0B:05 Connected: no
[bluetooth]# connect DC:2C:26:E3:0B:05
Attempting to connect to DC:2C:26:E3:0B:05
[CHG] Device DC:2C:26:E3:0B:05 Connected: yes
Failed to connect: org.bluez.Error.Failed br-connection-create-socket
[CHG] Device DC:2C:26:E3:0B:05 Connected: no
[bluetooth]# connect DC:2C:26:E3:0B:05
Attempting to connect to DC:2C:26:E3:0B:05
[CHG] Device DC:2C:26:E3:0B:05 Connected: yes
[Seer PRO]# exit

When the above doesn’t work I need to remove my device and redo the pair,trust,connect sequence to get it running. This doesn’t work as intended thought as I need to run a second connect command. This following block is all while the keyboard is in its pairing mode.

[dylan@Dilltop-Linux ~]$ bluetoothctl
Agent registered
[CHG] Device DC:2C:26:E3:0B:05 Connected: no
[bluetooth]# remove DC:2C:26:E3:0B:05
[DEL] Device DC:2C:26:E3:0B:05 Seer PRO
Device has been removed
[bluetooth]# scan off
Failed to stop discovery: org.bluez.Error.Failed
[bluetooth]# scan on
Discovery started
[NEW] Device DC:2C:26:E3:0B:05 Seer PRO
[bluetooth]# pair DC:2C:26:E3:0B:05
Attempting to pair with DC:2C:26:E3:0B:05
[CHG] Device DC:2C:26:E3:0B:05 Connected: yes
[Seer PRO]# trust DC:2C:26:E3:0B:05
[CHG] Device DC:2C:26:E3:0B:05 Trusted: yes
Changing DC:2C:26:E3:0B:05 trust succeeded
[Seer PRO]# connect DC:2C:26:E3:0B:05
Attempting to connect to DC:2C:26:E3:0B:05
[CHG] Device DC:2C:26:E3:0B:05 Connected: no
Failed to pair: org.bluez.Error.AuthenticationCanceled
[CHG] Device DC:2C:26:E3:0B:05 Connected: yes
[CHG] Device DC:2C:26:E3:0B:05 Modalias: usb:v05ACp024Fd011B
[CHG] Device DC:2C:26:E3:0B:05 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:E3:0B:05 ServicesResolved: yes
Failed to connect: org.bluez.Error.NotAvailable br-connection-profile-unavailable
[CHG] Device DC:2C:26:E3:0B:05 ServicesResolved: no
[CHG] Device DC:2C:26:E3:0B:05 Connected: no

At this point every time I hit a key on my keyboard it triggers a CHG line. The Keyboard is no longer in pairing mode. I run the connect command when the keyboard is not in pairing mode and it is now usable.

[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffac (-84)
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffba (-70)
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffac (-84)
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffb8 (-72)
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffae (-82)
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffba (-70)
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffb0 (-80)
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffba (-70)
[CHG] Device DC:2C:26:E3:0B:05 RSSI: 0xffffffb0 (-80)
[bluetooth]# connect DC:2C:26:E3:0B:05
Attempting to connect to DC:2C:26:E3:0B:05
[CHG] Device DC:2C:26:E3:0B:05 Connected: yes
[CHG] Device DC:2C:26:E3:0B:05 UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:E3:0B:05 UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:E3:0B:05 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:E3:0B:05 ServicesResolved: yes
[CHG] Device DC:2C:26:E3:0B:05 WakeAllowed: yes
[CHG] Device DC:2C:26:E3:0B:05 Paired: yes
Connection successful
[Seer PRO]#

At this point the keyboard is working. The keyboard will work until it goes to sleep, I turn it off then on, the pc goes to sleep, or the pc gets turned off and on.

Any help would be appreciated to make it so I just need to wake my keyboard and start typing!

Interesting. Let’s investigate.

First, did you check the journal logs for any Bluetooth-related errors after waking up from sleep? Try: journalctl -xe | grep -i bluetooth

At the same time, we can try ensuring that your Bluetooth device is not set to power off or enter a low-power state during sleep. You can check and adjust this through the power management settings. Open the terminal and run:
sudo nano /etc/udev/rules.d/00-usb-autosuspend.rules

and add the following line:

ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="on"

Save and exit (Ctrl+X, Y, Enter).

We can also try to edit the Bluetooth kernel module options:

sudo nano /etc/modprobe.d/bluetooth.conf

and add the line:

options btusb enable_autosuspend=n

If none of that works, we can try to create a custom script to restart Bluetooth after waking up. For example:

#!/bin/bash
sleep 5
systemctl restart bluetooth

Save the script, make it executable, and configure your system to run it upon waking up.

1 Like