Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware files are missing for broadcom bluetooth adapters #2222

Open
bdraco opened this issue Nov 9, 2022 · 13 comments
Open

Firmware files are missing for broadcom bluetooth adapters #2222

bdraco opened this issue Nov 9, 2022 · 13 comments
Labels
bug pinned Prevents from getting marked as stale

Comments

@bdraco
Copy link
Member

bdraco commented Nov 9, 2022

Describe the issue you are experiencing

related issues home-assistant/core#78012 home-assistant/core#81767 home-assistant/core#80366 (maybe home-assistant/core#81359) home-assistant/core#82279

related update https://forums.raspberrypi.com/viewtopic.php?t=292113

files are available here https://github.com/winterheart/broadcom-bt-firmware

documented here home-assistant/home-assistant.io#24865

What operating system image do you use?

odroid-n2 (Hardkernel ODROID-N2/N2+)

What version of Home Assistant Operating System is installed?

9.3

Did you upgrade the Operating System.

Yes

Steps to reproduce the issue

Install broadcom adapter, notice error in journal about missing firmware

Anything in the Supervisor logs that might be useful for us?

n/a

Anything in the Host logs that might be useful for us?

see above

System information

No response

Additional information

No response

@bdraco bdraco added the bug label Nov 9, 2022
@bdraco bdraco changed the title Firmware files are missing for broadcom adapters Firmware files are missing for broadcom bluetooth adapters Nov 9, 2022
@bdraco
Copy link
Member Author

bdraco commented Nov 9, 2022

Workaround

mkdir /mnt/data/firmware
cp -afv /lib/firmware/* /mnt/data/firmware
mount -o bind /mnt/data/firmware /lib/firmware

Install the bcrm dir from https://github.com/winterheart/broadcom-bt-firmware into /mnt/data/firmware/bcrm,

unplug and replug adapter

Must be done on every boot

@bdraco
Copy link
Member Author

bdraco commented Nov 10, 2022

This PR fixes the discovery home-assistant/core#81926

CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y is only enabled on the Odroid n2+ platform so this issue is most relevant there.

agners added a commit to agners/operating-system that referenced this issue Nov 14, 2022
This slows down firmware loading which causes Bluetooth initialization
to delay unecessarily.
agners added a commit that referenced this issue Nov 14, 2022
This slows down firmware loading which causes Bluetooth initialization
to delay unecessarily.
agners added a commit that referenced this issue Nov 30, 2022
This slows down firmware loading which causes Bluetooth initialization
to delay unecessarily.
@nagi121
Copy link

nagi121 commented Jan 20, 2023

#2222 (comment)

I tried the workaround to make my broadcom adapter work again with no success. The mount does not work:

[core-ssh ~]$ mount -o bind /mnt/data/firmware /lib/firmware

mount: mounting /mnt/data/firmware on /lib/firmware failed: Permission denied

I have a SSD attached to ODROID-N2+ and moved all data to SSD using Home Assistant http://homeassistant.local:8123/config/storage

When will there be a permanent solution to this problem?

@bdraco
Copy link
Member Author

bdraco commented Jan 20, 2023

When will there be a permanent solution to this problem?

I would pick up one of the CSR adapters from the High performance list at https://www.home-assistant.io/integrations/bluetooth/ since they don't need any patch files.

I'm using the Feasycom FSC-BP119 (CSR8510A10) US $19.99 | 100m Long range Bluetooth USB Dongle Wireless Bluetooth 4.0 CSR Adapter for Windows 10, 8, 7 XP vista
https://a.aliexpress.com/_mM1DlzG

@nagi121
Copy link

nagi121 commented Jan 20, 2023

If I am right, the BCM firmware patch files fix a security issue.
Buying other hardware is only an intermediate solution, because in the future the new hardware may also need firmware updates to work.

I think, a solution is needed to provide the Homeassistant OS with firmware patch files from other sources. I would like to have a folder, where I can place the downloaded firmware patch files and they will be picked up at startup. Maybe a script like the workaround mentioned above.

@dbuezas
Copy link

dbuezas commented Apr 15, 2023

@bdraco I can't get the workaround to work. I tried:

  • copying the file directly to /lib/firmeware/bcrm (I assume that was a typo in your post but tried anyway)
  • copying the file directly to /lib/firmeware/brcm
  • copying the file directly to /lib/firmeware/
  • rebooting and retrying
  • removing and reinserting the dongle after each step
  • using mnt/data and your exact bash commands (I had to mkdir /mnt/data too)
  • adding the single file dmesg | grep -i bluetooth asks for
  • adding all files from the drivers repository
  • renaming the file to the second name dmesg suggests

And unfortunately nothing seems to work :(
I have a Home Assistant Blue running 2023.4.1 and

 ➜  dmesg | grep -i bluetooth

always gives back

[ 2341.885901] Bluetooth: hci2: BCM20702A
[ 2341.885916] Bluetooth: hci2: BCM20702A1 (001.002.014) build 0000
[ 2341.886931] Bluetooth: hci2: BCM: firmware Patch file not found, tried:
[ 2341.888364] Bluetooth: hci2: BCM: 'brcm/BCM20702A1-0a5c-21e8.hcd'
[ 2341.894405] Bluetooth: hci2: BCM: 'brcm/BCM-0a5c-21e8.hcd'

Anything else I can try? I have other two dongles working:

  • Feasycom FSC-BP119 (CSR8510A10) 📶
  • ZEXMTE BT-505 (RTL8761BU) 📶
    but I'd really to get my LM Technologies LM1010 (BCM20702A0) 📶 working again

Any tip highly appreciated :)

@bdraco
Copy link
Member Author

bdraco commented Apr 15, 2023

You can use #2225 now if you are running the 10.x RCs

@dbuezas
Copy link

dbuezas commented Apr 15, 2023

Thank you for the pointer, this looks promising but I still didn't succeed.
Am I doing something wrong?

I'm now on 10.x RC

~ ha os info
board: odroid-n2
boot: A
data_disk: G1J39E-0x116d3956
update_available: false
version: 10.0.rc4     
version_latest: 10.0.rc4

I created the folder in the right place and copied the driver it is asking for there

~ ls -la /mnt/data/supervisor/firmware/brcm/BCM20702A1-0a5c-21e8.hcd
-rw-r--r--    1 root     root         35934 Apr 15 22:00 /mnt/data/supervisor/firmware/brcm/BCM20702A1-0a5c-21e8.hcd

But it still doesn't find it

~ dmesg | grep -i bluetooth
...
[  355.836186] Bluetooth: hci1: BCM20702A1 (001.002.014) build 0000
[  355.837213] Bluetooth: hci1: BCM: firmware Patch file not found, tried:
[  355.838197] Bluetooth: hci1: BCM: 'brcm/BCM20702A1-0a5c-21e8.hardkernel,odroid-n2-plus.hcd'
[  355.846497] Bluetooth: hci1: BCM: 'brcm/BCM20702A1-0a5c-21e8.hcd'
[  355.852515] Bluetooth: hci1: BCM: 'brcm/BCM-0a5c-21e8.hardkernel,odroid-n2-plus.hcd'
[  355.860210] Bluetooth: hci1: BCM: 'brcm/BCM-0a5c-21e8.hcd'
[  355.918502] Bluetooth: MGMT ver 1.22

@bdraco
Copy link
Member Author

bdraco commented Apr 15, 2023

It looks right to me. Looks like #2225 might need some more work

@emontnemery
Copy link

emontnemery commented May 9, 2023

This works for me on a dev build where the feature was just introduced.

@dbuezas Based on what you've pasted above it looks like you've created a /mnt/data/supervisor/firmware from within the ssh docker container, which won't work.

To access the host via ssh: https://developers.home-assistant.io/docs/operating-system/debugging/#ssh-access-to-the-host

Output from host ssh:

# ha os info
board: yellow
boot: B
data_disk: AJTD4R-0x3b154ae2
update_available: true
version: 10.0.dev20230302
version_latest: 11.0.dev20230501
# readlink -f /usr/lib/firmware/updates/
/mnt/data/supervisor/firmware
# ls -la /mnt/data/supervisor/firmware/brcm
total 44
drwxr-xr-x    2 root     root          4096 Mar  6 18:23 .
drwxr-xr-x    3 root     root          4096 Mar  6 18:20 ..
-rw-r--r--    1 root     root         35000 Mar  6 18:23 BCM20702A1-0b05-17cb.hcd
# dmesg | grep -i bluetooth
[2929343.052516] Bluetooth: Core ver 2.22
[2929343.052678] NET: Registered PF_BLUETOOTH protocol family
[2929343.052686] Bluetooth: HCI device and connection manager initialized
[2929343.052710] Bluetooth: HCI socket layer initialized
[2929343.052722] Bluetooth: L2CAP socket layer initialized
[2929343.052752] Bluetooth: SCO socket layer initialized
[2929343.180874] Bluetooth: hci0: BCM: chip id 63
[2929343.181873] Bluetooth: hci0: BCM: features 0x07
[2929343.197876] Bluetooth: hci0: BCM20702A
[2929343.197902] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[2929343.201251] Bluetooth: hci0: BCM20702A1 'brcm/BCM20702A1-0b05-17cb.hcd' Patch
[2929344.093846] Bluetooth: hci0: BCM: features 0x07
[2929344.109865] Bluetooth: hci0: Broadcom Bluetooth Device
[2929344.109886] Bluetooth: hci0: BCM20702A1 (001.002.014) build 1467
[2929344.590181] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[2929344.590203] Bluetooth: BNEP filters: protocol multicast
[2929344.590221] Bluetooth: BNEP socket layer initialized
[2929344.594810] Bluetooth: MGMT ver 1.22

@dbuezas
Copy link

dbuezas commented May 9, 2023

I can confirm this works and I had missed the fact that this needed to be done from the host, not via "normal" ssh with the AddOn.

SUCCESS!
image

I ran this script from the host's keyboard

#!/bin/bash
mkdir -p /mnt/data/supervisor/firmware/brcm
cd /mnt/data/supervisor/firmware/brcm
curl -O https://github.com/winterheart/broadcom-bt-firmware/raw/master/brcm/BCM20702A1-0a5c-21e8.hcd

Thank you both @bdraco and @emontnemery!
I hope there will be a more straightforward way at some point, but thanks for making this possible at all :)

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

There hasn't been any activity on this issue recently. To keep our backlog manageable we have to clean old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant OS version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@slingshot74
Copy link

slingshot74 commented Mar 5, 2024

I get the following error in HA.
firmware patch not found, tried brcm/BCM20702A1-0a5c-21f1.hcd brcm/BCM-05ac-21f1.hcd

Is there a way I can solve this myself?

I think I solved it by using these lines from the terminal add on:
#!/bin/bash
mkdir -p /mnt/data/supervisor/firmware/brcm
cd /mnt/data/supervisor/firmware/brcm
curl -O https://github.com/winterheart/broadcom-bt-firmware/raw/master/brcm/BCM20702A1-0a5c-21f1.hcd

host reboot

When HAOS rebooted the error was not there.
How do I know if the bluetooth device is there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pinned Prevents from getting marked as stale
Projects
None yet
Development

No branches or pull requests

6 participants