49

Bluetooth is on but can't find or be found by any other devices.

Output of sudo service bluetooth status:

● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since ხუთ 2015-06-04 22:33:18 GET; 13min ago
 Main PID: 26678 (bluetoothd)
   CGroup: /system.slice/bluetooth.service
           └─26678 /usr/sbin/bluetoothd -n

ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPAG
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPHS
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSource
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSink
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPAG
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPHS
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSource
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSink
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Adapter /org/bluez/26678/hci0 has been enabled
ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Adapter /org/bluez/26678/hci0 has been enabled

Output of lsusb:

Bus 003 Device 005: ID 0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0

How can I fix it?

pomsky
  • 68,507
Guja1501
  • 593
  • Similar question with a answer for the 4352 card https://askubuntu.com/questions/617513/bluetooth-not-connecting-to-devices-even-though-it-recognizes-them – Wilf May 19 '16 at 20:06

4 Answers4

92

You need to install firmware.

Distribution of Broadcom firmware is not allowed by Broadcom license. So you need to get it yourself. It is a bit complex, but there is no other legal way.

  1. Download Broadcom Windows 8 driver or FROM HERE.

    If your device is not listed in these drivers, you'll need to find a newer version of it somewhere. Broadcom removed the latest drivers from their site to make it more difficult.

    Some laptop vendors have Bluetooth drivers on their sites, but some of them are not unzippable. So it is some quest. I could download the latest Broadcom drivers from their site, but it is not there any more.

  2. Open this file by Archive Manager and find there bcbtums-win8x86-brcm.inf file. Name of the file may differ in some drivers. It can be bcbtums.inf located at Win32 or Win64 directory. It does not matter 32 or 64 bit to download.

  3. Search this file for VID_0A5C&PID_21D7. These numbers are from your lsusb output

    0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0.

    Comment: Some devices are not recognized as Broadcom BT in lsusb. If you are unsure which one is your BT device, run usb-devices command, it will give more detailed information. There you can find product and vendor IDs.

    You will see some line ending with RAMUSB21D7

    Search this file for RAMUSB21D7. You will find a section there like that:

    [RAMUSB21D7.CopyList]
    bcbtums.sys
    btwampfl.sys
    BCM43142A0_001.001.011.0122.0126.hex
    

    That's what we are looking for. Name of the firmware file. BCM43142A0_001.001.011.0122.0126.hex

  4. Now extract that firmware from the same cab file.

    Then you need to convert this file from hex to hcd format.

  5. Download the tool for that

    git clone git://github.com/jessesung/hex2hcd.git
    cd hex2hcd
    make
    

    You will get hex2hcd folder in your home directory.

  6. Place the firmware file to your home folder and run

    ~/hex2hcd/hex2hcd ~/BCM43142A0_001.001.011.0122.0126.hex ~/BCM43142A0-0a5c-21d7.hcd
    

    You see that 0a5c-21d7 is id of your adapter from lsusb.

    Important: For kernels 4.2+ you call this file as BCM.hcd instead.

    ~/hex2hcd/hex2hcd ~/BCM43142A0_001.001.011.0122.0126.hex ~/BCM.hcd
    

    For kernels 4.8+ name of the file should be BCM-<VID>-<PID>.hcd, like BCM-0a5c-21d7.

    For kernel 5.0 the file name is again BCM43142A0-0a5c-21d7.hcd

    Now just copy BCM43142A0-0a5c-21d7.hcd, or another file according to the kernel version to /lib/firmware/brcm directory by

    sudo cp ~/BCM43142A0-0a5c-21d7.hcd /lib/firmware/brcm
    

    For kernels 4.2+

    sudo cp ~/BCM.hcd /lib/firmware/brcm
    

    For kernels 4.8+

    sudo cp ~/BCM-0a5c-21d7.hcd  /lib/firmware/brcm
    

    You can always check if the file name is correct by running dmesg | grep -i blue. There will be an error message if the file is not found.

    If the requested file name doesn't match the file you created, rename the hcd file.

  7. Turn your computer off and on again. Not just reboot!

    Your adapter will get firmware and bluetooth should work.

All this looks complicated, but it is Broadcom lawyers to blame for that. Most of other vendors allow to re-distribute firmware under condition that it is done accompanied with the license.

That allows Linux maintainers to include firmware in distributions.

But not in case of Broadcom. That's why it is not done an easy way.

Many people could convert all hex files to hcd and make them available. Or just add them to the linux-firmware package of Ubuntu.

But it is not legal :-((

Zanna
  • 70,465
Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • 7
    Most of the times when I woke up my laptop, the reloading of the bluetooth module fails with a kernel stack trace. If you need bluetooth without rebooting, you will need to unload the bluetooth module (sudo modprobe -r btusb) and reload it (sudo modprobe btusb) for blueooth to work again. https://bugzilla.kernel.org/show_bug.cgi?id=81821 – solsTiCe Jun 21 '15 at 18:24
  • 1
    In step 6, hex2hcd must be given an output file, like: hex2hcd [input-file] -o [output-file] Can you please update the answer? – Minas Mina Jan 23 '16 at 16:51
  • There is output file in the answer. Or did the author change it. It used to be `hex2hcd input-file output-file – Pilot6 Jan 23 '16 at 16:54
  • Thanks to Pilot6 for providing this answer! One more thing worth mentioning is that the blueman utility breaks this solution (a problem that happened to me). See http://askubuntu.com/questions/767046/bluetooth-broadcom-bcm20702-does-not-load-firmware-driver-issue-14-04. – Mike May 04 '16 at 12:16
  • By the way, suspending (and/or switching on/off 'Aeroplane mode' in Gnome WiFi settings) works sometimes as a alternative to reloading modules/rebooting. – Wilf May 24 '16 at 00:30
  • The positioning for some newer kernels is different. In my case (tested with kernel 4.4 and 4.7rc4), it's /lib/firmware/brcm/BCM-0a5c-6410.hcd – morhook Jul 08 '16 at 15:03
  • @morhook They really do change it. But it looks like BCM*.hcd will do. I need to look into the code. – Pilot6 Jul 08 '16 at 15:06
  • 4
    Thanks @Pilot6 for updating main post. In my case I looked the error in dmesg to know my correct file. Example dmesg output: [ 3.479417] bluetooth hci0: Direct firmware load for brcm/BCM-0a5c-6410.hcd failed with error -2 [ 3.479421] Bluetooth: hci0: BCM: Patch brcm/BCM-0a5c-6410.hcd not found – morhook Jul 08 '16 at 15:59
  • Thanks for the comment. I checked the source code and found that they really changed file names again. – Pilot6 Jul 08 '16 at 16:03
  • 1
    Thanks you! Is there any way to contact the Broadcom lawyers and explain them the situation for us? Making this process in all Broadcom-based usb-bluetooth seems lengthy – morhook Jul 10 '16 at 17:48
  • 1
    @morhook Do you believe that noone tried to contact them? )))) This situation holds for many years. – Pilot6 Jul 10 '16 at 18:44
  • @Pilot6 I've found out this petition https://www.change.org/p/broadcom-drivers-for-bcm21654g-2ecf76f9-e114-4419-abce-95b581092910 maybe we can sign it? Looks like a similar chipset but for android? Maybe we can make a new petition? – morhook Jul 10 '16 at 22:43
  • I just used this for my xubuntu 16.04 install. I have the 4.4.0-31-generic installed and it was actually looking for BCM.hcd . I found the filename by looking at the dmesg output, where it said which file it is trying to load. – Martin - マーチン Jul 31 '16 at 15:54
  • I am a bit confused with it too. I do not have this hardware. You can try both names to be sure. – Pilot6 Jul 31 '16 at 17:55
  • I get hci0 command 0x1001 tx timeouterror now, any leads? – HackToHell Oct 10 '16 at 04:27
  • Okay spamming rfkill unblock bluetooth got it working. – HackToHell Oct 10 '16 at 04:28
  • @Pilot6 After such a operation my bluetooth device is no longer visible on Ubuntu 16.04, kernel: 4.4.0-45-generic. lspci and lsusb also does not display it anymore. Any idea? – Tom Raganowicz Nov 06 '16 at 13:52
  • @NeverEndingQueue there was a missing -o in step #6. I edited the answer to fix the command. – crypdick Jan 03 '17 at 17:12
  • @RovingRichard That is wrong. The syntax for hex2hcd from that git repo is hex2hcd <input hex file> <output file>. Editors: please do not add this. maybe you are using some other hex2hcd version. – Pilot6 Jan 11 '17 at 23:28
  • @Pilot6 From the output of hex2hcd -h : -o, --output <file> Provide firmware output file. My version is 5.37, which is the version I got from following the instructions in your answer. – crypdick Jan 13 '17 at 03:47
  • @Pilot6 My version's manpage says the usage is hex2hcd [options] <file> – crypdick Jan 13 '17 at 03:49
  • Your version is your version. It is not related to my answer. – Pilot6 Jan 13 '17 at 08:36
  • Ubuntu 16.04.1 LTS - Thanks for this answer. Now my laptop is able to connect to bluetooth devices in the vicinity. This is shown by an icon close to the clock. However, in the system settings, when I click on the the bluetooth icon, it does not show anything ans is still asking for a BT adaptor. But this is probably another story... – Captain_Frog Mar 15 '17 at 08:04
  • 5
    DUALBOOT USERS: Note that you can extract the correct firmware from your Windows OS. In order to do that, go to Windows Device Manager, find your Bluetooth device, right-click, Properties, Driver, Driver Details. There you will find the path to your .hex file, which you can copy to your Linux system. After that, follow the steps 5-8. This answer is excellent, by the way. – Manu CJ Dec 08 '17 at 23:43
  • In my case (Lenovo G510, Ubuntu 14.4.05):

    ~$ dmesg | grep -i 'bluetooth'::
    [ 4.796921] usb 3-7: Product: Bluetooth USB Host Controller; Bluetooth: Core ver 2.21; HCI device and connection manager initialized; Bluetooth: HCI socket layer initialized; L2CAP socket layer initialized; Bluetooth: SCO socket layer initialized; BNEP socket layer initialized; Bluetooth: RFCOMM TTY layer initialized; RFCOMM socket layer initialized; RFCOMM ver 1.11;
    and nothing in: ~$ usb-devices | grep blue.
    What should I do?

    – Helen Craigman Mar 09 '18 at 19:13
  • Even though my kernel version is 4.13 I had to use BCM.hcd file (recommended for 4.2+ kernel versions). This allowed me to connect the headset but it wasn't showing in the sound settings' output devices. To solve this problem I had tu run the "magic" python script from https://gist.github.com/pylover/d68be364adac5f946887b85e6ed6e7ae as well. – Krzysztof Wołowski Mar 17 '18 at 09:15
  • @ManuCJ please post that as an answer because it worked perfectly for me. Thank you! – Jonathan Porter Aug 27 '18 at 01:14
  • @JonathanPorter Happy to hear that, I'd post that but the question has been protected, so not possible. – Manu CJ Nov 18 '18 at 10:36
  • Drivers are also available here: https://www.catalog.update.microsoft.com/Search.aspx?q=Broadcom+bluetooth – jdnz Nov 21 '18 at 13:58
  • kernel 4.9.0-8-amd64 here. I needed to use BCM.hcd instead of BCM--.hcd – Maxsash Feb 11 '19 at 20:53
  • 1
    The *.hcd-files may be found here: https://github.com/winterheart/broadcom-bt-firmware (Tip found via: https://dev-pages.info/ubuntu-bluetooth/) – feeela Jan 28 '20 at 16:04
  • what does this mean Now extract that firmware from the same cab file.? – Bassie Nov 30 '21 at 15:34
  • @Bassie You can open a cab file with Archive Manager. – Pilot6 Nov 30 '21 at 15:44
  • but there is no mention of any cab file before this line – Bassie Nov 30 '21 at 15:45
  • 1
    Driver may be as a cab file. – Pilot6 Nov 30 '21 at 15:46
22

Here is a project that aims to automate the process a bit: https://github.com/winterheart/broadcom-bt-firmware

copy the BCM to the right dir/name depending on the kernel (as described above).

On 4.8 I did not need a reboot, simply in a terminal:

sudo modprobe -r btusb
sudo modprobe btusb

dmesg | grep -i blu

should show if it is loaded. Make sure the hardware ID matched the file. It can be found with :

lsusb

which shows this on my Lenovo (only that line):

Bus 001 Device 006: ID 105b:e065 Foxconn International, Inc. BCM43142A0 Bluetooth module

I hope that helps :)

Vincent Gerris
  • 2,437
  • 1
  • 20
  • 14
  • 1
    In my case (UtechSmart USB Bluetooth 4.0 Device id: 0a5c:21e8) the winterheart drivers loaded but hcitool dev still didn't show any devices and there was an error in syslog. Found another driver at https://plugable.com/2014/06/23/plugable-usb-bluetooth-adapter-solving-hfphsp-profile-issues-on-linux that did work. – Greg Bray Dec 02 '17 at 22:30
  • They generate also deb. I just installed the following deb file and worked like a charm: https://github.com/winterheart/broadcom-bt-firmware/releases/download/v12.0.1.1105_p4/broadcom-bt-firmware-12.0.1.1105.deb – oikonomopo Feb 14 '23 at 15:12
16

That's all what you need: https://github.com/winterheart/broadcom-bt-firmware

On this repository you can find more informations and all Broadcom wireless card drivers needed.


To be more concrete I give you the instructions I wrote for myself:

This tutorial is intended to make the wireless/bluetooth network card Broadcom Corporation BCM43142 802.11b/g/n (rev 01) (Device ID: 0a5c:216d) working on Linux systems (I tried it on Elementary OS 0.4.1 Loki, based on Ubuntu 16.04.3 LTS).

It could not work for other devices but it should not vary too much from this procedure for other Broadcom devices. The needed Broadcom drivers are on this GitHub's reposity folder in .hcd format.

  1. Enter the following command to discover which driver name is the kernel looking for when loading the drives while booting:

    dmesg | grep -i 'firmware load'
    

    Try this one if it does not find anything:

    dmesg | grep -i 'bluetooth'
    

    The result should be something like this:

    bluetooth hci0: Direct firmware load for brcm/BCM.hcd failed with error -2
    

    Explanation: in my case the kernel is looking for the file BCM.hcd under the directory /lib/firmware/brcm where the Broadcom drivers are expected to be. If the Kernel is looking for another driver name, you must rename the driver file (BCM43142A0-0a5c-216c.hcd in my case for the BCM43142 (0a5c:216d)) to the required name by the kernel.

  2. Move the renamed driver (BCM.hcd) to your home directory (/home/YourUsername/) and run the following command in order to move it to the folder the kernel is looking on while booting:

    sudo mv ~/BCM.hcd /lib/firmware/brcm
    

    You must use the corresponding driver depending on your device and rename it if requested for the kernel.

  3. Reboot your computer and it should work!* (you can enter dmesg | grep -i 'bluetooth' once again to see if the driver has been loaded)

muru
  • 197,895
  • 55
  • 485
  • 740
  • It worked! Thanks a lot! In my case, "BCM43142 802.11b/g/n [14e4:4365] (rev 01)" version wasn't available in the github folder, but I just tried it with BCM43142A0-185f-2167.hcd and it worked! – Sriram Kannan Oct 29 '18 at 07:59
  • It worked and simple. I used command 'lsusb' and it show the "0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0". I just download the BCM43142A0-0a5c-21d7.hcd and it worked. Thanks you. – PhatHV Dec 06 '19 at 08:18
  • thank you bro you are life saver – imposter Jul 10 '21 at 12:40
1

Still facing firmware errors ?

$ dmesg | egrep -i 'blue|firm'
[    0.108524] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    0.144995] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    4.768278] thinkpad_acpi: ThinkPad firmware release H1EC34WW doesn't match the known patterns
[    4.808333] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked
[    5.267304] Bluetooth: Core ver 2.22
[    5.267329] Bluetooth: HCI device and connection manager initialized
[    5.267333] Bluetooth: HCI socket layer initialized
[    5.267335] Bluetooth: L2CAP socket layer initialized
[    5.267339] Bluetooth: SCO socket layer initialized
[    5.405755] Bluetooth: hci0: BCM: chip id 70
[    5.406559] Bluetooth: hci0: BCM: features 0x06
[    5.422570] Bluetooth: hci0: BCM43142A
[    5.422575] Bluetooth: hci0: BCM43142A0 (001.001.011) build 0000
[    5.424415] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
[    5.424420] Bluetooth: hci0: BCM: 'brcm/BCM43142A0-105b-e065.hcd'
[    5.424421] Bluetooth: hci0: BCM: 'brcm/BCM-105b-e065.hcd'
[    7.441899] Bluetooth: hci0: command 0x1003 tx timeout
[    7.443566] Bluetooth: hci0: unexpected event for opcode 0x1003
[   17.500493] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   17.500496] Bluetooth: BNEP filters: protocol multicast
[   17.500501] Bluetooth: BNEP socket layer initialized
[   38.846123] Bluetooth: RFCOMM TTY layer initialized
[   38.846129] Bluetooth: RFCOMM socket layer initialized
[   38.846136] Bluetooth: RFCOMM ver 1.11

  • I just found another methods from hear

Method Is:

  • downloading brcm/BCM43142A0-105b-e065.hcd file from broadcom-bt-firmware
  • And pasting in to /lib/firmware/brcm folder.
  • For doing this use below commands.

COMMAND:

sudo apt-get update && sudo apt-get install wget

sudo wget https://github.com/winterheart/broadcom-bt-firmware/raw/master/brcm/BCM43142A0-105b-e065.hcd -P /lib/firmware/brcm

  • Reboot your pc :)