Hey , my blutooth is automatically Turning on and off so how can I fix this in ubuntu? [duplicate]

Solution 1:

I experienced the same issue, after a hot boot switch from Windows to Ubuntu, Bluetooth failed to work. I followed the Ubuntu bug report here, and Bluetooth fully functions. Use the following commands:

  1. sudo rmmod btusb
  2. sudo modprobe btusb

Solution 2:

I have the same problem with bluetooth with ubuntu 20.04, and fixed by this way

sudo apt install blueman

sudo add-apt-repository ppa:blaze/rtbth-dkms
sudo apt-get update
sudo apt-get install rtbth-dkms

sudo vim /etc/modules

Comment all and add this line

rtbth

Reboot and open

sudo blueman-manager

If still not work, try this

sudo rmmod btusb
sleep 1
sudo modprobe btusb

If still not work, try this

update /etc/default/grub with this value

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nommconf pcie_aspm=off"

update grub

sudo update-grub

then reboot and enjoy your music


Update for Bluetooth v5

Bluetooth v5 firmware solution source

If you get info from command: sudo dmesg | grep Bluetooth

... firmware file rtl_bt/rtl8761b_fw.bin not found

Try to download firmware and install

wget https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_config
wget https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_fw

sudo mv rtl8761b_config /usr/lib/firmware/rtl_bt/rtl8761b_config.bin
sudo mv rtl8761b_fw /usr/lib/firmware/rtl_bt/rtl8761b_fw.bin

Solution 3:

I also experienced this problem. For me, the error was related to python. The problem is with version 3.7. For me the following worked:

I uninstalled bluetooth:

sudo apt remove blueman

sudo apt autoremove

Then change your version of python to 3.6 or 3.8:

sudo update-alternatives --config python3

If this command does not work, you will need to run:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2

Then, re-run the command to change the python version.

To install bluetooth, it is necessary to have python-gi, for this, execute the command below:

sudo apt install python3-gi

After that, install the bluetooth again:

sudo apt install blueman -y && blueman-manager

Those were the steps I followed and it worked, but maybe just changing the version of python would have worked. When I try to go back to python 3.7, bluetooth stops working again. I don't know how to solve this, I just stopped using version 3.7.

Hope this helps.