Bluetooth – Soft-Blocked and rfkill Unblock Doesn’t Work

bluetooth

The pretext is that I have been looking for a new distro and live booting several install media (Mint, Ubuntu, Debian) and somewhere along the line my bluetooth radio stopped working. My guess is that there is some minor difference in the way bluetooth is handled in the distros and it entered an unspecified state.

None of the GUI controls in any of the distros were able to switch it on again. Whenever I clicked it on, it immediately moved back to off position… there was no error message; it just didn't work.

This has happened to me before!
I have had this happen to me on two different computers.
First time was several years ago; so long ago that I couldn't remember how I fixed it then! As far as I recalled I just played around with rfkill, and then suddenly it worked.

But, to my annoyance, for some time I haven't been able to solve this – google didn't help me.
I kept trying to unblock (or block-then-unblock) bluetooth using rfkill, but nothing happened. Status was always "Soft blocked: yes". Switching the hardware flight-mode button on and off didn't help either.
Below is command line of my attempts:

root@lsb-hp6570b-deb:/home/jcxz100# rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: hp-wwan: Wireless WAN
    Soft blocked: no
    Hard blocked: no
3: hp-gps: GPS
    Soft blocked: no
    Hard blocked: no
4: hp-bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no
root@lsb-hp6570b-deb:/home/jcxz100# rfkill unblock 4
root@lsb-hp6570b-deb:/home/jcxz100# rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: hp-wwan: Wireless WAN
    Soft blocked: no
    Hard blocked: no
3: hp-gps: GPS
    Soft blocked: no
    Hard blocked: no
4: hp-bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no
root@lsb-hp6570b-deb:/home/jcxz100# rfkill block 4
root@lsb-hp6570b-deb:/home/jcxz100# rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: hp-wwan: Wireless WAN
    Soft blocked: no
    Hard blocked: no
3: hp-gps: GPS
    Soft blocked: no
    Hard blocked: no
4: hp-bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no
root@lsb-hp6570b-deb:/home/jcxz100# rfkill unblock 4
root@lsb-hp6570b-deb:/home/jcxz100# rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: hp-wwan: Wireless WAN
    Soft blocked: no
    Hard blocked: no
3: hp-gps: GPS
    Soft blocked: no
    Hard blocked: no
4: hp-bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no
root@lsb-hp6570b-deb:/home/jcxz100# rfkill block bluetooth
root@lsb-hp6570b-deb:/home/jcxz100# rfkill unblock bluetooth
root@lsb-hp6570b-deb:/home/jcxz100# rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: hp-wwan: Wireless WAN
    Soft blocked: no
    Hard blocked: no
3: hp-gps: GPS
    Soft blocked: no
    Hard blocked: no
4: hp-bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no

I'm using Debian 9.9 and my rfkill is version "0.5-1+b1 (Debian)", but as this has happened before to me on Mint 16 (or maybe 17) on an older computer, I won't go into detail with my specs.

See my own solution below.

Best Answer

Just this evening I stumbled upon the "solution" (which I would characterize as a work-around for a peculiarity (bug?) in the rfkill command).

You have to use this command:

rfkill unblock all

Just unblocking bluetooth alone doesn't work as seen above.

root@lsb-hp6570b-deb:/home/jcxz100# rfkill block all
root@lsb-hp6570b-deb:/home/jcxz100# rfkill list
0: phy0: Wireless LAN
    Soft blocked: yes
    Hard blocked: yes
1: hp-wifi: Wireless LAN
    Soft blocked: yes
    Hard blocked: no
2: hp-wwan: Wireless WAN
    Soft blocked: yes
    Hard blocked: no
3: hp-gps: GPS
    Soft blocked: yes
    Hard blocked: no
4: hp-bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no
root@lsb-hp6570b-deb:/home/jcxz100# rfkill unblock all
root@lsb-hp6570b-deb:/home/jcxz100# rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
2: hp-wwan: Wireless WAN
    Soft blocked: no
    Hard blocked: no
3: hp-gps: GPS
    Soft blocked: no
    Hard blocked: no
4: hp-bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
5: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no

It seems rfkill sees the bluetooth radio as soft-blocked when listing but not when asked to unblock... thus is does nothing. But when the "all" target is used, it just goes ahead and changes the state of every radio without judging if they are already unblocked.

Related Question