Hass.io and USB Bluetooth Dongle

I’ve read through the older threads on using USB Bluetooth dongles with Hassio /HassOS, but couldn’t find anything much newer than 2 years. My situation is the following:

I’m running HassIO in a qemu VM on Proxmox on an intel NUC. The NUC does not have builtin Bluetooth, so I bought a USB Bluetooth stick and passed through the physical port to the VM. The BT stick shows up in HassOS:

[    1.826272] usb 2-2: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[    1.826892] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.827235] usb 2-2: Product: Bluetooth Radio
[    1.827620] usb 2-2: Manufacturer: Realtek
[    1.827937] usb 2-2: SerialNumber: 

However, the OS does not seem to find or attempt to load the correct firmware, so accessing the device fails:

[    3.875375] Bluetooth: hci0: command 0x1001 tx timeout
[   11.875429] Bluetooth: hci0: RTL: HCI_OP_READ_LOCAL_VERSION failed (-110)

I am at a loss because I don’t have a real shell, but from what I can tell there is nothing in the /lib/firmware directory.

The big Bluetooth driver bash does not seem to include one for this device, which, granted, is pretty new: https://github.com/home-assistant/operating-system/pull/563

Is there any way to make HassIO/HassOS use this Bluetooth dongle?

It appears we have the BT dongle, based on Realtek 5.0 chip RTL8761b. Have you figured out how to make it work with HA?

Btw, Edimax has drivers for this chip here:
https://www.edimax.com/edimax/download/download/data/edimax/global/download/product/wireless_adapters/bluetooth/bt-8500/

Just encountered this error, similar setup with hassos in proxmox on a nuc.It was briefly working fine until i encoutered the same.

Did you every find a solution?

I have a BT dongle with the similar chipset, Realtek 5.0 chip RTL8761a and I got the following errors in the log:

[   13.030552] usb 1-2: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[   13.076566] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   13.110038] usb 1-2: Product: Bluetooth Radio
[   13.147179] usb 1-2: Manufacturer: Realtek
[   13.182644] usb 1-2: SerialNumber: 
[   13.527733] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[   13.630204] Bluetooth: hci0: RTL: rom_version status=0 version=1
[   13.655964] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761a_fw.bin
[   13.690333] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_fw.bin failed with error -2
[   13.723835] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761a_fw.bin not found

My environment is VirtualBox and Home Assistant OS 5.12.

Do you have anybody a solution to make it work? I just found the firmware but I don’t know how can I include it into the OS. Does someone know it?

There is are a set of changes to HASS OS that may fix this for most people

If Home Assistant is complaining about missing firmware, in a terminal do the following:

#  Based on: https://gist.github.com/rometsch/dfd24fb09c85c1ad2f25223dc1481aaa

# Make firmware directory
mkdir /lib/firmware/rtl_bt/

# install 7zip
apk add p7zip

# Download and extract mpow_BH519A drivers (contains Realtek BT firmware)
wget https://mpow.s3-us-west-1.amazonaws.com/mpow_BH519A_driver+for+Linux.7z

7zip -d mpow_BH519A_driver+for+Linux.7z

# For Realtek RTL8761B chip
mv 20201202_LINUX_BT_DRIVER/rtkbt-firmware/lib/firmware/rtl8761bu_fw /lib/firmware/rtl_bt/rtl8761b_fw.bin
mv 20201202_LINUX_BT_DRIVER/rtkbt-firmware/lib/firmware/rtl8761bu_config /lib/firmware/rtl_bt/rtl8761b_config.bin

# clean up
rm -rf 20201202_LINUX_BT_DRIVER

Reboot the device/VM

7 Likes

I have the same error, did anyone find a solution?

Just updated HASSOS OVA to 6.0.RC3 and noticed that bunch of RTL87xx firmware was added. But my RTL8761b still reproduces the same behavior as described by the TS. Seems like btrtl.c has an issue with the correct firmware lookup (a/b version mess). @agners could you please check this patch from another project, maybe it’s relevant to our problem as well? Thanks in advance!

1 Like

The Linux kernel we are using already support RTL8761B. However, currently the firmware is missing from the upstream linux-firmware project. Once it will come available, we can add the firmware to the base image. See also Missing firmware file rtl_bt/rtl8761b_fw.bin · Issue #1392 · home-assistant/operating-system · GitHub.

@vevs It looks like HassOS 6.1 has added RTL8761B firmware (I’ve tested RTL8761B dongle yesterday on “bare metal” HassOS installation and it works).

1 Like

Hi all
I’m still struggling with my USB dongle and could not figure out a way to fix it. I read a lot of articles and none of them worked out. I actually wanted to download the firmware files and load them into the host /lib/ folder but the system is preventing me to do this as it says the file system is read-only. I got the MPOW bh519a (not sure which RTL firmware it runs) and I’m getting the same error as in the first post here.

Does anybody have any idea?

I’m having a very similar issue. I have Home Assistant running as a docker on unRAID, and I can’t seem to get any Bluetooth functionality with the dongle I purchased. The firmware that is missing is the RTL8761B. Any progress mad eon this?

Hey

could you please share how you found out what specific firmware you’re missing?

run dmesg in the terminal, or dmesg | grep error to find out. I saw two lines that noted I was missing specific firmware.

1 Like

This is all I got if I run dmesg | grep -i blue

If I run | grep error or | grep firmware it doesn’t return anything…

Not sure then, that’s pretty much the limit of my Linux knowledge. You’re getting an error -110, which I think means connection timeout.

Mine shows the same as OP, with an error -2

I get this but still doesn’t work don’t know why

device_tracker:

  • platform: bluetooth_le_tracker
    interval_seconds: 60
    consider_home: 180
    new_device_defaults:
    track_new_devices: true

My device is this one Realtek RTL8761B - LinuxReviews

Error during Bluetooth LE scan: No BLE adapter found

16:10:24 – (ERROR) bluetooth_le_tracker - el mensaje se produjo por primera vez a las 16:08:22 y aparece 11 veces

No BLE adapter found

16:10:24 – (ERROR) /usr/local/lib/python3.9/site-packages/pygatt/backends/gatttool/gatttool.py - el mensaje se produjo por primera vez a las 16:08:22 y aparece 11 veces

i had to do much(!) digging to find drivers that worked and getting them installed so… take all this with a huge pinch of salt, you may need to google as i cant remember everythinng i did, but at least youll have the drivers.
https://drive.google.com/drive/folders/1d8le4PQdhJs60PIS4Jqk20SybjaK-toW?usp=sharing

you need 2 files (rtl8761b_fw.bin & rtl8761b_config)
you need to copy them to the pi (i used filezilla, dead easy), put them in the tmp folder
i actually got the bin file without the .bin extension and renamed it during the move, wont hurt to put both in the library folder.
copy these into tmp
rtl8761b_fw.bin
rtl8761b_config

cd /tmp
sudo mv /tmp/rtl8761b_fw.bin /lib/firmware/rtl_bt/rtl8761b_fw.bin
sudo mv /tmp/rtl8761b_config /lib/firmware/rtl_bt/rtl8761b_config

sudo systemctl start bluetooth.service
hciconfig -a hci0
if that doesnt set it into UP Running… hciconfig -a hci0 UP

how do you get into the protected system of the HA virtual machine to do this?