Published: 01-10-2015 | Author: Remy van Elst | Text only version of this article

Recently I set up a Kodi (XMBC) media center on a Raspberry Pi. The setup is mounted on a flatscreen TV and uses a small Wifi dongle for network access and a small Bluetooth dongle for a Rapoo E6700 wireless bluetooth keyboard/touchpad.

If you like this article, consider sponsoring me by trying out a Digital Ocean VPS. With this link you'll get $100 credit for 60 days). (referral link)

This is a nice bluetooth keyboard/mouse combo for a media center, it charges via micro USB. That saves a lot of battery hassle. The bluetooth adapter is a Sitecom CN-524, which was the only one my local electronic store had available.

Bluetooth boot mode

It however does not work with linux/Kodi by default. This is because the device boots in a wrong mode, HID, instead of HCI. On my Linux Mint and Ubuntu machines it wasn't recognized as well, and the usb_modeswitch tools didn't help. This website has a fix for that in the comments which is posted here as well.

You do sadly need a Windows machine for it. I used Windows 7 in a Virtualbox VM with USB passthrough.

Don't plug in the bluetooth dongle yet (or enable passthrough in the VM)

Download the BlueSuite to modifiy "BlueCore Persistent Store": http://www.kcwirefree.com/docs/BlueSuite 2 5.zip

Install the BlueSuite Software (default options)

Plug the bluetooth dongle in (enable passthrough in the VM)

Run CSR BlueSuite 2.5.0 / PSTool as Administrator

In the first window choose "Transport" = USB and "Port" = \\.\csr0 and click OK

and "Port" = and click OK In the filter box, type "bootmode" then click on the item Initial device bootmode

Note the hex number in case something goes wrong (mine was empty), then change it to 0000 .

. Click on the Set button then click on the Close button

Wait a few seconds then unplug the bluetooth dongle.

After I did this the bluetooth dongle worked without issues on Ubuntu and my Linux Mint machine. The Raspberry Pi / Kodi setup required some more steps.

Kodi / OpenELEC configuration

Make sure you enable SSH via the OpenELEC settings. The default username / password is root / openelec . Login via SSH and make sure the bluetooth adapter is listed in the output of lsusb :

lsusb

Output:

Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

If that is the case, continue on.

The bluetooth adapter is down by default. Check it with the hciconfig command:

hciconfig

Output:

hci0: Type: BR/EDR Bus: USB BD Address: 00:09:DD:50:29:EF ACL MTU: 310:10 SCO MTU: 64:8 DOWN RX bytes:108 acl:0 sco:0 events:0 errors:0 TX bytes:104 acl:0 sco:0 commands:0 errors:0

Turn it on with the following command, and check the status again with hciconfig :

hciconfig hci0 up hciconfig

Output:

hciconfig

Output:

hci0: Type: BR/EDR Bus: USB BD Address: 00:09:DD:50:29:EF ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING RX bytes:1008 acl:0 sco:0 events:42 errors:0 TX bytes:164 acl:0 sco:0 commands:40 errors:0

Now turn on the bluetooth daemon, otherwise OpelELEC doens't pick it up:

/usr/lib/bluetooth/bluetoothd &

There is no output of this command.

Now try to pair the bluetooth keyboard via the OpenELEC settings program, it should work. You enter a code from the screen in the keyboard and after that it works every time you turn the keyboard on by default.

To make these settings permanent, add the following to the file /storage/.config/autostart.sh :

nano /storage/.config/autostart.sh ( hciconfig hci0 up; /usr/lib/bluetooth/bluetoothd; ) &

Test it by rebooting the Pi. The keyboard should work by default again.c

Tags: bluetooth