I recently purchased the Cirago USB Bluetooth/Wifi combo to use with my raspberry pi. All things considered, I am quite pleased. Being reasonably versed in google-fu, helped, of course.
Since I want the freedom to do some mobile tinkering, I need to access the pi sans a lan. That, and my latest wild hair project requires the ability to connect to and interact with the pi from an iOS device while relying upon the 4G/LTE network to… ummm… do some data mining as it were. As such, I needed to setup up the pi as a standalone (as in, not connected to any network whatsoever) AP.
It should go without saying but I’ll say it anyway, be sure to backup your SD card between any major changes. For example, once you can launch hostapd without a segfault, or are able to successfully pair, back up your card! That way you can roll back to the last working version, in the event of a catastrophic failure.
That said, onward into the fray!
As it turned out, the standard hostapd package supports the nl80211 chip set as opposed to the rtl8188cus chip set. And, Cirago is, you guessed it, the latter. Thanks to Dave Conroy, however, it was a simple matter of downloading his modified hostapd package.
NB: Be sure to follow his replacement instructions! And, if you’re wary about downloading a binary from a stranger, he also provides a link to the realtek driver files for a DIY build.
As for the hostapd configuration, I must admit, I wasn’t all that crazy about Conroy’s setup, so I used this guy’s setup instead. He also provides a neat little launch AP failover script. Though, if you set it up to poll, and depending upon the polling interval, it could be resource intensive.
As for playing/recording sound with the bluetooth headset, that was a bit of a challenge also. However, I am happy to report, I was able to get that working as well. There were some key steps, which were literally, all over the place. So, I’ll list them below (with links), to hopefully save the next guy/gal who embarks on this journey.
For starters, follow steps 1 through 3 from this post.
If you’re running a headless system, you’ll need to get your headset MAC addy. You can do this by running
hcitool scan
Once you have your MAC addy, pair, trust, and connect to your device.
sudo echo 0000|bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes sudo bluez-test-input connect XX:XX:XX:XX:XX:XX
Where XX:XX:XX:XX:XX:XX is your headset MAC addy.
Or, you can simply use the GUI, and install the bluetooth manager.
sudo apt-get install bluesman
And reboot.
In the bluetooth manager (under start=>preferences=>bluetooth manager), find your headset, pair, trust, and connect to the “headset service.”
Once you’ve successfully paired and connected your headset
sudo nano /etc/bluetooth/hcid.conf
and add the following:
device XX:XX:XX:XX:XX:XX { name "My Bluetooth Headset" auth enable; encrypt enable; }
where XX:XX:XX:XX:XX:XX is the headset MAC addy
Then:
sudo nano /etc/asound.conf
and add the following:
pcm.btheadset { type plug slave { pcm { type bluetooth device XX:XX:XX:XX:XX:XX profile "auto" } } hint { show on description "BT Headset" } } ctl.btheadset { type bluetooth }
where XX:XX:XX:XX:XX:XX is the headset MAC addy
And finally, change the USB port speed:
sudo nano /boot/cmdline.txt
by appending the following:
dwc_otg.speed=1
to the very end of the line.
Without the above setting, which I found under audio test, you’ll get lots of static when recording. Notably, even with the above setting, if you have a crappy headset, you’ll still get static.
But, I digress.
Once you’ve rebooted, your headset should automatically pair, anytime you turn it on. Importantly, you can now play sound through your headset and record sound from your headset mic.
Let’s see, have I left anything out? Probably.
While I took copious notes, setting this up did involve some trial and error. Especially considering that no single place contained all the information. In fact, in some instances, expected results were not reflected (as in the section above the “sound test,” in the aforementioned link), and in others, it actually broke the process.
Persistence however, does pay off! And hopefully, the above spark notes have captured enough to help you on your way to a successful install of the bluetooth headset pairing and access point for this particular dongle.
Oh and. One last thing that does play a role with regard to getting this dongle up and running. And that is power. I tried two different configurations. One, with a powered USB hub. The dongle wifi and bluetooth works in any/all ports. The other configuration involved using the powergen mobile power pack 8400, in conjunction with a non-powered USB hub. In this instance, the dongle wifi and bluetooth works in the raspberry pi port but there was not enough power to drive the wifi when it was plugged into the unpowered hub.