# [X11] Bluetooth mouse not working.

## Evil.2000

Hey.

I've a BT mouse from Saitek, which is recognized by hcitool and hidd but it does not move the pointer.

First i set the mouse do discoverable mode.

Then hcitool is showing me this:

```
~ # hcitool scan

Scanning ...

   00:16:90:00:0A:08   Bluetooth Mouse
```

Ok. Very well.

Now hidd:

```
~ # hidd --search

Searching ...

   Connecting to device 00:16:90:00:0A:08
```

Okay, this is well too.

Lets have a look if its registered:

```
 ~ # dmesg | grep input

input: Power Button (FF) as /class/input/input0

input: Lid Switch as /class/input/input1

input: Sleep Button (CM) as /class/input/input2

input: ThinkPad Extra Buttons as /class/input/input3

input: AT Translated Set 2 keyboard as /class/input/input4

input: TPPS/2 IBM TrackPoint as /class/input/input5

input: hdaps as /class/input/input6

input: Logitech Optical USB Mouse as /class/input/input7

input: USB HID v1.10 Mouse [Logitech Optical USB Mouse] on usb-0000:00:1d.7-1.3.1

input:   USB Keyboard as /class/input/input8

input: USB HID v1.00 Keyboard [  USB Keyboard] on usb-0000:00:1d.7-1.3.4

input:   USB Keyboard as /class/input/input9

input: USB HID v1.00 Device [  USB Keyboard] on usb-0000:00:1d.7-1.3.4

input: Terax Inc. Bluetooth Mouse as /class/input/input10
```

Nice its in there too.

But .... the mouse is not moving the pointer.

Lets check if /dev/input/input10 produces some sort of output:

```
~ # cat /dev/input/by-id/usb-_USB_Keyboard-event-mouse

^C  

~ #
```

Hmm. Nothing. Is it in /proc/bus/input/devices?

```
 ~ # grep -B 5 mouse /proc/bus/input/devices

I: Bus=0011 Vendor=0002 Product=000a Version=0000

N: Name="TPPS/2 IBM TrackPoint"

P: Phys=isa0060/serio1/input0

S: Sysfs=/class/input/input5

U: Uniq=

H: Handlers=mouse0 event5 

--

I: Bus=0003 Vendor=046d Product=c016 Version=0110

N: Name="Logitech Optical USB Mouse"

P: Phys=usb-0000:00:1d.7-1.3.1/input0

S: Sysfs=/class/input/input7

U: Uniq=

H: Handlers=mouse1 event7 

--

I: Bus=0005 Vendor=0a5c Product=0001 Version=001e

N: Name="Terax Inc. Bluetooth Mouse"

P: Phys=00:20:E0:76:C4:CD

S: Sysfs=/class/input/input10

U: Uniq=00:16:90:00:0A:08

H: Handlers=kbd mouse2 event10
```

Hmm. It is.

Why does /dev/input/input10 not pruduce any output?

I'm using bluez-libs and -utils version 3.36.

Thanks for all suggestions.

Evil.2000

----------

## VoidMage

Just a minor thing: with input problems, always state

if they're console or X11 type.

----------

## Evil.2000

It's related to X11. But i suppose that gpm will be involved because if nothing is send through the event10 input device file then it won't work too.

----------

## VoidMage

So does it or does it not work in console ?

----------

## Evil.2000

It does not work in the console.

I suppose the problem is that its recognized by that two handlers (kbd and mouse):

```
H: Handlers=kbd mouse2 event10
```

How is the detection of those devices done and is it possible to tell the kbd handler to skip that device?

-------

Edit:

Ok. Now i have a very extraordinary phenomenon. After clicking on the mouse, it is connecting to the PC and hidd is saying

```
hidd[8224]: New HID device 00:16:90:00:0A:08 (Terax Inc. Bluetooth Mouse)
```

like it always does when the mouse reconnects.

But now /proc/bus/input/devices shows:

```
I: Bus=0005 Vendor=0a5c Product=0001 Version=001e

N: Name="Terax Inc. Bluetooth Mouse"

P: Phys=00:20:E0:76:C4:CD

S: Sysfs=/class/input/input11

U: Uniq=00:16:90:00:0A:08

H: Handlers=kbd mouse2 event10 

B: EV=10000f

B: KEY=ff0000 10000 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe

B: REL=143

B: ABS=100 0
```

and the mouse is working.

I had the same effect yesterday. But if the mouse reconnects (because is was disconnected for saving energy) it won't work anymore.

Every time it connects the Sysfs=/class/input/input11 increments by 1.

Whats going right now, which is going wrong otherwise?

I'm confused.

----------

## Evil.2000

Okay. I rebooted my system now and tried to establish a connection from the mouse.

/proc/bus/input/devices looks really the same than before but the mouse is not working anymore. Even after reconnecting many times the mouse does not work.

I cant get why it works sometimes and most of the time not.  :Sad: 

Edit:

Every time i reconnect the mouse it is working for 0,5 sec. I can move it around or do a click for that short time. After that its not working anymore.

So maybe there is an initialization error on mouse reconnect?

----------

## Evil.2000

Ok. I figured something more out:

First:

If i connect the mouse it does not work as exprcted. But if i leave it alone for some time (about 10-20 minutes) the mouse reconnects and then its working until is goes to sleep. The procedure repeats every time the mouse is reconnected.

Second:

If i execute this python script:

```
#!/usr/bin/python

import dbus

bus = dbus.SystemBus()

# service activation

bmgr = dbus.Interface(bus.get_object('org.bluez','/org/bluez'),'org.bluez.Manager')

bus_id = bmgr.ActivateService('input')

imgr = dbus.Interface(bus.get_object(bus_id,'/org/bluez/input'),'org.bluez.input.Manager')

# device creation

path = imgr.CreateDevice('00:16:90:00:0A:08')

idev = dbus.Interface(bus.get_object(bus_id,path),'org.bluez.input.Device')

# host initiated connection

idev.Connect()
```

the following error occurs:

```
Traceback (most recent call last):

  File "./btest", line 13, in <module>

    path = imgr.CreateDevice('00:16:90:00:0A:08')

  File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 68, in __call__

    return self._proxy_method(*args, **keywords)

  File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 140, in __call__

    **keywords)

  File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 622, in call_blocking

    message, timeout)

dbus.exceptions.DBusException: org.bluez.Error.AlreadyExists: Input Already exists
```

So i suppose that the problem exists between the hidd and the buetooth stack and not between hidd and X.

What can i do to localize the problem?

----------

## shura0

Hi, I have the same issue too.

Have you found a solution?

----------

## Evil.2000

I followed these instructions:

http://sidux.com/index.php?module=Wikula&tag=hwBluetooth

and it was working.

But i remember the first time i tried it with this howto it did not work. Then i tried a lot to get it work and updated some packages (but i don't remember which i had reemerged) and then i tried the howto again and it worked.

So, i wish you good luck with that.

 :Wink: 

Evil

----------

## shura0

Thank you, but it's not what I want. The same result I have when run 'hidd --search'. After that command I press "Connect' button on my mouse and it starts working. But After power off/power on I need run that command again.

I need automatic. Mouse should connects when I power on it and reconnect if any. I don't want to run any scripts.

----------

## Evil.2000

The howto @ sidux.com does not require to run scripts every time. Just for telling bluez via dbus that this device is trusted and that connections are accepted.

Its just for setting up.

----------

## shura0

That does not work in automatic mode. I tried that.

As I understand Blueman does the same. I've added mouse to trusted devices and connected it to Input service. When I power on my mouse it connects to the PC and bluetooth-applet displays connected device. I see in dmesg:

```
Bluetooth: HIDP (Human Interface Emulation) ver 1.2

[   62.423191] input: BlueTooth Mouse as /devices/pci0000:00/0000:00:1d.3/usb5/5-2/5-2:1.0/bluetooth/hci0/hci0:41/input5

[   62.423915] generic-bluetooth 0005:09DA:80F0.0001: input,hidraw0: BLUETOOTH HID v0.1e Keyboard [BlueTooth Mouse] on 00:0A:3A:5B:46:03
```

And in Xorg.0.log:

 *Quote:*   

> (II) XINPUT: Adding extended input device "BlueTooth Mouse" (type: KEYBOARD)
> 
> (**) Option "xkb_rules" "evdev"
> 
> (**) Option "xkb_model" "pc105"
> ...

 

All the same like yours.

Your HowTo helps to connect mouse, but as I wrote does not make able autoconnect.

It looks like bug in bluez.

----------

