Bluetooth Dongle Invalid HCI interface Raspb2

Hello everyone,

I am new to the forum, so excuse me if this topic has been clarified elsewhere, but I couldn’t find it :slight_smile:
The project is amazing and gave a new life to the old raspberrypi 2 in my drawer - Thanks!

Unfortunately BLUETOOTH is not working on my Raspberrypi 2 - Let me explain:

  1. all the services are running except for Multiroom client+server (I don’t need them) and Bluetooth (need this one though!) - All 3 are “excited” - Rest works fine and I can listen to music over spotify/airplay
  2. My raspberrypi2 has a bluetooth dongle (5.0 USB bluetooth adapter from Orico / Model ORICO BTA-508 - Control Chip: RTL8761B)
  3. When manually starting the bluetooth service through the balena cloud, following happens:

11.12.20 11:32:59 (+0100) Service exited ‘bluetooth sha256:ff10b0f6d60d89d852568cb28c5241d3957c9103ffcd2e0efcffa5aaeb739cb1’
11.12.20 11:32:55 (+0100) bluetooth Running balena base image entrypoint…
11.12.20 11:32:55 (+0100) bluetooth — Bluetooth —
11.12.20 11:32:55 (+0100) bluetooth Starting bluetooth service with settings:
11.12.20 11:32:55 (+0100) bluetooth - Device name: balenaOS 2507
11.12.20 11:32:55 (+0100) bluetooth - HCI interface: hci0
11.12.20 11:32:55 (+0100) bluetooth - Pairing mode: SSP
11.12.20 11:32:55 (+0100) bluetooth - PIN code: 0000
11.12.20 11:32:55 (+0100) bluetooth Available HCI interfaces:
11.12.20 11:32:55 (+0100) bluetooth Exiting… selected HCI interface is invalid: hci0

–> I have :
HOST OS VERSION [balenaOS 2.48.0+rev1] /development
SUPERVISOR VERSION 10.8.0

Would it be possible to make the dongle work with the RB2 and Balena sound? If yes how? What is the HCI interface?

Thank you so much for your time and help :sunny: :blush:

Hi there, this might be an issue with the software not recognising your BT dongle. You can take a look at output of lsusb on the HostOS to see if it’s seeing the device. You could also take a scroll through dmesg output to see if the kernel is loading the driver for this device.

1 Like

Hello @ab77 Thank you very much for the answer

The BT dongle is the only connected USB to the RB

lsusb gives:
root@25072a3:~# lsusb
Bus 001 Device 005: ID 0bda:8771
Bus 001 Device 003: ID 0424:ec00
Bus 001 Device 002: ID 0424:9514
Bus 001 Device 001: ID 1d6b:0002

dmesg is more interesting though! –> Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761a_fw.bin not found is repeated many times indeed …

Any way to update it manually? Thank you very much !!

dmesg:

[ 12.831648] Bluetooth: hci0: RTL: rtl: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761

[ 12.838744] usbcore: registered new interface driver smsc95xx
[ 12.848602] Bluetooth: hci0: RTL: rom_version status=0 version=1

[ 12.864794] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8761a_fw.bin

[ 12.900217] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_fw.bin failed with error -2
[ 12.912261] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761a_fw.bin not found

[ 13.245588] Bluetooth: hci0: RTL: rtl: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761

[ 13.262559] Bluetooth: hci0: RTL: rom_version status=0 version=1

[ 13.272994] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8761a_fw.bin

[ 13.283899] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_fw.bin failed with error -2
[ 13.295689] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761a_fw.bin not found

[ 15.500656] Bluetooth: hci0: RTL: rtl: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761

[ 15.523395] Bluetooth: hci0: RTL: rom_version status=0 version=1

[ 15.528051] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 15.533724] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8761a_fw.bin

[ 15.540465] Bluetooth: BNEP filters: protocol multicast
[ 15.593138] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_fw.bin failed with error -2
[ 15.604767] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761a_fw.bin not found

[ 15.632897] Bluetooth: BNEP socket layer initialized
[ 20.370321] i2c /dev entries driver
[ 20.621940] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 20.740924] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 20.745430] cfg80211: Loaded X.509 cert ‘sforshee: 00b28ddf47aef9cea7’
[ 20.836031] smsc95xx 1-1.1:1.0 eth0: hardware isn’t capable of remote wakeup
[ 22.479127] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[ 29.661502] random: crng init done
[ 29.664929] random: 7 urandom warning(s) missed due to ratelimiting
[ 33.574118] Bridge firewalling registered
[ 34.502847] IPv6: ADDRCONF(NETDEV_UP): supervisor0: link is not ready
[ 34.938655] IPv6: ADDRCONF(NETDEV_UP): balena0: link is not ready
[ 35.324673] IPv6: ADDRCONF(NETDEV_UP): br-db5e6e0066b1: link is not ready
[ 38.575927] br-db5e6e0066b1: port 1(veth23a9ded) entered blocking state
[ 38.582730] br-db5e6e0066b1: port 1(veth23a9ded) entered disabled state
[ 38.591005] device veth23a9ded entered promiscuous mode
[ 38.597915] IPv6: ADDRCONF(NETDEV_UP): veth23a9ded: link is not ready
[ 45.516199] eth0: renamed from veth24c9492
[ 45.609324] IPv6: ADDRCONF(NETDEV_CHANGE): veth23a9ded: link becomes ready
[ 45.619834] br-db5e6e0066b1: port 1(veth23a9ded) entered blocking state
[ 45.626670] br-db5e6e0066b1: port 1(veth23a9ded) entered forwarding state
[ 45.644341] IPv6: ADDRCONF(NETDEV_CHANGE): br-db5e6e0066b1: link becomes ready
[ 50.553623] systemd-udevd[30]: Starting version 245.6-2
[ 53.370342] systemd-udevd[37]: console: Failed to process device, ignoring: File exists
[ 53.382173] systemd-udevd[39]: ptmx: Failed to process device, ignoring: File exists
[ 96.807117] br-db5e6e0066b1: port 2(veth701030f) entered blocking state
[ 96.813865] br-db5e6e0066b1: port 2(veth701030f) entered disabled state
[ 96.822714] device veth701030f entered promiscuous mode
[ 96.829878] IPv6: ADDRCONF(NETDEV_UP): veth701030f: link is not ready
[ 97.114693] br-db5e6e0066b1: port 3(vethdb069ca) entered blocking state
[ 97.121476] br-db5e6e0066b1: port 3(vethdb069ca) entered disabled state
[ 97.129928] device vethdb069ca entered promiscuous mode
[ 97.141940] IPv6: ADDRCONF(NETDEV_UP): vethdb069ca: link is not ready
[ 97.148861] br-db5e6e0066b1: port 3(vethdb069ca) entered blocking state
[ 97.155692] br-db5e6e0066b1: port 3(vethdb069ca) entered forwarding state
[ 97.833081] br-db5e6e0066b1: port 3(vethdb069ca) entered disabled state
[ 103.298298] eth0: renamed from veth4efa65b
[ 103.365132] IPv6: ADDRCONF(NETDEV_CHANGE): veth701030f: link becomes ready
[ 103.372327] br-db5e6e0066b1: port 2(veth701030f) entered blocking state
[ 103.379081] br-db5e6e0066b1: port 2(veth701030f) entered forwarding state
[ 105.976184] eth0: renamed from vethd66fe86
[ 106.035792] IPv6: ADDRCONF(NETDEV_CHANGE): vethdb069ca: link becomes ready
[ 106.043364] br-db5e6e0066b1: port 3(vethdb069ca) entered blocking state
[ 106.050059] br-db5e6e0066b1: port 3(vethdb069ca) entered forwarding state
[ 109.203826] br-db5e6e0066b1: port 2(veth701030f) entered disabled state
[ 109.219675] veth4efa65b: renamed from eth0
[ 109.764362] br-db5e6e0066b1: port 2(veth701030f) entered disabled state
[ 109.785659] device veth701030f left promiscuous mode
[ 109.790709] br-db5e6e0066b1: port 2(veth701030f) entered disabled state
[ 110.702671] br-db5e6e0066b1: port 3(vethdb069ca) entered disabled state
[ 110.710345] vethd66fe86: renamed from eth0
[ 111.209371] br-db5e6e0066b1: port 3(vethdb069ca) entered disabled state
[ 111.237733] device vethdb069ca left promiscuous mode
[ 111.242831] br-db5e6e0066b1: port 3(vethdb069ca) entered disabled state
[ 337.692940] usb 1-1.3: USB disconnect, device number 4
[ 340.802763] usb 1-1.4: new full-speed USB device number 5 using dwc_otg
[ 340.935881] usb 1-1.4: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
[ 340.944385] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 340.951733] usb 1-1.4: Product: Bluetooth Radio
[ 340.956370] usb 1-1.4: Manufacturer: Realtek
[ 340.960695] usb 1-1.4: SerialNumber: 00E04C239987
[ 340.975588] Bluetooth: hci0: RTL: rtl: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761

[ 340.989859] Bluetooth: hci0: RTL: rom_version status=0 version=1

[ 340.997567] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8761a_fw.bin

[ 341.005922] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_fw.bin failed with error -2
[ 341.014869] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761a_fw.bin not found

[ 341.048596] Bluetooth: hci0: RTL: rtl: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761

[ 341.067043] Bluetooth: hci0: RTL: rom_version status=0 version=1

[ 341.074769] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8761a_fw.bin

[ 341.083238] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_fw.bin failed with error -2
[ 341.092247] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761a_fw.bin not found

[ 341.199570] Bluetooth: hci0: RTL: rtl: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761

[ 341.211560] Bluetooth: hci0: RTL: rom_version status=0 version=1

[ 341.219187] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8761a_fw.bin

[ 341.229498] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761a_fw.bin failed with error -2
[ 341.238411] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761a_fw.bin not found

[87350.322461] br-db5e6e0066b1: port 2(veth2c7d28a) entered blocking state
[87350.329268] br-db5e6e0066b1: port 2(veth2c7d28a) entered disabled state
[87350.336677] device veth2c7d28a entered promiscuous mode
[87350.342994] IPv6: ADDRCONF(NETDEV_UP): veth2c7d28a: link is not ready
[87351.221620] br-db5e6e0066b1: port 3(veth6d8a85e) entered blocking state
[87351.228409] br-db5e6e0066b1: port 3(veth6d8a85e) entered disabled state
[87351.238949] device veth6d8a85e entered promiscuous mode
[87351.256734] IPv6: ADDRCONF(NETDEV_UP): veth6d8a85e: link is not ready
[87351.263412] br-db5e6e0066b1: port 3(veth6d8a85e) entered blocking state
[87351.270288] br-db5e6e0066b1: port 3(veth6d8a85e) entered forwarding state
[87351.327367] br-db5e6e0066b1: port 3(veth6d8a85e) entered disabled state
[87356.495534] eth0: renamed from vethea30619
[87356.549231] IPv6: ADDRCONF(NETDEV_CHANGE): veth6d8a85e: link becomes ready
[87356.556441] br-db5e6e0066b1: port 3(veth6d8a85e) entered blocking state
[87356.563190] br-db5e6e0066b1: port 3(veth6d8a85e) entered forwarding state
[87357.140753] eth0: renamed from veth7b5f0c9
[87357.200580] IPv6: ADDRCONF(NETDEV_CHANGE): veth2c7d28a: link becomes ready
[87357.209338] br-db5e6e0066b1: port 2(veth2c7d28a) entered blocking state
[87357.216085] br-db5e6e0066b1: port 2(veth2c7d28a) entered forwarding state
[87360.653584] br-db5e6e0066b1: port 3(veth6d8a85e) entered disabled state
[87360.660823] vethea30619: renamed from eth0
[87361.633202] br-db5e6e0066b1: port 3(veth6d8a85e) entered disabled state
[87361.660384] device veth6d8a85e left promiscuous mode
[87361.665456] br-db5e6e0066b1: port 3(veth6d8a85e) entered disabled state
[87363.173951] br-db5e6e0066b1: port 2(veth2c7d28a) entered disabled state
[87363.182595] veth7b5f0c9: renamed from eth0
[87364.559453] br-db5e6e0066b1: port 2(veth2c7d28a) entered disabled state
[87364.586425] device veth2c7d28a left promiscuous mode
[87364.591521] br-db5e6e0066b1: port 2(veth2c7d28a) entered disabled state
[356308.298368] ICMPv6: process `sysctl’ is using deprecated sysctl (syscall) net.ipv6.neigh.balena0.base_reachable_time - use net.ipv6.neigh.balena0.base_reachable_time_ms instead
root@25072a3:~#

Hello,

Please check this thread: How to mount /lib/firmware RW

Firmwares are located in /lib/firmware on the host os.

BalenaOS does not ship the /lib/firmware/rtl_bt/rtl8761a_fw.bin file.

You’ll need to:

  • get that firmware from somewhere, this debian package for example https://packages.debian.org/en/sid/firmware-realtek ;
  • copy it to your container;
  • follow the thread linked above to bind-mount /lib/firmware in the container;
  • on runtime in your container, re-mount the bind-mount from above rw and copy the firmware in it.
1 Like

Hello @zvin, Thank you very much! I see the idea and what is the problem.

Unfortunately I have no experience in mounting / installing packages … :confused:
But really willing to get this through! Excuse all the questions

  • get the firmware package = DONE
  • Copy it to your container = X - Can I do this through the balena Cloud dashboard? If yes, where? I found access to docker-compose.yml in “release” but I first need to set a SSH key to be able to write in it
    Or is this something I should do in the img file before flashing it through balena? I am a bit lost here …
  • Following the thread might be easier when I understand what and where an APP CONTAINER is
  • then I guess I should do following :

on the app container

mount -o remount,rw /lib/firmware

Excuse all the questions and thank you so much for the support

Copy it to your container = X - Can I do this through the balena Cloud dashboard? If yes, where? I found access to docker-compose.yml in “release” but I first need to set a SSH key to be able to write in it

You need to do this in your Dockerfile with a line like COPY rtl8761a_fw.bin rtl8761a_fw.bin assuming rtl8761a_fw.bin is in the same folder as your Dockerfile.

In your container start script you should have something like

mount -o remount,rw /lib/firmware
mkdir -p /lib/firmware/rtl_bt/
cp rtl8761a_fw.bin /lib/firmware/rtl_bt/rtl8761a_fw.bin
whatever_your_container_needs_to_do

Hi @zvin, Thanks again for your time

the major problem here is … ME :roll_eyes: I am a complete noob
I have searched the forum on how to add firmwares but couldn´t find anything helpful

So I access the balena dashboard, access my device and can interact with the terminal here. If you could detail on where to act/work and where I can experiment with the dockerfile that would be helpful.

Thank you

Hi there,

Don’t worry about being new to all this - we’ve all been there.

So to confirm, you’re running balenaSound, and presumably you deployed the project from a “Deploy with balena” button?

In order to edit the Dockerfile, and have those changes affect the device, you will need to re-deploy the project using a different method:

In a nutshell, you will need to:

  • download the balenaSound source code from Github
  • edit the Dockerfile as above
  • install the balena CLI tools
  • perform a balena push to your application

Let us know how you get on.
Phil

1 Like

Hi @phil-d-wilson - Thanks !! That all makes a lot of sense suddenly!!

I will implement this during the Xmas break then and let you know when I am ready to perform the balena push command :smiley: I’ll keep the thread updated

Really nice support here!