Close
Simone Seagle

Simone Seagle

Independent Web and Educational Software Developer

Read More

Search

Prev Next
Enabling a Wifi/Bluetooth combination dongle on a Raspberry Pi
Blog

Enabling a Wifi/Bluetooth combination dongle on a Raspberry Pi

April 27, 2016 Simone Seagle

The end-game of my Fall-Ball project is to have a web server running on my Raspberry Pi 2. However, the out-of-the-box Pi 2 has neither Wifi (which I'd need for communication) or Bluetooth (which is how data is transmitted by the KL46Z). I was thinking about purchasing a Pi 3 which has both of those included, but I found this combination dongle for only $20 on Adafruit. Seemed like a pretty good deal and it saved me effectively $30. The packaging says that it is designed for Windows, but if Adafruit says it will work with Linux that's good enough for me.

I figured should start by getting the Wifi to work so that it will then be easier to install the Linux Bluetooth drivers because I'll have internet on the Pi. (Duh) My current setup is using a MacBook Pro laptop that is SSHing and/or VNCing into the Pi.

The first link I found for installing a wireless dongle is this forum post. It's vaguely amusing to me because it expects you to download stuff, but the reason why I bought the dongle in the first place is because I didn't have internet on it.

Aaannndd.. Turns out I didn't need to follow that post at all. The Pi automatically detected the wifi dongle and it totally works. At least I didn't waste that much time on it. Now all I need is to get the Bluetooth part to work.

alt text A screenshot of the Raspberry Pi's desktop demonstrating the wifi dongle working perfectly. Adafruit recommends using Bluez as the Library for controlling Bluetooth. I'm now going to follow this tutorial to make sure Bluetooth works and connects to my FallBall. Luckily I have internet on the Pi so I can actually download the libraries it needs... That link is part of a larger tutorial on how to set up iBeacons which I'm not doing, but the Bluetooth thing should be what I need. I just need to know how to pair properly.

I ran the code and hit a small snag when I tried to download the libraries, but running

sudo apt-get update

and then re-downloading the dependency libraries fixed it. Now that Bluez is up and running, I want to figure out how to get it to find a specific device and connect to it! This article shows how to use the hci tools that come with Bluez.

I typed

hcitool scan

and saw my bluetooth device show up! Epic win! (It's HC-06 below)

alt text The dongle works! My KL is HC-06. Now in order to pair with it, I'm following this tutorial.

I found that when I installed blueman, it wouldn't open up the UI, so I found this fix for it, and I'm good to go!

alt text

Great success!