Forum

Full Version: Trouble with bluetooth
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
i have bluetooth dongle with mouse, but they does not wotk in xbian 1.0.5. The mouse seems to be connected , but does not work at all. I have tested them in windows and everything does work well.

xbian@xbian ~ $ sudo hcitool dev
[sudo] password for xbian:
Devices:
hci0 00:11:67:00:00:00


xbian@xbian ~ $ sudo hcitool scan
Scanning ...
00:1A:40:00:F3:4C BlueTooth Mouse


xbian@xbian ~ $ sudo hcitool con
Connections:
> ACL 00:1A:40:00:F3:4C handle 1 state 1 lm MASTER


dmesg:
[ 291.220951] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 291.229639] hid-generic 0005:09DA:80F0.0002: unknown main item tag 0x0
[ 291.230568] input: BlueTooth Mouse as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/bluetooth/hci0/hci0:1/input1
[ 291.243256] hid-generic 0005:09DA:80F0.0002: input,hidraw1: BLUETOOTH HID v0.1e Keyboard [BlueTooth Mouse] on 00:11:67:00:00:00
Can you try following the answer from here? http://raspberrypi.stackexchange.com/questions/797/how-can-i-use-a-bluetooth-mouse-and-keyboard (the one from zenbike)
I also have a Apple Magic Mouse and Apple Keyboard attached with bluetooth. After one whole sunday i made it work reliable.

The problem is related to the fact, that XBMC does not recognize hot-plugged input devices. Once You started XBMC, it will keep the initial keyboard and mouse. If there was none available, it will not react on hot-plugged devices after start.

I am right now in a hurry an will give a detailed explanation later on.

Cheers
dezi
The hotplug issue also counts for Lirc. You can restart Lirc with a new config without also restarting XBMC to make it work. Especially in case of Bluetooth is an ass because if you loose connection or the connecting timeout XBMC doesn't reconnect when the dongle does.
Ok, my solution to this issue is at this moment a little bit dirty and i don't really like it. Since i have no other options to remote control my XBian other than a Bluetooth Keyboard and a Bluetooth mouse, i am ok with it.

Basically what You have to do before You start up XBMC is to make sure, keyboard and mouse are active. I installed the following set of packages for bluetooth:

sudo apt-get install bluez bluez-compat
sudo apt-get install python-gobject python-dbus

I have than successfully paired mouse and keyboard with the Raspberry.

I have switched off XBMC auto start via xbian-config, which lets You boot into a tty console on TV-screen. You should check at this stage, if the keyboard is properly reconnected when You try to login. I do not remember exactly, but i also have unconfigured the XBian splash-screen, because it obscures the tty-login.

To disable th splash screen, modify /root/cmdline.txt. Take out the last item "splash".

@CurlyMo: what is the meaning of "console=tty2" in this file? Does the XBMC run on tty2? I have changed this to tty1 for my purposes, but do not know, what impact this has...

After this i modified /etc/inittab such way, that is does an autologin with mingetty to user xbian (apt-get install mingetty) and added a little loop to .bashrc, which waits for the user to wiggle the mouse and awake the keyboard. I am at office right now and have no access to give the sample script. Will do in the evening.

After this i initiate XBMC startup within tty1. Then it works fine. Even if mouse and keyboard fall asleep, they reconnect properly in XBMC.

What i do not like about this, is having an open console login to my raspian. Any user can leave XBMC and finds a valid session w/o password reconnect. Also we are leaving the path of the /etc/init.d/xbmc startup script.

As long as XBMC does not hot-plug keyboard and mouse, i have to live with that. What i will check out, if it is possible, to insert the mouse and keyboard wakeup into /etc/init.d/xbmc, maybe with another splash-screen which tells user to wiggle the mouse and keyboard before XBMC fires up.

Cheers
dezi
Quote:@CurlyMo: what is the meaning of "console=tty2" in this file? Does the XBMC run on tty2? I have changed this to tty1 for my purposes, but do not known, what impact this has...
This will output all kernel messages to tty2 instead of tty1 (aka the tv).

Quote:After this i modified /etc/inittab such way, that is does an autologin with mingetty to user xbian (apt-get install mingetty) and added a little loop to .bashrc, which waits for the user to wiggle the mouse and awake the keyboard. I am at office right now and have no access to give the sample script. Will do in the evening.
You don't have to install anything, just change the appropriate line to:
Code:
#1:2345:respawn:/sbin/getty 38400 tty1
1:2345:respawn:/bin/login -f xbian tty1 </dev/tty1 >/dev/tty1 2>&1/g

It would be great if you can turn this into an proper script that we can implement.
@Koenkk, can you check if this patch fixes the bluetooth issues: https://github.com/xbmc/xbmc/pull/2435
Compiling it, will notify here when it's ready
(8th Apr, 2013 02:03 AM)Koenkk Wrote: [ -> ]Ready, instructions: https://github.com/xbianonpi/xbmc-nightly/blob/master/README.md
It doesn't work for me:
Code:
/usr/local/lib/xbmc/xbmc.bin: error while loading shared libraries: libbluetooth.so.3: cannot open shared object file: No such file or directory

Without updating my bluetooth keyboard works fine on xbmc if I press several keys while starting xbian
Reference URL's