This is a step by step guide on how I managed to pair my Bluetooth keyboard (RII ProMini) with the Raspberry Pi. This might help people who are struggling with it just as I was.
- First of all, start with a fresh install of NOOBS on your Raspberry Pi and install Raspbian. This will rule out anything you have done before that would prevent this guide from working.
- Plug the Bluetooth dongle directly on the Raspberry PI board.
- Boot the Raspberry PI and connect to it using SSH from another computer.
- Switch to root.
- Install all the updates. This will take a while.
- Enable dbus
- Reboot
- Reconnect to your Raspberry Pi as described in the earlier steps (login and then switch to root).
- Install the Bluetooth dependency files.
- Reboot
- Reconnect to your Raspberry Pi as described in the earlier steps (login and then switch to root).
- Check that your Bluetooth dongle is recognized. If not, unplug it and re-plug it into the Raspberry Pi.
- Make sure your Bluetooth device is set in discoverable mode and scan for the device using Raspberry Pi. Make note of the keyboard’s MAC address (e.g. 01:23:45:67:89:AB)
- Pair the device. When requested, type a pin like 1234 and hit ENTER. Then type the same PIN and hit ENTER on the keyboard you are pairing with.
- Make the keyboard a trusted device
- Connect to the keyboard.
- When you reboot your Raspberry Pi, it will take a few seconds for the keyboard to become usable.
The Bluetooth installation was not working with me when I was using the latest NOOBS build so I went with a build before December 8th 2013 (November 4th 2013 build). I have noticed on several different forums that the latest build of NOOBS is using a kernel that is stopping most, if not all, Bluetooth dongles from working. I am not sure how true that is since I am not a Linux expert. But I can say that my Bluetooth keyboard worked with a older build of NOOBS and not with the latest build.
All you need is an SSH client like PuTTY, the IP address of your Raspberry and your login credentials. I would not recommend using a wired keyboard since my installation would not work when I was using one. This could have just been a one-off situationso it might not happen to you. Just do not say that I did not warn you.
sudo -s
apt-get update
apt-get upgrade
update-rc.d -f dbus defaults
Don’t worry if this gives you an error as I got one as well. Just continue with the rest of the guide.
reboot
apt-get install bluez python-gobject
apt-get install bluetooth bluez-utils blueman
I did both commands because my Bluetooth was still not working after I did the first command only. Not sure if I got the wrong dependency files or that if Bluetooth only works by doing both commands. If you are following my guide I would recommend doing both commands.
reboot
lsusb
hcitool scan
bluez-simple-agent hci0 01:23:45:67:89:AB
bluez-test-device trusted 01:23:45:67:89:AB yes
bluez-test-input connect 01:23:45:67:89:AB yes
These are the steps I took to pair my keyboard. I could explain what is happening at each step but I think the post will end up being too long. I hope this guide will help you.
Note: This method worked at the time of writing this post. If you still need help then consider leaving a comment or contacting me via Twitter.
2 replies on “Pairing A Bluetooth Keyboard With A Raspberry Pi”
How to setup auto connecting the bluetooth keyboard when booting the Raspberry Pi?
It auto-connects if you follow the above method. It just takes a couple of minutes for the Raspberry Pi to connect to the keyboard.