bluetooth hci0: firmware: failed to load brcm/BCM20702A1-0a5c-21e8.hcd (-2)

After inserting my Plugable USB Bluetooth 4.0 Low Energy Micro Adapter (Compatible with Windows 10, 8.1, 8, 7, Raspberry Pi, Linux Compatible, Classic Bluetooth, and Stereo Headset Compatible) device into my debian 9 box I got the following error.

Dec 21 13:02:38 box kernel: [68069.707975] usb 1-1.1: new full-speed USB device number 6 using ehci-pci
Dec 21 13:02:38 box kernel: [68069.819878] usb 1-1.1: New USB device found, idVendor=0a5c, idProduct=21e8, bcdDevice= 1.12
Dec 21 13:02:38 box kernel: [68069.819882] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 21 13:02:38 box kernel: [68069.819885] usb 1-1.1: Product: BCM20702A0
Dec 21 13:02:38 box kernel: [68069.819887] usb 1-1.1: Manufacturer: Broadcom Corp
Dec 21 13:02:38 box kernel: [68069.819889] usb 1-1.1: SerialNumber: 5CF3707E6B94
Dec 21 13:02:38 box systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
Dec 21 13:02:38 box kernel: [68069.870056] alg: No test for fips(ansi_cprng) (fips_ansi_cprng)
Dec 21 13:02:39 box kernel: [68069.954326] Bluetooth: Core ver 2.22
Dec 21 13:02:39 box kernel: [68069.954355] NET: Registered protocol family 31
Dec 21 13:02:39 box kernel: [68069.954357] Bluetooth: HCI device and connection manager initialized
Dec 21 13:02:39 box kernel: [68069.954363] Bluetooth: HCI socket layer initialized
Dec 21 13:02:39 box kernel: [68069.954367] Bluetooth: L2CAP socket layer initialized
Dec 21 13:02:39 box kernel: [68069.954378] Bluetooth: SCO socket layer initialized
Dec 21 13:02:39 box systemd[1]: Starting Load/Save RF Kill Switch Status…
Dec 21 13:02:39 box kernel: [68069.972557] usbcore: registered new interface driver btusb
Dec 21 13:02:39 box systemd[1]: Reached target Bluetooth.
Dec 21 13:02:39 box systemd[1]: Started Load/Save RF Kill Switch Status.
Dec 21 13:02:39 box kernel: [68070.090051] Bluetooth: hci0: BCM: chip id 63
Dec 21 13:02:39 box kernel: [68070.091049] Bluetooth: hci0: BCM: features 0x07
Dec 21 13:02:39 box kernel: [68070.107057] Bluetooth: hci0: BCM20702A
Dec 21 13:02:39 box kernel: [68070.108081] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
Dec 21 13:02:39 box kernel: [68070.108588] bluetooth hci0: firmware: failed to load brcm/BCM20702A1-0a5c-21e8.hcd (-2)
Dec 21 13:02:39 box kernel: [68070.110491] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
Dec 21 13:02:39 box kernel: [68070.112427] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-21e8.hcd failed with error -2
Dec 21 13:02:39 box kernel: [68070.112437] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0a5c-21e8.hcd not found

I fixed this by….
1, unplug bluetooth usb
cd /opt
wget https://s3.amazonaws.com/plugable/bin/fw-0a5c_21e8.hcd
mv fw-0a5c_21e8.hcd /lib/firmware/brcm/BCM20702A0-0a5c-21e8.hcd
cp /lib/firmware/brcm/BCM20702A0-0a5c-21e8.hcd /lib/firmware/brcm/BCM20702A1-0a5c-21e8.hcd

re-insert usb bluetooth device

Dec 21 13:05:35 box kernel: [68246.127075] usb 1-1.1: USB disconnect, device number 6
Dec 21 13:05:35 box systemd[1]: Starting Load/Save RF Kill Switch Status…
Dec 21 13:05:35 box systemd[1]: bluetooth.target: Unit not needed anymore. Stopping.
Dec 21 13:05:35 box systemd[1]: Stopped target Bluetooth.
Dec 21 13:05:35 box systemd[1]: Started Load/Save RF Kill Switch Status.
Dec 21 13:05:47 box kernel: [68258.379974] usb 1-1.1: new full-speed USB device number 7 using ehci-pci
Dec 21 13:05:47 box systemd[1]: Starting Load/Save RF Kill Switch Status…
Dec 21 13:05:47 box kernel: [68258.491959] usb 1-1.1: New USB device found, idVendor=0a5c, idProduct=21e8, bcdDevice= 1.12
Dec 21 13:05:47 box kernel: [68258.491963] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 21 13:05:47 box kernel: [68258.491966] usb 1-1.1: Product: BCM20702A0
Dec 21 13:05:47 box kernel: [68258.491968] usb 1-1.1: Manufacturer: Broadcom Corp
Dec 21 13:05:47 box kernel: [68258.491970] usb 1-1.1: SerialNumber: 5CF3707E6B94
Dec 21 13:05:47 box systemd[1]: Reached target Bluetooth.
Dec 21 13:05:47 box systemd[1]: Started Load/Save RF Kill Switch Status.
Dec 21 13:05:47 box kernel: [68258.602129] Bluetooth: hci0: BCM: chip id 63
Dec 21 13:05:47 box kernel: [68258.603126] Bluetooth: hci0: BCM: features 0x07
Dec 21 13:05:47 box kernel: [68258.619133] Bluetooth: hci0: BCM20702A
Dec 21 13:05:47 box kernel: [68258.620132] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
Dec 21 13:05:47 box kernel: [68258.620232] bluetooth hci0: firmware: direct-loading firmware brcm/BCM20702A1-0a5c-21e8.hcd
Dec 21 13:05:48 box kernel: [68259.474137] Bluetooth: hci0: BCM20702A1 (001.002.014) build 1338
Dec 21 13:05:48 box kernel: [68259.490136] Bluetooth: hci0: Broadcom Bluetooth Device

Continue Reading

Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)

A package install I was doing got interrupted and when I tried to remove it I got the following error.

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?.

To fix I found out what process was using the lock

sudo lsof /var/lib/dpkg/lock

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dpkg 9442 root 3uW REG 179,2 0 7067 /var/lib/dpkg/lock

And then killed it off

sudo kill -9 9442

Continue Reading

Upgrade Debian 6 Squeeze To Wheezy 7

I had a debian box which I needed to upgrade speciffically to wheezy.

Open the sources file and change the word squeeze to wheezy
nano /etc/apt/sources.list
Change the words ‘squeeze’ to ‘wheezy’

deb http://mirrors.kernel.org/debian/ wheezy main
deb-src http://mirrors.kernel.org/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as 'volatile'
deb http://mirrors.kernel.org/debian/ wheezy-updates main
deb-src http://mirrors.kernel.org/debian/ wheezy-updates main

Save and exit
apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot
Job done 🙂
Continue Reading

Samba hide dot files

Setting up a Samba server at work using local users I found that when logging via windows the following files were displayed in the shared folder

.bash_history
.bash_logout
.bashrc
.profile
 Now there there is a possibility that these files can be deleted via the share which would impact the local ssh user. After searching I found that there is a variable that can be set in smb.conf by putting
hide dot files = yes
 in the [homes] section, however as I found out if you have windows set to ‘view hidden files’ this takes priority and the files are still shown.
 After much more searching I found the veto function, so adding
veto files = /.*/
to [homes] section results in the . (dot) files not being displayed. So my smb.conf [homes] looks like this
[homes]
comment = Home
Directories browseable = no
writable = yes
create mask = 0700
directory mask = 0700
valid users = %S
veto files = /.*/
Don’t forget to restart Samba after making the change.
Continue Reading

bash: /bin/rm: Argument list too long

I came across this error when trying to delete lots of files on Debian Squeeze. This error apparently occurs due to the reason that the system commands show limitations when a large number of arguments are fed into a single command.
 
so I created a bash script called bulkrm containing
 
for i in *; do
rm -f $i;
done
chmod +x bulkrm
../bulkrm
 
(WARNING THIS WILL DELETE ALL FILES IN THE FOLDER IT'S EXECUTED FROM SO USE
AT YOUR PERIL)
 
Continue Reading