I was recently looking for a bluetooth dongle that was linux compatible to pass through to my HomeAssistant docker container. I came across the Asus BT-400 which looked to work.
Installation steps are quite straight-forward, but you need to extract and convert a driver file from the windows driver package.
This should work on all linux distros, though obviously you may have to swap apt install
for yum install
or whatever is right for the distro you are using.
Work out which driver file you need
First download the driver
1
2
curl 'https://dlcdnets.asus.com/pub/ASUS/wireless/USB-BT400/DR_USB_BT400_1201710_Windows.zip' \
-o bt400-driver.zip
Next you need to find out what driver file your OS is expecting for the device. Plug in the dongle then run
1
dmesg
You should see an output similar to this
1
2
3
4
5
6
7
8
9
10
11
12
[ 4507.934913] usb 2-1.6: new full-speed USB device number 6 using ehci-pci
[ 4508.046595] usb 2-1.6: New USB device found, idVendor=0b05, idProduct=17cb
[ 4508.046599] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4508.046600] usb 2-1.6: Product: BCM20702A0
[ 4508.046602] usb 2-1.6: Manufacturer: Broadcom Corp
[ 4508.046603] usb 2-1.6: SerialNumber: 5CF3709911C3
[ 4508.157541] Bluetooth: hci0: BCM: chip id 63
[ 4508.158516] Bluetooth: hci0: BCM: features 0x07
[ 4508.174532] Bluetooth: hci0: BCM20702A
[ 4508.175548] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[ 4508.175568] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0b05-17cb.hcd failed with error -2
[ 4508.175571] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0b05-17cb.hcd not found
Which means your device ID is 0b05:17cb
and the driver file it’s looking for should exist at /lib/firmware/brcm/BCM20702A1-0b05-17cb.hcd
We can lookup what the equivalent file is in the windows driver package next
1
2
3
4
curl -s 'https://aur.archlinux.org/cgit/aur.git/tree/filelist.txt?h=bcm20702a1-firmware' \
| grep '0B05:17CB'
0B05:17CB: BCM20702A1_001.002.014.1443.1467.hex
So the file we need from the zip is BCM20702A1_001.002.014.1443.1467.hex
Create a linux driver file
In order to use hex2hcd you will need to install the bluez package, which you’ll also need installed on the host if you want to pass the dongle through to HomeAssistant in docker.
1
2
sudo apt update
sudo apt install bluez
Now you can unzip the driver package we downloaded earlier and convert the hex file to a hcd file.
1
2
3
unzip bt400-driver.zip
cd Win10_USB-BT400_DRIVERS/Win10_USB-BT400_Driver_Package/64
hex2hcd BCM20702A1_001.002.014.1443.1467.hex -o BCM20702A1-0b05-17cb.hcd
Then copy the driver into the right directory for the OS
1
2
sudo mkdir -p /lib/firmware/brcm/
sudo cp BCM20702A1-0b05-17cb.hcd /lib/firmware/brcm/
Re-connect the dongle
Simply unplug the dongle and plug it back in, run dmesg
again and you should see this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
dmesg
[ 4547.358736] usb 2-1.6: new full-speed USB device number 7 using ehci-pci
[ 4547.471204] usb 2-1.6: New USB device found, idVendor=0b05, idProduct=17cb
[ 4547.471208] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4547.471210] usb 2-1.6: Product: BCM20702A0
[ 4547.471212] usb 2-1.6: Manufacturer: Broadcom Corp
[ 4547.471213] usb 2-1.6: SerialNumber: 5CF3709911C3
[ 4547.581275] Bluetooth: hci0: BCM: chip id 63
[ 4547.582284] Bluetooth: hci0: BCM: features 0x07
[ 4547.598294] Bluetooth: hci0: BCM20702A
[ 4547.599218] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[ 4548.468305] Bluetooth: hci0: BCM20702A1 (001.002.014) build 1467
[ 4548.484290] Bluetooth: hci0: Broadcom Bluetooth Device
Further homeassistant setup
If you are wanting to use the dongle in HomeAssistant as I was you will need to pass dbus through. In your docker-compose file add
1
2
volumes:
- /run/dbus:/run/dbus:ro
If you are running HomeAssistant in docker you should notice that it has detected a new Bluetooth device.
You can check it’s passed through correctly by running hciconfig
inside the docker container which should list the device.
You can also use bluetoothctl
to check that it can find the device you’re trying to connect to.
Credit goes to - https://gist.github.com/ssledz/69b7f7b0438e653c08c155e244fdf7d8.
I have added the instructions here as it took me days of searching to find the right answer.
Comments powered by Disqus.