Bluetooth devices don't stay connected

Hello there,

I’ve been trying to debug an issue with bluetooth on my machine for a couple weeks. At first I thought the problem was isolated to my standing desk, but I just got a new bluetooth mouse and am having the same issue.

I was able to initially trust → pair → connect with the mouse using bluetoothctl. It worked for ~5 minutes and then stopped responding. Now I am unable to even replicate that small success.

Listing the devices (I deleted all the known devices to start fresh, only the mouse is shown)

Device D3:10:22:61:9F:9C (random)
	Name: LIFT FOR MAC
	Connected: no

Attempting to connect to that MAC address

bluetoothctl connect D3:10:22:61:9F:9C                                                                                    
Attempting to connect to D3:10:22:61:9F:9C
Failed to connect: org.bluez.Error.Failed le-connection-abort-by-local

Googling that error has led me down a few paths related to pipewire / pulseaudio. I honestly can’t tell if those are red herrings, so I’m posting here to try and get a more educated pair of eyes on the issue.

Thanks so much for reading, I’m open to any and all suggestions :smile:

Edit: Here’s some info on the adapter

❯ btmgmt
[mgmt]# info
Index list with 1 item
hci0:	Primary controller
	addr 5C:F3:70:83:06:7D version 6 manufacturer 15 class 0x6c0104
	supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr le advertising secure-conn debug-keys privacy configuration static-addr phy-configuration 
	current settings: powered bondable ssp br/edr le secure-conn 
	name Alfonso
	short name 
hci0:	Configuration options
	supported options: public-address 
	missing options: 

Edit 2: Tried removing the device and reconnecting, no luck. I did see a different error though, “Failed to connect: org.bluez.Error.Failed le-connection-abort-by-local

Agent registered
[bluetooth]# devices
Device D3:10:22:61:9F:9C LIFT FOR MAC
[bluetooth]# untrust D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Trusted: no
Changing D3:10:22:61:9F:9C untrust succeeded
[bluetooth]# disconnect D3:10:22:61:9F:9C
Attempting to disconnect from D3:10:22:61:9F:9C
Successful disconnected
[bluetooth]# cancel-pairing D3:10:22:61:9F:9C
Attempting to cancel pairing with D3:10:22:61:9F:9C
Failed to cancel pairing: org.bluez.Error.DoesNotExist
[bluetooth]# remove D3:10:22:61:9F:9C
[DEL] Device D3:10:22:61:9F:9C LIFT FOR MAC
Device has been removed
[bluetooth]# scan on
Discovery started
[CHG] Controller 5C:F3:70:83:06:7D Discovering: yes
[NEW] Device FF:CB:37:64:CF:95 FF-CB-37-64-CF-95
[NEW] Device D3:10:22:61:9F:9C LIFT FOR MAC
[bluetooth]# trust D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Trusted: yes
Changing D3:10:22:61:9F:9C trust succeeded
[bluetooth]# pair D3:10:22:61:9F:9C
Attempting to pair with D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Connected: yes
[CHG] Device D3:10:22:61:9F:9C Connected: no
Failed to pair: org.bluez.Error.AuthenticationCanceled
[bluetooth]# connect D3:10:22:61:9F:9C
Attempting to connect to D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Connected: yes
Failed to connect: org.bluez.Error.Failed le-connection-abort-by-local
[CHG] Device D3:10:22:61:9F:9C Connected: no
[DEL] Device FF:CB:37:64:CF:95 FF-CB-37-64-CF-95
[NEW] Device FF:CB:37:64:CF:95 FF-CB-37-64-CF-95
[bluetooth]# 

Hello,

Which agent did you register above this line?

It actually printed that by default when I entered bluetoothctl

Here’s some info though:

[bluetooth]# list
Controller 5C:F3:70:83:06:7D Alfonso [default]
[bluetooth]# show
Controller 5C:F3:70:83:06:7D (public)
	Name: Alfonso
	Alias: Alfonso
	Class: 0x006c0104
	Powered: yes
	Discoverable: no
	DiscoverableTimeout: 0x000000b4
	Pairable: yes
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v1D6Bp0246d0542
	Discovering: no
	Roles: central
	Roles: peripheral
Advertising Features:
	ActiveInstances: 0x00 (0)
	SupportedInstances: 0x05 (5)
	SupportedIncludes: tx-power
	SupportedIncludes: appearance
	SupportedIncludes: local-name

Okay, you can try in bluetoothctl to type

default-agent

as first command.

If that is not working you can try in the next run

agent NoInputNoOutput

With the agents the authentification method is set. Usually default-agent should work for a mouse. But with NoInputNoOutput it should be set to “just works”.

I was thinking you might want to try that because of this error:

The “Agent registered” message should be the result of a agent on command. Maybe that’s run automatically if it’s already printed there. If you don’t get this message you should also run

agent on

before setting the agent

Interesting, that seems to have changed the behavior a bit. I removed the device, set the NoInputNoOutput agent, and reconnected. It looked for a moment like things were fine, but then I received a delayed AuthenticationCanceled message.

[bluetooth]# untrust D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Trusted: no
Changing D3:10:22:61:9F:9C untrust succeeded
[bluetooth]# remove D3:10:22:61:9F:9C
[DEL] Device D3:10:22:61:9F:9C LIFT FOR MAC
Device has been removed
[bluetooth]# agent off
Agent unregistered
[bluetooth]# agent NoInputNoOutput
Agent registered
[bluetooth]# trust D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Trusted: yes
Changing D3:10:22:61:9F:9C trust succeeded
[bluetooth]# pair D3:10:22:61:9F:9C
Attempting to pair with D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Connected: yes
[CHG] Device D3:10:22:61:9F:9C ServicesResolved: yes
[CHG] Device D3:10:22:61:9F:9C ServicesResolved: no
[CHG] Device D3:10:22:61:9F:9C Connected: no
Failed to pair: org.bluez.Error.AuthenticationCanceled
[bluetooth]# 

Hmm… was that on purpose? It was supposed to be on. Or did you try that already?

Ah yeah, sorry I excluded the first couple lines where I tried that. It wouldn’t let me do NoInputNoOutput while the agent was on.

[bluetooth]# agent NoInputNoOutput
Agent is already registered

That technically shouldn’t be the issue, but can you try to switch

discoverable on

I find it a bit odd that you get this AuthenticationCancel even though with NoInputNoOutput there shouldn’t be authentication issues.

Did you try it with whatever GUI you have from your DE? Blueman or something like that?

With discoverable on it seems to behave the same:

❯ bluetoothctl
Agent registered
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller 5C:F3:70:83:06:7D Discoverable: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller 5C:F3:70:83:06:7D Discovering: yes
[NEW] Device D3:10:22:61:9F:9C LIFT FOR MAC
[bluetooth]# trust D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Trusted: yes
Changing D3:10:22:61:9F:9C trust succeeded
[bluetooth]# pair D3:10:22:61:9F:9C
Attempting to pair with D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Connected: yes
[CHG] Device D3:10:22:61:9F:9C ServicesResolved: yes
[CHG] Device D3:10:22:61:9F:9C ServicesResolved: no
[CHG] Device D3:10:22:61:9F:9C Connected: no
Failed to pair: org.bluez.Error.AuthenticationCanceled
[bluetooth]# 

One weird aspect of this and the previous attempt: there’s like 15-30 seconds delay between Connected: yes and Connected: no. i3 is actually displaying a Lift Connected notification at the start and then I see a Lift Disconnected notification after a bit. Interestingly, the light on the mouse never stops blinking (blinking indicates it’s looking for something to pair with).

Just tried with Blueman and got a similar result:

BT

It’s probably connecting to get the authentication done and somehow it fails.

You could try and click one of the mouse buttons in that phase. I think for some devices there exists something like a yes/no authentication. In that case you would have to try which button is yes and which one is no.

When you type agent in bluetoothctl and press tab double, I think it should show you which agents exist. Then you could try if maybe an other agent works.

Try to connect without trusting/pairing the device. I had similar issues in the past but somehow they vanished.

Just tried removing the device, restarting the bluetooth service, and then connecting without trusting / pairing. The result was similar:

Discovery started
[CHG] Controller 5C:F3:70:83:06:7D Discovering: yes
[NEW] Device D3:10:22:61:9F:9C LIFT FOR MAC
[bluetooth]# connect D3:10:22:61:9F:9C
Attempting to connect to D3:10:22:61:9F:9C
[CHG] Device D3:10:22:61:9F:9C Connected: yes
Connection successful
[NEW] Device FF:CB:37:64:CF:95 FF-CB-37-64-CF-95
[CHG] Device D3:10:22:61:9F:9C ServicesResolved: yes
[CHG] Device D3:10:22:61:9F:9C ServicesResolved: no
[CHG] Device D3:10:22:61:9F:9C Connected: no
[DEL] Device FF:CB:37:64:CF:95 FF-CB-37-64-CF-95
[NEW] Device FF:CB:37:64:CF:95 FF-CB-37-64-CF-95

I had that same ~30 second delay before it realized it wasn’t connected. In that time, I tried clicking the mouse buttons. I clicked the left button and waited a bit, clicked it a few more times, but no luck. I then tried the right button, but same story.

Thank you both for helping! I’ll try some different agents next.

1 Like

I just tried a few different agent options, but no difference.

I then tried switching the USB port my adapter is plugged into, and I was able to connect to the mouse :tada:

Hopefully everything is good and there was just some weirdness with the USB connection. I’ll keep using the mouse for a bit to see if it remains connected. I was able to connect to it for about 30 minutes initially, so hopefully this time doesn’t follow the same path. Fingers crossed :crossed_fingers:

Thanks again for your help @anon92589110 and @BendTheKnee!

2 Likes

Let’s keep the fingers crossed. :wink:

It’s been working great since I swapped USB ports, so I think we’re good! :rocket:

Sad news, for whatever reason the mouse disconnected again today and hasn’t been able to reconnect at all. Trying to debug, but it seems like there’s some sort of periodic issue going on with my machine :frowning_face:

My bluetooth connector was working great for nearly 24h and then suddenly stopped. I was actively using a bluetooth mouse and keyboard when it stopped. I restarted my computer multiple times yesterday while testing, and my previous fix continued working. I’m not sure what suddenly caused the breakage today.

I tried checking dmesg for bluetooth messages and found something which might be useful :person_shrugging:

~  main [!] +35 -8                                                                                                                                                      05:43:35 PM
❯ sudo dmesg | grep Bluetooth
[    5.522712] Bluetooth: Core ver 2.22
[    5.522729] Bluetooth: HCI device and connection manager initialized
[    5.522732] Bluetooth: HCI socket layer initialized
[    5.522734] Bluetooth: L2CAP socket layer initialized
[    5.522737] Bluetooth: SCO socket layer initialized
[    5.681028] Bluetooth: hci0: BCM: chip id 63
[    5.684034] Bluetooth: hci0: BCM: features 0x07
[    5.702034] Bluetooth: hci0: Alfonso
[    5.702036] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[    5.706559] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
[    5.707973] Bluetooth: hci0: BCM: 'brcm/BCM20702A1-0a5c-21e8.hcd'
[    5.709401] Bluetooth: hci0: BCM: 'brcm/BCM-0a5c-21e8.hcd'
[    6.924506] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    6.924512] Bluetooth: BNEP filters: protocol multicast
[    6.924516] Bluetooth: BNEP socket layer initialized
[    6.925293] Bluetooth: MGMT ver 1.22
[    7.772233] Bluetooth: hci0: corrupted ACL packet
[   12.738026] Bluetooth: hci0: corrupted ACL packet
[   12.767500] Bluetooth: hci0: corrupted ACL packet
[ 6635.713596] Bluetooth: hci0: ACL packet for unknown connection handle 512
[ 6635.713608] Bluetooth: hci0: ACL packet for unknown connection handle 14
[ 6635.718198] Bluetooth: hci0: corrupted ACL packet
[ 6643.108316] Bluetooth: RFCOMM TTY layer initialized
[ 6643.108325] Bluetooth: RFCOMM socket layer initialized
[ 6643.108327] Bluetooth: RFCOMM ver 1.11
[ 6666.610990] Bluetooth: hci0: corrupted ACL packet
[ 6666.611992] Bluetooth: hci0: corrupted ACL packet
[ 6666.622559] Bluetooth: hci0: corrupted ACL packet
[ 6666.623564] Bluetooth: hci0: corrupted ACL packet
[ 6666.624565] Bluetooth: hci0: corrupted ACL packet
[ 6666.626941] Bluetooth: hci0: ACL packet for unknown connection handle 177
[ 6666.960062] Bluetooth: hci0: corrupted ACL packet
[ 6666.964177] Bluetooth: hci0: ACL packet for unknown connection handle 3722
[ 6714.447341] Bluetooth: hci0: corrupted ACL packet
[ 6714.447924] Bluetooth: hci0: corrupted ACL packet
[ 6714.458340] Bluetooth: hci0: corrupted ACL packet
[ 6714.459781] Bluetooth: hci0: corrupted ACL packet
[ 6714.460345] Bluetooth: hci0: corrupted ACL packet
[ 6714.464316] Bluetooth: hci0: ACL packet for unknown connection handle 245
[ 6715.197647] Bluetooth: hci0: ACL packet for unknown connection handle 1295
[ 6715.197655] Bluetooth: hci0: ACL packet for unknown connection handle 2576
[ 6800.264533] Bluetooth: hci0: corrupted ACL packet
[ 6801.719598] Bluetooth: hci0: corrupted ACL packet
[ 6801.779584] Bluetooth: hci0: corrupted ACL packet
[ 6835.746483] Bluetooth: hci0: ACL packet for unknown connection handle 2816
[ 6840.041585] Bluetooth: hci0: corrupted ACL packet
[ 6850.820035] Bluetooth: hci0: ACL packet for unknown connection handle 9

I’m still digging into how to resolve these issues, open to any suggestions!

Maybe a more Linux friendly Bluetooth device. Does any of your family / friends have a bluetooth device you could borrow for troubleshooting purposes?

Pudge

That’s a really good idea, I’ll have to ask around a bit.

I’m currently using this one, which I’ve had since 2017. I’m open to buying a new one as well if nobody around has one, do you have any recommendations?