Bluetooth service unable to start without "systemctl restart bluetooth"
Emily Wong
I've just received a new HP unit.
By default, after a fresh boot, the Bluetooth service is unable to start correctly and does not find any device to pair with nor the NetworkManager's Bluetooth indicator changes from "off" to "on" state.
Device:Bus 002 Device 002: ID 8087:0029 Intel Corp. AX200 Bluetooth
Logs indicate a problem with rfkill :
22:22:46 bluetoothd: Failed to set mode: Blocked through rfkill (0x12)
22:22:46 bluetoothd: Failed to set mode: Blocked through rfkill (0x12)
22:19:44 bluetoothd: Failed to set mode: Blocked through rfkill (0x12)
22:13:44 bluetoothd: Failed to set mode: Blocked through rfkill (0x12)
22:13:43 bluetoothd: Failed to set mode: Blocked through rfkill (0x12)Indeed, it is "soft blocked" :
# rfkill list
0: hci0: Bluetooth Soft blocked: yes Hard blocked: no
1: phy0: Wireless LAN Soft blocked: no Hard blocked: noIf I unblock it :
# sudo rfkill unblock Bluetooth
and restart it
# sudo systemctl restart bluetooth
It immediately works and connects to devices correctly.
However, if I switched it back off and on using NetworkManager applet, it is again not working and Bluetooth stays in "off" state.
So it seems the NetworkManager is unable to activate it back. Only then a subsequent systemctl restart bluetooth command seems to make it work again and change to "on" state as well as start listing nearby devices.
So, in short, NetworkManager is unable to activate the Bluetooth interface.
Note that concerning WiFi, it works as expected.
The issue is persistent across all kernels (as far as I have tested) on this device except 5.4.x. Independent of Ubuntu version, same issue on 20.04, 20.10 & 21.04. Same issue on boot from USB. Works with no issues on Windows.
The issue is occasionally not present after I restart the computer, but most of the time it is.
Is anyone able to assist with solving this issue, please?
2 Answers
On my HP elitebook G2 840, Intel® Core™ i5-5200U CPU @ 2.20GHz × 4 Ubuntu 20.04.2 LTS Linux 5.8.0-53-generic x86_64 this worked a bit:
Editing config file: sudo nano /etc/bluetooth/main.conf
Changing AutoEnable to True, taking out the #
Taking out # at Reconnect=7
Taking out # at Fastconnectable
Save and exit.
As per this post:
1I just fixed this with some help. First open terminal make yourself sudo with command:
sudo -i
cd /etc/init.dUse a text editor put this inside:
sleep 10
systemctl restart bluetooth.serviceSave this script as BLUETOOTHFIX.sh. Then enable to execute by terminal:
chmod 755 /etc/init.d/BLUETOOTHFIX.sh
chmod +x /etc/init.d/BLUETOOTHFIX.sh
ln -s /etc/init.d/BLUETOOTHFIX.sh /etc/rc3.d/S99BLUETOOTHFIX.sh 1