Using RaspBMC 1.0 (Frodo) with bluetooth keyboard

Without having checked whether each step was actually necessary, this is how I got a Bluetooth keyboard working with RaspBMC 1.0 (Frodo). Mostly based on this installation and this setup.

SSH into your RaspBMC with username pi and password raspberry.

$ sudo su
# update-rc.d dbus defaults # prevents bluez installation failure
# apt-get install bluez python-gobject # gobject required by bluez-simple-agent

If the installation succeeded, the bluetooth service should be up and running (version bluez-4.99_2 in my case):

# service bluetooth status
[ ok ] bluetooth is running.

Otherwise it can be started with

# service bluetooth start

Put the keyboard into pairing mode and find out its address using

# hcitool scan
Scanning ...
        00:18:00:0A:F7:E3       BTKB-F7E3

With the keyboard still in pairing mode, I then attempted the pairing process with

# bluez-simple-agent hci0 00:18:00:0A:F7:E3
Creating device failed: org.bluez.Error.AlreadyExists: Already Exists

Apparently, the error indicates that the device is already paired (because I had previously used it on my PC), and the remedy is adding an arbitrary 3rd argument to the invocation.

# bluez-simple-agent hci0 00:18:00:0A:F7:E3 a
RequestPinCode (/org/bluez/1981/hci0/dev_00_18_00_0A_F7_E3)
Enter PIN Code: 1234
Release
New device (/org/bluez/1981/hci0/dev_00_18_00_0A_F7_E3)

I first entered the PIN code when prompted and had typed it on the keyboard followed by Enter before the line that says "Release".

I then created the entry to automatically pair the device after it disconnects:

# bluez-test-device trusted 00:18:00:0A:F7:E3 yes

This adds a line containing the device address to the file /var/lib/bluetooth/<adaptor address>/trusts.

Now connect the keyboard and load the necessary uinput module.

# bluez-test-input connect 00:18:00:0A:F7:E3
# modprobe -i uinput
# echo uinput >> /etc/modules

After restarting XBMC, the keyboard worked.

# restart xbmc

Comments

  1. Thanks!! I was struggling with my bluetooth keyboad setup because I did not know about the uinput module.

    ReplyDelete
    Replies
    1. Hi there, can you tell me what these two lines are? I am trying to get my bluetooth keyboard to work but so far it's only working in "terminal" and not in the xbmc gui...

      #modprobe -i uinput
      # echo uinput >> /etc/modules

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi, and thanks for the article. I've got the bluetooth iPazzport keyboard and am still having difficulties. The keyboard seems to work in the terminal, but still won't work in RaspBMC. When I enter "bluez-test-input connect 20:42:a1:00:9d:fd", it gives me this output:

    Traceback (most recent call last):
    File "/usr/bin/bluez-test-input", line 40, in
    input.Connect()
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
    dbus.exceptions.DBusException: org.bluez.Error.AlreadyConnected: Already Connected

    When I then enter "modprobe -i uinput" and "echo uinput >> /etc/modules", it accepts the commands but doesn't give any feedback. After rebooting the Pi, the keyboard still does not work.

    Any ideas? Many thanks!

    ReplyDelete
    Replies
    1. hi i had that issue that means it been paired already you can force re-pairing with bluez-test-input connect 20:42:a1:00:9d:fd x (the x can be anything)

      Delete
  4. I've since switched to OpenELEC which supported my BT keyboard out of the box. It includes a settings menu specifically for pairing.
    I haven't checked whether recent versions of RaspBMC contain the same.

    ReplyDelete
  5. Thanks for your nice post . I hope I will see this type of post again in your blog
    mini speaker | bluetooth keyboard

    ReplyDelete

Post a Comment