20120907 bluetooth fo a linux desktop - plembo/onemoretech GitHub Wiki

title: Bluetooth for a linux desktop link: https://onemoretech.wordpress.com/2012/09/07/bluetooth-fo-a-linux-desktop/ author: lembobro description: post_id: 3325 created: 2012/09/07 11:09:39 created_gmt: 2012/09/07 15:09:39 comment_status: closed post_name: bluetooth-fo-a-linux-desktop status: publish post_type: post

Bluetooth for a linux desktop

What follows are the steps I took to get Bluetooth up and running on my RHEL/Scientific Linux 6 desktop. Bought an ASUS USB-BT211 (v2.1+EDR) Bluetooth Dongle that I wasn't going to waste on one of the Windows machines. So I plugged it into my fully up-to-date Scientific Linux 6.3 Red Hat Enterprise clone. Others had said it worked on Linux, but when I ran lsusb all I saw was:

[root@test01 ~]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0424:2504 Standard Microsystems Corp. USB 2.0 Hub
Bus 002 Device 002: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse
Bus 002 Device 003: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 001 Device 007: ID 0cf3:3000 Atheros Communications, Inc. AR3011 Bluetooth (no firmware)

OK. OK. So I did do a few other things before capturing that output. Hey, this is desktop hacking -- no need to document your steps methodically. Until you find you need to do it again. First, I Googled around for information on the device, and came up with this post on the Debian User Forums. That gave me some really important information: that the USB-BT211 was an Atheros ath3k device, and one of the many uses of the lusb utility. About the only thing wrong with the instructions in the post is that the location for the ath3k kernel firmware had changed. It had in fact been "retired", as I was to learn later on. Armed with the knowledge that this was an ath3k using device, I found and read One size fits all? compat-wireless fits many on the ELRepo blog. That article had popped up in a Google search for "AR3011". The entry in ELRepo's tiki, entitled kmod-compat-wireless laid out everything I needed to know. Well, almost. I went into /etc/yum.repos.d/elrepo.repo and enabled the "elrepo-testing" repository. Then I did a "yum install" for kmod-compat-wireless.x86_64 0:3.5.1-1.sn.el6.elrepo.

[root@test01 ~]# yum install kmod-compat-wireless

That went well. But running lsusb I got the output above. I had already started up the bluetooth service (I'd disabled it awhile back because, well, who would ever use Bluetooth on their desktop?) and made sure all the gnome-bluetooth tools were installed. Oh. Rats. I needed to install the firmware, which wasn't in the package after all. So I tried the url given in the Debian Forums article without success. That led me to use my web browser to navigate the git tree: http://git.kernel.org/ (which is /pub/scm in git) from there I drilled down to: http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary (/pub/scm linux/git/kernel/git/firmware/linux-firmware) and entered "ath3k" in the search box. That returned a couple of entries, I picked the latest (2011-03-01) labelled "linux-firmware: Remove ath3k-2.fw", which took me to: http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=commit;h=4bbe08c2a7bbaa35ee9501c72badb7e928c65cb0 Attached to this were the comments:

linux-firmware: Remove ath3k-2.fw author Bala Shanmugam Fri, 28 Jan 2011 09:33:28 +0000 (14:33 +0530) committer David Woodhouse Tue, 1 Mar 2011 10:12:34 +0000 (10:12 +0000) commit 4bbe08c2a7bbaa35ee9501c72badb7e928c65cb0 tree f5235e7a8d1a3f0f78dc09f4f141a93d5025b2df tree | snapshot parent 4ba5873cbef43a99bcfa45258605db66cc600507 commit | diff linux-firmware: Remove ath3k-2.fw ath3k-2.fw is obsolete and not use by Atheros chipsets anymore. Signed-off-by: Bala Shanmugam Signed-off-by: David Woodhouse

But the snapshot link still worked. I got this file: linux-firmware-4bbe08c.tar.gz and downloaded it to /data/install/atheros on my local machine. You know where this is going, right?

cd /data/install/atheros
tar xzf linux-firmware-4bbe08c.tar.gz
cp linux-firmware-4bbe08c/ath3k.fw /lib/firmware
depmod -a
modprobe ath3k

(all as root) One more lsusb for good measure:

[root@test yum.repos.d]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0424:2504 Standard Microsystems Corp. USB 2.0 Hub
Bus 002 Device 002: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse
Bus 002 Device 003: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 001 Device 008: ID 0cf3:3005 Atheros Communications, Inc. AR3011 Bluetooth

Wait, you say! How is it you got away with not having to compile anything? kABI tracking kmods, that's how! That elrepo package I installed earlier created all the hooks needed by the kernel to use the raw firmware file. Now all of a sudden my Gnome desktop lights up with the Bluetooth icon on the taskbar and wants to know if it should make my computer discoverable as a Bluetooth device. Hell yeah. That's part 1. Part 2 will be all about how you actually use Bluetooth to do useful stuff.

Copyright 2004-2019 Phil Lembo