This page will show you how to pair your Bluefruit EZ-Key to a Linux computer. It's tested on Raspberry Pi & Raspbian but the instructions will be similar for other machines and distros (we hope!) Check your distro documentation if this doesn't work.

Thanks to for the details!

You only have to pair once - after the EZ-Key is paired to a computer it will auto-connect from then on

First up, you'll have to make sure you have Bluetooth v2.1 or greater on your computer. Many laptops have BT built in and unless its a really old machine (< 2008), the built in BT should be OK. If you do not have BT built in, you'll need a USB dongle such as this one
Many ultra-low cost USB adapters you may find are BT v2.0 and NOT v2.1. You MUST have a v2.1 or greater adapter, as v2.0 does not support the way we handle pairing. If you get a BT v4 module you will have no problems, so please do not use "$2" adapters!

Step 0 Plug in BT Adapter

With the Raspberry Pi off, plug in the BT module and reboot.

Step 1 Update & Install Bluez

Make sure you have Internet connectivity on your Pi so you can install the following updates & software for Bluetooth control.

All of the following must be typed into a Terminal window or Console or Command line.
sudo apt-get update
sudo update-rc.d -f dbus defaults
sudo apt-get install bluez python-gobject
Now run
hcitool dev
to see the bluetooth USB module
Lastly, we'll make a minor edit to allow passkey-less pairing. Run
sudo nano /usr/bin/bluez-simple-agent
To edit the agent that manages BT pairing. Type Control-W to search for KeyboardDisplay
Then edit that line and change KeyoardDisplay to DisplayYesNo

Step 2. Power the Bluefruit EZ-Key and Press the Pair Button

The title of this step is pretty much what you have to do. Remember that you have solder the 0.1" headers to the module or at least solder wires to the Vin and Ground connections. Connect Vin to 3 to 16VDC (5V is ideal) and ground to the ground power wire.
You should see the red LED blink. Now press the mini button on the EZ Key for 5 seconds and release, this will erase any old pairing information and let you re-pair to your computer.

The red LED will now blink at a steady once-a-second.

Step 3. Scan & Connect to Bluefruit Module

Now it's time to find the Bluefruit device. Run
hcitool scan
to scan for devices. You may have to run it once or twice to see the Adafruit device pop up
See that long number before the name? Starts with 00:18:... ? Each module has a unique identifier number. Your setup will have a different ID so be sure to type out the exact same ID you have. We will proceed as if you were pairing to the module on my desk :)

We will now create a device for the keyboard. Type in
sudo bluez-simple-agent hci0 00:18:96:B0:04:82
But changing it to the ID number you have
Next, we will trust this keyboard. Type in
sudo bluez-test-device trusted 00:18:96:B0:04:82 yes
(don't forget that yes at the end)
followed by
sudo bluez-test-device trusted 00:18:96:B0:04:82
(no yes at the end)
You should see a 1 after the last command. If you get a 0 try again, check that you typed the #'s right.
Finally, we can connect! The last command to run is:
sudo bluez-test-input connect 00:18:96:B0:04:82
If you want to ever remove the pairing, type in
sudo bluez-test-device remove 00:18:96:B0:04:82
Now you will notice the red LED on the module blink slower.
REMEMBER! This is a USB keyboard so if you are SSH'd or connecting via a Console cable, you WON'T see keystrokes appear. On a Raspberry Pi you have to connect a TV to the Composite or HDMI outputs to see the keyboard input.

This guide was first published on Sep 27, 2013. It was last updated on Sep 27, 2013.

This page (Linux (e.g. Raspberry Pi)) was last updated on Sep 27, 2013.

Text editor powered by tinymce.