Bluetooth Mouse disconnecting

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
patrickbeattie
Level 1
Level 1
Posts: 25
Joined: Mon Mar 22, 2021 4:01 am

Bluetooth Mouse disconnecting

Post by patrickbeattie »

I have recently upgraded to Linux Mint 20 and am having issues with my Logitech MX Anywhere 2S Bluetooth mouse. I am not sure if this a Bluetooth problem or a specific mouse problem. The mouse will function correctly on startup and then for no reason will cut off and never start again until i reset by this command in terminal- sudo modprobe -r btusb && sleep 20 && sudo modprobe btusb

It will then continue for a while and stop again, there is no knowing when it will stop and can go for a long time without stopping.
Other times it will lag a little for a second and then start again, this lead me to believe it may be a sleep issue and that the mouse is going to sleep when it shouldn't then not start again, so may have something to do with autosuspend.

This problem is very frustrating as I am running off a laptop stored on the other side of my room and every time I must go to the laptop and run the terminal command.
I also tried this command which did not work-

d /lib/firmware/brcm

sudo wget https://bugs.launchpad.net/ubuntu/+sour ... c-6410.hcd

Hoping someone will have a suggestion as to how to fix this issue.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
hglee
Level 6
Level 6
Posts: 1422
Joined: Fri Jun 22, 2018 4:31 pm

Re: Bluetooth Mouse disconnecting

Post by hglee »

patrickbeattie wrote: Sun Mar 28, 2021 4:56 am I have recently upgraded to Linux Mint 20 and am having issues with my Logitech MX Anywhere 2S Bluetooth mouse ....

Other times it will lag a little for a second and then start again, this lead me to believe it may be a sleep issue and that the mouse is going to sleep when it shouldn't then not start again, so may have something to do with autosuspend.


If you wish to disable Bluetooth autosuspend:


Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following command-line...

Code: Select all

echo "options btusb enable_autosuspend=0" | sudo tee /etc/modprobe.d/disable_btusb-autosuspend.conf
This will take effect on your next reboot.


If you later wish to undo this procedure...

Code: Select all

sudo rm /etc/modprobe.d/disable_btusb-autosuspend.conf


Linux Mint 21 Vanessa, MATE 1.26.0, kernel 5.15.0*, Dell 2-in-1
AMD Ryzen 7 5825U / Barcelo iGPU - 14" WUXGA Touchscreen
MediaTek MT7921 WiFi-6 BT-5.2; 32GB DDR4@3200MHz; XPG 2TB-NVMe
patrickbeattie
Level 1
Level 1
Posts: 25
Joined: Mon Mar 22, 2021 4:01 am

Re: Bluetooth Mouse disconnecting

Post by patrickbeattie »

@ hglee

Thank you for this I have ran the command hopefully it fixes it, time will tell.
patrickbeattie
Level 1
Level 1
Posts: 25
Joined: Mon Mar 22, 2021 4:01 am

Re: Bluetooth Mouse disconnecting

Post by patrickbeattie »

Unfortunately the suggestion by hglee

echo "options btusb enable_autosuspend=0" | sudo tee /etc/modprobe.d/disable_btusb-autosuspend.conf

did not work. Now I am pulling my hair out.

Any other suggestions?
User avatar
hglee
Level 6
Level 6
Posts: 1422
Joined: Fri Jun 22, 2018 4:31 pm

Re: Bluetooth Mouse disconnecting

Post by hglee »

patrickbeattie wrote: Mon Mar 29, 2021 2:07 am Any other suggestions?


Technical info about the system is often helpful for diagnostics:


Open a Terminal (Ctrl-Alt-T), then click SELECT ALL here to copy-and-paste the following long command-line...

Code: Select all

(inxi -Fxxz;lsusb -tv;lspci;hciconfig -a;rfkill;(lsmod;dmesg)|egrep -i "blu|firm|bt|hci";mokutil --sb-state)|nc termbin.com 9999
After a brief pause, a termbin.com URL will appear in the Terminal. Post that URL in a reply here.



Linux Mint 21 Vanessa, MATE 1.26.0, kernel 5.15.0*, Dell 2-in-1
AMD Ryzen 7 5825U / Barcelo iGPU - 14" WUXGA Touchscreen
MediaTek MT7921 WiFi-6 BT-5.2; 32GB DDR4@3200MHz; XPG 2TB-NVMe
patrickbeattie
Level 1
Level 1
Posts: 25
Joined: Mon Mar 22, 2021 4:01 am

Re: Bluetooth Mouse disconnecting

Post by patrickbeattie »

hglee wrote: Mon Mar 29, 2021 3:23 am
patrickbeattie wrote: Mon Mar 29, 2021 2:07 am Any other suggestions?


Technical info about the system is often helpful for diagnostics:


Open a Terminal (Ctrl-Alt-T), then click SELECT ALL here to copy-and-paste the following long command-line...

Code: Select all

(inxi -Fxxz;lsusb -tv;lspci;hciconfig -a;rfkill;(lsmod;dmesg)|egrep -i "blu|firm|bt|hci";mokutil --sb-state)|nc termbin.com 9999
After a brief pause, a termbin.com URL will appear in the Terminal. Post that URL in a reply here.



Here it is
https://termbin.com/wxev
User avatar
hglee
Level 6
Level 6
Posts: 1422
Joined: Fri Jun 22, 2018 4:31 pm

Re: Bluetooth Mouse disconnecting

Post by hglee »

patrickbeattie wrote: Mon Mar 29, 2021 2:07 am Any other suggestions?


Let's see if adding a kernel parameter to disable Bluetooth autosuspend (btusb.enable_autosuspend=0) makes a difference.


The following commands first make a time-stamped backup of your grub file, add the kernel parameter, then update grub:

Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following three command-lines, one by one...

Code: Select all

Q=/etc/default/grub;sudo cp $Q{,-`date +%Y%m%d-%H%M%S`} # add btusb.enable_autosuspend=0
sed 's/btusb.enable_autosuspend=0//' $Q|tr -s ' '|sudo dd of=$Q 2>/dev/null
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/&btusb.enable_autosuspend=0 /' $Q&&sudo update-grub
Reboot.



If you later wish to remove that parameter, the following first makes a time-stamped backup, removes the parameter, then updates grub:

Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following two command-lines, one by one...

Code: Select all

Q=/etc/default/grub;sudo cp $Q{,-`date +%Y%m%d-%H%M%S`} # remove btusb.enable_autosuspend=0
sed 's/btusb.enable_autosuspend=0//' $Q|tr -s ' '|sudo dd of=$Q&&sudo update-grub

Other kernel parameters remain as is.


Linux Mint 21 Vanessa, MATE 1.26.0, kernel 5.15.0*, Dell 2-in-1
AMD Ryzen 7 5825U / Barcelo iGPU - 14" WUXGA Touchscreen
MediaTek MT7921 WiFi-6 BT-5.2; 32GB DDR4@3200MHz; XPG 2TB-NVMe
patrickbeattie
Level 1
Level 1
Posts: 25
Joined: Mon Mar 22, 2021 4:01 am

Re: Bluetooth Mouse disconnecting

Post by patrickbeattie »

hglee wrote: Mon Mar 29, 2021 9:09 am
patrickbeattie wrote: Mon Mar 29, 2021 2:07 am Any other suggestions?


Let's see if adding a kernel parameter to disable Bluetooth autosuspend (btusb.enable_autosuspend=0) makes a difference.


The following commands first make a time-stamped backup of your grub file, add the kernel parameter, then update grub:

Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following three command-lines, one by one...

Code: Select all

Q=/etc/default/grub;sudo cp $Q{,-`date +%Y%m%d-%H%M%S`} # add btusb.enable_autosuspend=0
sed 's/btusb.enable_autosuspend=0//' $Q|tr -s ' '|sudo dd of=$Q 2>/dev/null
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/&btusb.enable_autosuspend=0 /' $Q&&sudo update-grub
Reboot.



If you later wish to remove that parameter, the following first makes a time-stamped backup, removes the parameter, then updates grub:

Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following two command-lines, one by one...

Code: Select all

Q=/etc/default/grub;sudo cp $Q{,-`date +%Y%m%d-%H%M%S`} # remove btusb.enable_autosuspend=0
sed 's/btusb.enable_autosuspend=0//' $Q|tr -s ' '|sudo dd of=$Q&&sudo update-grub

Other kernel parameters remain as is.


I have been testing this the last few days and it was working, the mouse did not stop. About once a session the mouse would freeze and after a few seconds it would work again. This was ok as I could live with it so long as it did not stop altogether. Unfortunately today the mouse stopped and never started again, on top of that the command i was using in terminal -

sudo modprobe -r btusb && sleep 20 && sudo modprobe btusb

to restart the thing also didn't work as it has done previously, so had to do a full restart.

One thing to mention I also have a Logitech keyboard that uses the dongle that came with it plugged into a usb port, this never stops unlike the Bluetooth mouse which is connected directly to the laptop.
This setup worked perfectly on Mint 19 and it was only when i updated to Mint 20 this problem started.

Here is an updated print of the technical info in case something else has changed-
https://termbin.com/lvbc
patrickbeattie
Level 1
Level 1
Posts: 25
Joined: Mon Mar 22, 2021 4:01 am

Re: Bluetooth Mouse disconnecting

Post by patrickbeattie »

I ran this command-
/etc/init.d/bluetooth status -l
and got this-
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-04-01 11:15:03 AEDT; 10h ago
Docs: man:bluetoothd(8)
Main PID: 681 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 18987)
Memory: 3.0M
CGroup: /system.slice/bluetooth.service
└─681 /usr/lib/bluetooth/bluetoothd

Apr 01 19:43:45 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:38 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:38 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:38 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:38 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:39 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:39 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:39 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:39 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
Apr 01 21:30:39 Linux-Mint bluetoothd[681]: bt_uhid_send: Invalid argument (22)
User avatar
hglee
Level 6
Level 6
Posts: 1422
Joined: Fri Jun 22, 2018 4:31 pm

Re: Bluetooth Mouse disconnecting

Post by hglee »

patrickbeattie wrote:I have been testing this the last few days and it was working, the mouse did not stop. About once a session the mouse would freeze and after a few seconds it would work again. This was ok as I could live with it so long as it did not stop altogether. Unfortunately today the mouse stopped and never started again...


Check that the mouse battery is fresh/charged. Hover your mouse pointer over the panel's battery-charge indicator to see its current condition. (I'm not sure about Cinnamon, but MATE's battery-charge indicator can provide an accurate breakdown of all battery-powered devices attached to the PC.)


Another means of discouraging Bluetooth autosuspend is with udev:

Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following two command-lines, one by one...

Code: Select all

echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="8087", ATTR{idProduct}=="07dc", ATTR{power/autosuspend}="-1"'|sudo tee /etc/udev/rules.d/btusb-power.rules
sudo udevadm control --reload-rules
Reboot.

If you later wish to undo the above action:

Code: Select all

sudo rm /etc/udev/rules.d/btusb-power.rules && sudo udevadm control --reload-rules
The above commands apply to your device ID 8087:07dc, it shouldn't be expected to work with anything else.


Does the Logitech Unifying Receiver peripherals manager (solaar) offer any configuration options for your MX? sudo apt install solaar


I'd like to see the wireless module configuration:

Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following two command-lines, one by one...

Code: Select all

sudo apt-get install -y sysfsutils >/dev/null
systool -vm iwlwifi
Copy the result output of the systool command. In a reply here, paste that text between BBCode code-block tags: [code] result output [/code].



Linux Mint 21 Vanessa, MATE 1.26.0, kernel 5.15.0*, Dell 2-in-1
AMD Ryzen 7 5825U / Barcelo iGPU - 14" WUXGA Touchscreen
MediaTek MT7921 WiFi-6 BT-5.2; 32GB DDR4@3200MHz; XPG 2TB-NVMe
patrickbeattie
Level 1
Level 1
Posts: 25
Joined: Mon Mar 22, 2021 4:01 am

Re: Bluetooth Mouse disconnecting

Post by patrickbeattie »

hglee wrote: Thu Apr 01, 2021 11:52 am
patrickbeattie wrote:I have been testing this the last few days and it was working, the mouse did not stop. About once a session the mouse would freeze and after a few seconds it would work again. This was ok as I could live with it so long as it did not stop altogether. Unfortunately today the mouse stopped and never started again...


Check that the mouse battery is fresh/charged. Hover your mouse pointer over the panel's battery-charge indicator to see its current condition. (I'm not sure about Cinnamon, but MATE's battery-charge indicator can provide an accurate breakdown of all battery-powered devices attached to the PC.)


Another means of discouraging Bluetooth autosuspend is with udev:

Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following two command-lines, one by one...

Code: Select all

echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="8087", ATTR{idProduct}=="07dc", ATTR{power/autosuspend}="-1"'|sudo tee /etc/udev/rules.d/btusb-power.rules
sudo udevadm control --reload-rules
Reboot.

If you later wish to undo the above action:

Code: Select all

sudo rm /etc/udev/rules.d/btusb-power.rules && sudo udevadm control --reload-rules
The above commands apply to your device ID 8087:07dc, it shouldn't be expected to work with anything else.


Does the Logitech Unifying Receiver peripherals manager (solaar) offer any configuration options for your MX? sudo apt install solaar


I'd like to see the wireless module configuration:

Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following two command-lines, one by one...

Code: Select all

sudo apt-get install -y sysfsutils >/dev/null
systool -vm iwlwifi
Copy the result output of the systool command. In a reply here, paste that text between BBCode code-block tags: [code] result output [/code].



Thank you for taking the time to reply.

Mouse battery is 60%, I will charge but don't believe this is the issue as the mouse will flash red light when battery is close to death.

Ran this command as instructed and will monitor for improvement-

echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="8087", ATTR{idProduct}=="07dc", ATTR{power/autosuspend}="-1"'|sudo tee /etc/udev/rules.d/btusb-power.rules
sudo udevadm control --reload-rules

Installed solaar and after trying to connect the mouse got the message-

A new device was detected but is not compatible with this receiver.

Here is the result output for module configuration-

Code: Select all

Module = "iwlwifi"

  Attributes:
    coresize            = "352256"
    initsize            = "0"
    initstate           = "live"
    refcnt              = "1"
    srcversion          = "2265E34390B728C05796AD0"
    taint               = ""
    uevent              = <store method only>

  Parameters:
    11n_disable         = "0"
    amsdu_size          = "0"
    bt_coex_active      = "Y"
    disable_11ac        = "N"
    disable_11ax        = "N"
    enable_ini          = "Y"
    fw_restart          = "Y"
    led_mode            = "0"
    nvm_file            = "(null)"
    power_level         = "0"
    power_save          = "N"
    remove_when_gone    = "N"
    swcrypto            = "0"
    uapsd_disable       = "3"

  Sections:
patrickbeattie
Level 1
Level 1
Posts: 25
Joined: Mon Mar 22, 2021 4:01 am

Re: Bluetooth Mouse disconnecting

Post by patrickbeattie »

After a couple of weeks I have had no more stopping of the mouse, so it seems one of the above commands has fixed the issue. I still get a momentary freeze of the mouse not long after system start up but this is a minor thing and can be lived with. Thank you to hglee for all your help.
Qneeyedjack
Level 1
Level 1
Posts: 2
Joined: Sun Aug 26, 2018 6:17 pm

Re: Bluetooth Mouse disconnecting

Post by Qneeyedjack »

I know you said the issue seems to be resolved but since you said there is still a lingering minor annoyance (as of ~6mo ago, anyway) and since you also stated that you have a Logitech keyboard using a USB dongle (never much cared for that word), I thought I might recommend that you take advantage of the unifying aspect of the receiver (that's better). This way, you could bypass your Bluetooth woes altogether. I have 4 Logitech USB peripheral devices all paired to the same receiver without issue. Just throwing it out there, as communication between peripheral device and receiver is much more reliable than it is via Bluetooth. My Android tablet experiences a similar problem as the one you were having with the frequent drops in communication when I switched to it with my M720 Triathlon over BT. Unfortunately, using a USB receiver is not an option there, so I can't heed my own advice. Another perk of using unifying receivers where possible is that doing so creates extra/blank dongles to be rewritten at a later date, which can come in very handy. For example, I have the aforementioned M720 paired with 2 receivers so that 2 of its 3 connections (main machine and Chromebook) are via receivers, thereby eliminating as much Bluetooth dependency as is possible. If the 3rd device weren't a tablet lacking a USB-A port, all 3 available connections would be via receiver.
Gelphi
Level 1
Level 1
Posts: 8
Joined: Thu Jul 14, 2022 5:55 pm

Re: Bluetooth Mouse disconnecting

Post by Gelphi »

echo "options btusb enable_autosuspend=0" | sudo tee /etc/modprobe.d/disable_btusb-autosuspend.conf

Worked for me. !
PlutoWA
Level 1
Level 1
Posts: 24
Joined: Wed Nov 27, 2019 3:51 am

Re: Bluetooth Mouse disconnecting

Post by PlutoWA »

Thanks Gelphi, I'll give it a try.
kajttek
Level 1
Level 1
Posts: 4
Joined: Fri Mar 06, 2020 12:49 pm

Re: Bluetooth Mouse disconnecting

Post by kajttek »

hglee wrote: Mon Mar 29, 2021 9:09 am
Open a Terminal (Ctrl-Alt-T), then copy-and-paste the following three command-lines, one by one...

Code: Select all

Q=/etc/default/grub;sudo cp $Q{,-`date +%Y%m%d-%H%M%S`} # add btusb.enable_autosuspend=0
sed 's/btusb.enable_autosuspend=0//' $Q|tr -s ' '|sudo dd of=$Q 2>/dev/null
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/&btusb.enable_autosuspend=0 /' $Q&&sudo update-grub
Reboot.



Hi, in MINT 21 the same situation with Bluetooth mouse,
I think this few command fix it.
Thanks @hglee
Marek Moehling
Level 1
Level 1
Posts: 3
Joined: Mon Jul 05, 2021 1:35 am

Re: Bluetooth Mouse disconnecting

Post by Marek Moehling »

After updating to 20.3 from 19.3 my bluetooth keyboard autosuspends after a while of inactivity, it takes several keystrokes to reactivate it. I tried everything here (thanks for your work, much appreciated) without avail except for:

Code: Select all

echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="8087", ATTR{idProduct}=="07dc", ATTR{power/autosuspend}="-1"'|sudo tee /etc/udev/rules.d/btusb-power.rules
sudo udevadm control --reload-rules
I'd like to try it but how do I find my ATTRS{idVendor} and ATTR{idProduct} Here's my https://termbin.com/4plp.
Locked

Return to “Hardware Support”