How to add missing Bluetooth firmware (Pi 4)?

Hi all – apologies if this has been answered elsewhere; please punt me as needed.

I’m running balenaOS 2.56.0+rev1 on a Raspberry Pi 4. I recently purchased this USB Bluetooth dongle to give me some extended range. When I boot the Pi up, I do, indeed, see the dongle (in this case, as hci0):

root@host:~# hciconfig
hci1:	Type: Primary  Bus: UART
	    BD Address: B8:27:EB:D7:39:D3  ACL MTU: 1021:8  SCO MTU: 64:1
	    UP RUNNING
   	    RX bytes:852 acl:0 sco:0 events:57 errors:0
	    TX bytes:594 acl:0 sco:0 commands:54 errors:0

hci0:	Type: Primary  Bus: USB
	    BD Address: 00:19:86:00:2E:30  ACL MTU: 1021:8  SCO MTU: 64:1
	    UP RUNNING
	    RX bytes:1064 acl:0 sco:0 events:65 errors:0
	    TX bytes:1832 acl:0 sco:0 commands:65 errors:0

…but a viewing of dmesg indicates that there is firmware missing:

root@046f173:~# dmesg | grep -i blue
[    7.804285] Bluetooth: Core ver 2.22
[    7.817925] Bluetooth: HCI device and connection manager initialized
[    7.826648] Bluetooth: HCI socket layer initialized
[    7.833534] Bluetooth: L2CAP socket layer initialized
[    7.843050] Bluetooth: SCO socket layer initialized
[    8.040964] Bluetooth: hci0: BCM: chip id 63
[    8.072034] Bluetooth: hci0: BCM: features 0x07
[    8.122048] Bluetooth: hci0: BCM20702A
[    8.129037] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[    8.135460] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-21e8.hcd failed with error -2
[    8.145070] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0a5c-21e8.hcd not found
...

What’s the correct process for adding missing Bluetooth firmware to a production device in the wild? Compile a balenaOS image (with this firmware included) and update?

We have an example here on how to put kernel modules into devices

Thanks, @Ereski – that’s helpful. As for deployment, is there a way to roll this out remotely? I know that the dashboard has the option to update to a mainline firmware, but I don’t see an option to upload your own.

That example runs as a service so it can be deployed with the rest of your application with a balena push

1 Like

Want to make sure I’m understanding: that example is to compile the custom module into a container, right? So, that container (and not the host OS) would have access to the module?

EDIT: Reading this thread and I think I’m seeing what to do. Will report back.

Sounds good, let us know how it goes. :slight_smile: