3

After 5 years my laptop is in perfect condition (still).

But my built-in bluetooth is not what it used to be (thanks to the extensive use of it) and fails to load at boot pretty much. Because of extensive use I opted to buy a 10 dollar bluetooth stick which took over the job of the built-in one.

However, the built-in one is mostly not on but sometimes it still gives a spark. At that times it's sometimes really annoying because it just screws my settings and overwrites several things.

My question: how can I make sure the built-in bluetooth is permanently disabled while the USB-device is still able to send my audio/pointing devices/... through.

System: Linux Mint 18 (Base: Ubuntu 16.04)

lsusb-output:

jeroen@laptop ~ $ lsusb
Bus 002 Device 002: ID 5986:02ac Acer, Inc 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 138a:0018 Validity Sensors, Inc. Fingerprint scanner
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
(Built-in BT) Bus 003 Device 004: ID 0a5c:21b4 Broadcom Corp. BCM2070 Bluetooth 2.1 + EDR
(USB-BT) Bus 003 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Update: test output

(as requested by Dirkt)

jeroen@laptop ~ $ sudo hcitool dev
Devices:
    hci0    00:1B:DC:0F:73:5D
    hci1    CC:52:AF:A8:71:B5
## Plugged out the USB-BT dongle
jeroen@laptop ~ $ sudo hcitool dev
Devices:
    hci1    CC:52:AF:A8:71:B5
## Plugged in the USB-BT dongle
jeroen@laptop ~ $ sudo rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
4: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
5: hp-bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
6: hci1: Bluetooth
    Soft blocked: no
    Hard blocked: no
8: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
jeroen@laptop ~ $ sudo rfkill block 5
jeroen@laptop ~ $ sudo rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
4: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
5: hp-bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
6: hci1: Bluetooth
    Soft blocked: no
    Hard blocked: no
8: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
jeroen@laptop ~ $ sudo rfkill block 6
jeroen@laptop ~ $ sudo rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
4: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
5: hp-bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
6: hci1: Bluetooth
    Soft blocked: yes
    Hard blocked: no
8: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
jeroen@laptop ~ $ sudo rfkill block 8
jeroen@laptop ~ $ sudo rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
4: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
5: hp-bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
6: hci1: Bluetooth
    Soft blocked: yes
    Hard blocked: no
8: hci0: Bluetooth
    Soft blocked: yes
    Hard blocked: no
jeroen@laptop ~ $ sudo rfkill unblock 8
jeroen@laptop ~ $ sudo rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
4: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
5: hp-bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
6: hci1: Bluetooth
    Soft blocked: no
    Hard blocked: no
8: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
jeroen@laptop ~ $ sudo rfkill unblock 6
jeroen@laptop ~ $ sudo rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
4: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
5: hp-bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
6: hci1: Bluetooth
    Soft blocked: no
    Hard blocked: no
8: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
jeroen@laptop ~ $ sudo rfkill unblock 5
jeroen@laptop ~ $ sudo rfkill list
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
4: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
5: hp-bluetooth: Bluetooth
    Soft blocked: no
    Hard blocked: no
6: hci1: Bluetooth
    Soft blocked: no
    Hard blocked: no
8: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
1
  • Unfortunately, Linux Mint is off-topic here, as we only support official Ubuntu versions (basically any version that has some variation of "Ubuntu" in the name -- see Help Center for list). You'd be better off at Unix & Linux. Oct 5 '16 at 0:02
3

Option 1: Use rfkill.

This will disable transmitting on the device that is blocked, and usually also put the drivers in a "down" state. rfkill help for commands, rfkill list to list devices which can be rfkill'ed, rfkill block <index>|<type> to block it. You might need an index, and I don't know if indices stay consistent across boots, so you'll probably need to write a little script with grep, cut etc to be on the safe side. You may need to install the package for the rfkill command.

Edit: If you are worried about changing indices, do something like

HCI=`hcitool dev | grep '00:11:22:33:44:55' | cut -f2`
INDEX=`rfkill list | grep $HCI | cut -d: -f1`

(but of course with the MAC-address of your internal bluetooth adapter), and $INDEX should contain the index of it. I can't test this, as I don't have hardware with more than one bluetooth adapter.

Another way would be to use udev rules to make special names for the known adapters, but that's probably more difficult to figure out than to use the above two lines.

In the end, there's no alternative to using the rfkill kernel features to completely disable a bluetooth radio, though there may be other commandline interfaces to it I'm not aware of.

Option 2: Blacklist kernel module

If after boot the built-in bluetooth device is in a disabled state, and the kernel driver is compiled as a module, you can keep the driver from loading and enabling the device by blacklisting it. Use lsmod to list the modules currently loaded, and have a look at dmesg or your syslog after boot to identify the driver for your built-in bluetooth device. Blacklisting it depends on the distribution you use, e.g. on Debian (and probably Ubuntu, too), make a file in /etc/modprobe.d/ that contains the line blacklist <modulname>. See man modprobe.d for details.

If the built-in bluetooth device boots in enabled state, blacklisting the driver will prevent you from using it, but if it's broken, it may still transmit stuff.

17
  • Isn't this also going to disable the USB-bluetooth as they are both use btusb driver (The built-in uses an internal USB-port) Oct 5 '16 at 7:36
  • The first option is not an option as the ports are not consistent :( Oct 5 '16 at 7:38
  • I've never actually used a system with two BT adapters, but I'd assume they show up differently under rfkill list. What's the output of that command on your system?
    – dirkt
    Oct 5 '16 at 8:09
  • I just checked the rfkill and blacklist options and unfortunelatey both options did not work. The blacklist didn't work for some reason (the special btbcm driver mentioned in lsmod did load after reboot) and the rfkill option disabled both bluetooth-drivers. Oct 8 '16 at 21:14
  • Could you post the output of rfkill list? You used an index for rfkill block, didn't you? If it disabled BT devices both using an index, that looks like a bug. If the bug is in rfkill, maybe one can use some /sys or /proc interface directly, I'd have to look into that. If you can't successfully blacklist a driver, there's probably some mistake in the configuration file you wrote.
    – dirkt
    Oct 9 '16 at 5:37
1

You can create a udev rule to disable the internal Bluetooth. Put the following in /etc/udev/rules.d/81-bluetooth-hci.rules:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0a5c", ATTRS{idProduct}=="21b4", ATTR{authorized}="0"

And reboot.

Solution found on AskUbuntu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.