home-assistant / operating-system

:beginner: Home Assistant Operating System
Apache License 2.0
4.8k stars 959 forks source link

Realtek bluetooth 5 dongle fails from time to time #1273

Closed clau-bucur closed 3 years ago

clau-bucur commented 3 years ago

Hardware Environment

Home Assistant OS release:

agners commented 3 years ago

This sounds like a missing firmware.

clau-bucur commented 3 years ago

It works most of the time, so shouldn't mean that the firmware is there?

agners commented 3 years ago

-2 means "No such file or directory", and from what I can see Home Assistant OS has that firmware not installed. Not sure why it works sometime, some devices have a default firmware (which might be buggy and hence work only sometimes?), or it could be that your host Operating System's driver loads the firmware before passing it to the virtual machine maybe? Wild guess.

clau-bucur commented 3 years ago

I see. Is there a way that I can add the firmware manually until it will be a standard part of HassOS ?

kelos-01 commented 3 years ago

Not sure if I should log a bug/enhancement as well, seem to be having the same issue. I see the commit is completed but still in Dev. (btw thanks @agners)

[16263.319768] usb 1-1.4: USB disconnect, device number 4
[16642.754635] usb 1-1.2: new full-speed USB device number 5 using dwc_otg
[16642.887871] usb 1-1.2: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[16642.887899] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[16642.887919] usb 1-1.2: Product: Bluetooth Radio
[16642.887936] usb 1-1.2: Manufacturer: Realtek
[16642.887953] usb 1-1.2: SerialNumber: 00E04C239987
[16642.907465] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[16642.909456] Bluetooth: hci0: RTL: rom_version status=0 version=1
[16642.909486] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761b_fw.bin
[16642.923271] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761b_fw.bin failed with error -2
[16642.923306] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761b_fw.bin not found
clau-bucur commented 3 years ago

@agners is this fix included in 5.13? The 5.13 update does not show up in HA though.

clau-bucur commented 3 years ago

Looks like 5.13 does not contain the fix, as the behavior remains unchanged after 5.13 upgrade.

GreyTeardrop commented 3 years ago

I've upgraded to OS 6.0.rc1 that is supposed to have Realtek Bluetooth drivers bundled according to the release notes, but alas, I see the same issue. My host is ODroid N2+ (Home Assistant Blue)

~ $ bluetoothctl list
~ $ ha os info
board: odroid-n2
boot: B
update_available: false
version: 6.0.rc1
version_latest: 6.0.rc1
~ $ ha host logs|grep -i bluetooth
[    3.461272] Bluetooth: Core ver 2.22
[    3.465123] Bluetooth: HCI device and connection manager initialized
[    3.471016] Bluetooth: HCI socket layer initialized
[    3.475603] Bluetooth: L2CAP socket layer initialized
[    3.482178] Bluetooth: SCO socket layer initialized
[    3.497825] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
[    3.504819] Bluetooth: hci0: RTL: rom_version status=0 version=1
[    3.509350] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761b_fw.bin
[    3.517721] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761b_fw.bin failed with error -2
[    3.524450] bluetooth hci0: Falling back to sysfs fallback for: rtl_bt/rtl8761b_fw.bin
[   64.482850] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761b_fw.bin not found
wzaatar commented 3 years ago

Confirming the issue is still there with OS 5.13 and Supervisor 2021.05.4 also on ODROID (HA Blue).

Side note: I tried following the instructions at https://community.home-assistant.io/t/hass-io-and-usb-bluetooth-dongle/217917/4 but a reboot erases the folder and files.

The issue title should be changed to "fails all the time"...

agners commented 3 years ago

@clau-bucur @wzaatar the fix is in the development branch, so no changes in 5.13 or future 5 releases.

@GreyTeardrop @kelos-01 your devices seem to request a different firmware (note the b in rtl_bt/rtl8761b_fw.bin). I'll check if I can add this firmware as well.

agners commented 3 years ago

It seems that rtl_bt/rtl8761b_fw.bin is not available in the upstream linux-firmware repository. Splitting this firmware into a separate issue #1392.

The firmware @clau-bucur was mentioning (rtl_bt/rtl8761a_fw.bin) will be shipped in release 6 (see #1283). Hence closing.

baidkamikamushi-visitorQ commented 2 years ago

same issue, need to sleep. need some help from real github administrators and coder im only a clicking machine on google twitter YT and linux. ans some shell XD gn8

baidkamikamushi-visitorQ commented 2 years ago

same issue, need to sleep. need some help from real github administrators and coder im only a clicking machine on google twitter YT and linux. ans some shell XD gn8

mmmh mirror mirror on the wall, googly googly need some more, cannabis