[ How-To ] Linux Installation

Using the BTD-300 and BTD-400 on Ubuntu Linux and other distributions

Ubuntu

Our BTD-300 and BTD-400 USB Bluetooth adapters are compatible on Ubuntu Linux and derivatives. The required drivers are included with Ubuntu 12.04 and later. Click here on official documentation on how to use Bluetooth.

*Note: If your laptop has a built-in Bluetooth adapter, it will need to be disabled (See *advance section below) before using the USB Bluetooth adapter. Don’t uninstall the Bluetooth management software in the last step!

For other Linux distributions, you’ll need to install the BlueZ Bluetooth stack and the BlueMan Bluetooth Manager. Consult your distribution’s web site to see if the Bluez and Blueman software are available as a ready-to-install software package.

Turning on Bluetooth

  1. Plug in the Bluetooth adapter
  2. Click the Bluetooth Icon in the toolbar
  3. Click turn on Bluetooth

Connecting a Device

  1. Click the Bluetooth icon in the menu bar and select Set Up New Device.
  2. Make the other Bluetooth device discoverable or visible and place it within 10 meters (about 33 feet) of your computer. Click Continue. Your computer will begin searching for devices.
  3. If there are too many devices listed, use the Device type drop-down to display only a single type of device in the list.
  4. Click PIN options to set how a PIN will be delivered to the other device.
  5. The automatic PIN setting will use a six-digit numerical code. A device with no input keys or screen, such as a mouse or headset, may require a specific PIN such as 0000, or no PIN at all. Check your device’s manual for the proper setting.
  6. Choose an appropriate PIN setting for your device, then click Close.
  7. Click Continue to proceed. If you did not choose a preset PIN, the PIN will be displayed on the screen.
  8. If required, confirm the PIN on your other device. The device should show you the PIN you see on your computer screen, or may prompt you to enter the PIN. Confirm the PIN on the device, then click Matches.

You need to finish your entry within about 20 seconds on most devices, or the connection will not be completed. If that happens, return to the device list and start again.

  1. A message appears when the connection successfully completes. Click Close.

Set Playback Devices

  1. Click the Speaker icon on the toolbar and select Audio Setup
  2. Select the Audio Hardware Setup Tab
  3. Click Profile drop-down box and select Off

Linux Driver Installation

The Linux kernels after June 2012 have the drivers for the Broadcom Bluetooth chipset. They are present in Linux kernel versions 3.0.x, 3.2.x and 3.4.x. It also present in Linux kernels 4.0 and above so no driver installation is required.

KDE and GNOME

The KDE and GNOME desktop environments provide Bluetooth configuration and management utilities. If not installed by default, you will need to install them with your Linux distribution’s package manager.

Debian, Linux, Ubuntu and Ubuntu derivatives usually have the Bluez Bluetooth stack installed by default along with a Bluetooth manager. We recommend opening a terminal window and typing the following commands to install the necessary packages:

sudo apt-get install bluez blueman

The above command will install the Bluez Bluetooth stack and the Blueman Bluetooth manager. If they are already installed, apt-get will report that the packages are already present on your system.

Fedora

Fedora, Red Hat Enterprise and CentOS have their own packages available. The Fedora Project Wiki has an article on using Bluetooth and the required packages. Red Hat Enterprise and CentOS have the Bluez Bluetooth stack that can be installed via the package management tool.

ubuntu / version of Raspberry pie and other distributions need to have crisp clear instructions.

Red Hat/CentOS

*Advance Section

Blacklisting a single USB device from Linux

It’s possible to blacklist a single USB device from connecting to Linux, while allowing similar USB devices to connect. In my case, I wanted to disable my laptop’s built in Bluetooth host (a USB device installed inside the laptop). However I wanted a second USB Bluetooth host, integrated as part of my new WiFi card, to still work.

I hadn’t seen a lot of discussion of this online so I thought I’d post the details.

Short version

Create a udev rule that uses the USB authorisation mechanism in the kernel to de-authorize the device. The bus will put the device into suspend mode, and it’ll never become active.

I put my rule into a new file /etc/udev/rules.d/81-bluetooth-hci.rules. It blacklists any USB device with Vendor ID 0a5c and Product ID 217f. Here’s the entire contents of the rule file:

Lenovo Broadcom based HCI should be disabled

SUBSYSTEM==“usb”, ATTRS{idVendor}==“0a5c”, ATTRS{idProduct}==“217f”, ATTR{authorized}=“0”

(The file is exactly two lines long – a one line comment and then a single line below that with the udev rule. The blog theme renders it as multiple lines.)

More detailed explanation

The most common way to “blacklist” devices from appearing in a generic Linux kernel is to use module blacklisting, so a particular module is never loaded and any devices that rely on that module can’t be used.

This doesn’t work if you want to blacklist a single device of a particular type (ie my case of wanting one Bluetooth HCI but not the other Bluetooth HCI, they both use the module btusb so I can’t blacklist it).

USB device authorisation allows you to do this, at least for USB devices. It was added to the kernel in 2007 when the Wireless USB standard was coming out(remember that?).

Most posts about authorisation take the point of view of locking down your USB subsystem so only trusted devices can connect. This is how it’s described in the kernel documentation. However, as we’ve just seen, you can use the same authorisation mechanism to automatically disable a particular device.

Identifying a device

You can usually identify the USB device you want to blacklist via the USB IDs shown in lsusb output, written into a udev rule as shown above. However if that’s not enough there is also the udevadm info feature called “attrwalk”. For example, to walk all udev attributes of my Bluetooth hci device:

udevadm info -a -p /sys/class/bluetooth/hci0

Any of the ATTRS printed in the output can be used to identify/match USB devices to be disabled. Note that the output may “walk” past the device and into higher-up devices on the bus, so the earlier blocks of output are the most useful.

Devices which are de-authorised seem to be put into suspend mode, so if they are bus powered then this means they should consume almost neglible current. I can’t really tell how much current the USB Bluetooth device built into my laptop uses while suspended, but it’s definitely less annoying than having to pass --hci X arguments to all my Bluetooth LE tools.