Today I bought a Bluetooth dongle to play around with PS3 and Wiimote controllers (more on that in the near future).
At first it was easy as pie, I could just plug it in and install all the needed software:
sudo apt-get install bluez-utils bluez-compat bluez-hcidump libusb-dev libbluetooth-dev joystick
After a reboot I was able to get the status of the dongle with the following command:
# hciconfig dev
hci0: Type: BR/EDR Bus: USB
BD Address: 00:09:DD:50:4E:B8 ACL MTU: 310:10 SCO MTU: 64:8
RX bytes:19072891 acl:328808 sco:0 events:229 errors:0
TX bytes:4020 acl:97 sco:0 commands:89 errors:0
The problem now was at the 3rd line of the status: DOWN
This means that the bluetooth dongle itself is installed properly and the system recognizes it. However it is not running. There are a bunch of things one can do in this case, but all resulted in errors:
# hciconfig hci0 up
Can't init device hci0: Device or resource busy (16)
$ hcitool scan
Device is not available: No such device
# hciconfig hci0 piscan
Can't set scan mode on hci0: Network is down (100)
After a while I decided to isolate the problem, ripped all my other USB devices off and restarted the RPi. It turned out that my wireless keyboard (Logitech K400) was disturbing the Bluetooth dongle. Seems as if Linux isn’t good at handling different devices that are communicating wireless (both via Bluetooth).
The solution now is to not use the wireless keyboard anymore. Instead I’m using a wired keyboard if needed. I’m currently working on getting rid of the keyboard in RetroPie anyways, more on that in the next days.