Here is a solution.
First switch to admin mode:
Now get the necessary packages. This will install all necessary software.
apt-get install bluetooth bluez blueman
Then use the lsusb command to list the connected USB devices…
The result will include something like this:
Bus 001 Device 001: ID 0b05 17cb Vendor Desc.
Now you have to find the correct device. When you found it, copy the ID without colon and write it into the /sys/bus/usb/drivers/btusb/new_id. You can do it like this:
echo "0b05 17cb" >> /sys/bus/usb/drivers/btusb/new_id
Now we will use a tool called modprobe which allows us to load modules on our running system.
modprobe -v btusb
Almost done! Just edit the config with nano (save= crtl+o ; quit= crtl+c)…
… and copy the few lines below
HID2HCI_ENABLED=0 HID2HCI_UNDO=0 HIDD_ENABLED=1
Restart bluetooth and you are ready to go!
invoke-rc.d bluetooth restart
Testing the bluetooth dongle
● bluetooth.service - Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled) Active: active (running) since Wed 2015-11-18 10:38:48 GMT; 5min ago Docs: man:bluetoothd(8) Main PID: 3800 (bluetoothd) Status: "Running" CGroup: /system.slice/bluetooth.service └─3800 /usr/lib/bluetooth/bluetoothd
Pair the Pi with a keyboard (for example)
Scanning ... 00:0F:F6:82:D1:BB Motorola Bluetooth Wireless Keyboard
/home/pi# echo 1234|bluez-simple-agent hci0 00:0F:F6:82:D1:BB RequestPinCode (/org/bluez/3964/hci0/dev_00_0F_F6_82_D1_BB) Enter PIN Code: Release New device (/org/bluez/3964/hci0/dev_00_0F_F6_82_D1_BB)
/home/pi# bluez-test-device trusted 00:0F:F6:82:D1:BB yes
Test the device as an input
/home/pi# bluez-test-input connect 00:0F:F6:82:D1:BB
After a reboot the keyboard should still connect. It’s possibe a keystroke is needed to connect. Connection can take a few seconds.
/home/pi# hcitool con Connections: < ACL 00:0F:F6:82:D1:BB handle 41 state 1 lm MASTER AUTH ENCRYPT