36

My bluetooth mouse won't stay connected. This happened recently in 16.04, and I subsequently upgraded to 18.04, but the problem persists.

From bluetoothctl you can see everytime I move the mouse it connects, then just disconnects immediately.

$ bluetoothctl
Agent registered
[bluetooth]# list
Controller 18:5E:0F:99:9B:EC brendan-HP-ENVY-m7-Notebook [default]
[bluetooth]# devices
Device 00:00:00:00:51:00 Bluetooth Mouse
Device 68:64:4B:3B:C7:E4 68-64-4B-3B-C7-E4
[CHG] Device 00:00:00:00:51:00 Connected: yes
[CHG] Device 00:00:00:00:51:00 Connected: no
[CHG] Device 00:00:00:00:51:00 Connected: yes
[CHG] Device 00:00:00:00:51:00 Connected: no
[CHG] Device 00:00:00:00:51:00 Connected: yes
[CHG] Device 00:00:00:00:51:00 Connected: no
[CHG] Device 00:00:00:00:51:00 Connected: yes
[CHG] Device 00:00:00:00:51:00 Connected: no

I've followed other threads suggesting to update to the latest bluez5 version, but no dice....

Any help would be appreciated.

graham
  • 13,061
brercia
  • 461

7 Answers7

32

I had the same issue on 18.04 with my Microsoft Sculpt Comfort Mouse and tried all the steps mentioned here and elsewhere, but nothing helped. It constantly disconnected & reconnected after sleep or a reboot.

I finally found a solution on reddit:

Set UserspaceHID=true in /etc/bluetooth/input.conf and restart the bluetooth service (or reboot). After that, mouse stayed connected finally.

https://www.reddit.com/r/archlinux/comments/8ywe3q/bluetooth_mouse_cannot_reconnect_after_disconnect/

14

I had the same problem with a Logitech M535 under 18.04. Pairing it differently, via terminal, is what resolved it for me:

  • Unpair everything
  • Set the mouse to discoverable
  • run bluetoothctl (list the MAC address, of your mouse, a number like 00:1F:28:FE:04:82)
  • run pair <MAC> (within bluetoothctl which paired the device)

You might also want to trust the device with

trust <MAC>

When done, just type quit

Restart your computer, your mouse should now connect automatically after sleep or restart.

Please also note

Before all of that, I also updated bluez from 5.48 to 5.50, it is known to bring some fixes, I have no idea if it's needed but it certainly can't hurt:

First of all, open the terminal and check the current bluez version in your system with the following command:

dpkg --status bluez | grep '^Version:'

In my case, I received version: 4.48-0ubuntu0ppa. Add the following repository to get the last version of bluez (5.50 as of Sept 28, 2018):

sudo add-apt-repository ppa:bluetooth/bluez
sudo apt-get update

After running the command you should be able to update to bluez 5.50 via:

sudo apt upgrade

The following links contain more details about the bugs in bluez 4.48 and potential solutions: bluez bug description and bluez bug solution.

Travis
  • 413
4

Same problem here - fixed as described below:

  • Ubuntu 18.04.2 (to be complete Dell Latitude 5290 2-in-1 - I think/from other postings irrelevant)

  • Bluetooth Mouse (to be complete HP Z5000 - also irrelevant what I saw so far)

Paired using graphical interface yields the following:

  • Mouse works, however, as soon as the laptop falls asleep/reboots or even sporadically mouse does not work any more - re-animated by pressing the connect button and hitting the "System Settings -> Bluetooth -> HP Bluetooth Mouse Z500 -> Connection" button, one to several times.
    • Could also reproduce behaviour with manually disconnecting mouse in "bluetoothctl". After move mouse tries to connect, falls back immediately.

After following the procedure described above:

$ bluetoothctl ... [NEW] Device xx:yy:zz:...:www HP Bluetooth Mouse Z5000

[bluetooth]# remove xx:yy:zz:...:www [bluetooth]# scan on [NEW] Device xx:yy:zz:...:www HP Bluetooth Mouse Z5000 [bluetooth]# pair xx:yy:zz:...:www [bluetooth]# trust xx:yy:zz:...:www [bluetooth]# connect xx:yy:zz:...:www

Everythings fine - even without hacking /etc/bluetooth/input.conf Works like a charm on reboot / sleep / manually "disconnect" in "bluetoothctl"

Hope this helps, Klaus

Maybe somebody has more insight in what's the diff between pairing via GNOME system settings and with the "bluetoothctl" command line tool.

klar
  • 170
3

I had this same problem (in my case, on Ubuntu 20.04 and up) for months and finally found a solution that works permanently. There are lots of recently reported issues with bluetooth devices staying connected and needing to constantly restart the bluetooth service/stack to get it work again (and sometimes wont work until a reboot). I have no idea if/how/when this got introduced, but the solution makes sense now, and explains why it was so hard for me to find a solution that worked.

So the core issue seems to be related to combined bluetooth/wifi cards, in my case from Intel. The surprising bit is that it has to do with WiFi power management, and not power management related to bluetooth or USB. I noticed my Wifi would also stop working on occasion and decided to start looking into that. To my surprise, I noticed there was some reports of people having this issue with Bluetooth and WiFi.

Disabling WiFi power management in NetworkManager fixed both issues for me:

https://askubuntu.com/a/1077559/364896

I was able to remove all other changes/settings I tried before to fix this problem, and none of them were needed except this. Bluetooth and Wifi are both rock solid (3 days w/ no issue at all), and im able to enable all other power saving features. For some reason the power saving features in TLP related to wifi all work fine, its just the power saving mode that NetworkManager uses that seems to cause the trouble.

My guess here is that NetworkManager may change powersaving state too often. Although this would only break WiFi on occasion, it would knock out bluetooth constantly after just a small period of inactivity. The wifi and bluetooth share some parts of the radio, so I'm assuming the bluetooth state was effected more easily. I'm still using wifi powersave through TLP, but its enabled/disabled only when I change from battery to power, and it seems to cause no issue.

Colin Godsey
  • 319
  • 2
  • 7
0

I'm no techie so didn't fancy editing files so just found the Bluetooth manager I was used to (Blueman for GNOME using bluez D-BusBackend) in Ubuntu Software installed it then found & setup my mouse in a jiffy, after using it for a while or at next reboot you will be asked if you trust this devise just click always trust & thats it & ignore the manager that comes with Ubuntu from now on, it worked perfect for me anyway and at 63 if I can do it anyone can lol

0

Run :

sudo apt-get install pavucontrol pulseaudio-module-gconf pulseaudio-module-zeroconf
Arun Joseph
  • 125
  • 5
0

I just recently had the same problem on (K)Ubuntu 24.04. What ended up working for me was the following:

  1. apt purge bluez (make sure no important packages are getting removed with it and make note of the ones that are getting removed)
  2. and then simply reinstall bluez by running apt install bluez
  3. AND bluedevil as well as gnome-bluetooth-common and gnome bluetooth by running apt install bluedevil gnome-bluetooth-common gnome-blueooth.
  4. Also reinstall all other packacges that got removed in step 1.