teleost.org

Navigation:
Home  Comments

Tags:
linux  bluetooth  input  installation  xorg 

How to install a bluetooth mouse in Linux

This worked on my laptop with all the bluetooth mice I have tested. The one I use is a Trust MI-5300M Bluetooth Optical Mini Mouse. For a list of tested mice see the bottom of this page, but it should work with any bluetooth mouse.

First of all, make sure you have set up your bluetooth dongle/adapter correctly. Maybe test it by connecting to your phone.

Edit your /etc/X11/xorg.conf to include this:

Section "ServerLayout"
    Identifier "X.org Configured"
    Screen 0 "Screen0" 0 0
    InputDevice "Mouse0" "CorePointer"
    InputDevice "Mouse1" "SendCoreEvents"
    InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/input/mice" #this may be different, depends on your distro.
EndSection

Section "InputDevice"
    Identifier "Mouse1"
    Driver "mouse"
    Option "Protocol" "ExplorerPS/2"
    Option "Device" "/dev/input/mice" #this may be different, depends on your distro.
    Option "Emulate3Buttons" "false"
    Option "ZAxisMapping" "4 5"
EndSection

Open your bluetooth configuraton file (/etc/conf.d/bluetooth) and change the HIDD setting to "true"

# Start hidd (allowed values are "true" and "false")
HIDD_ENABLE=true

# Arguments to hidd
HIDD_OPTIONS=""

Now restart X (log out, hit CTRL-ALT-BACKSPACE. If this just stops X for you, hit CTRL-ALT-F2, log in as root and type "killall xdm && xdm"). Try moving your mouse around. It may take a second for X to notice it, but from then on it should work.

Tested mice:


Comments:
By Anton on May 9, 2006:
Hi!
Thanks for article, my mouse works now.
Unlikely, mouse stop to work after 15-40 minutes since system up.

Tested on laptop Toshiba Satellite M40 289,
ALT-linux (also Mandrake2006, ASP-11, Debian).
By n on May 11, 2006:
Have you tried using the latest kernel version (/bluetooth driver version)? Tested with another bluetooth mouse?
By Anton on May 16, 2006:
Hello,
versions:

$uname -a
Linux *****.***.** 2.6.16.10 #2 PREEMPT Thu May 4 21:21:43 MSD 2006 i686 unknown unknown GNU/Linux

I tried it with other kernels (2.6.12, 2.6.14) with same results.

$modinfo bluetooth
filename: /lib/modules/2.6.16.10/kernel/net/bluetooth/bluetooth.ko
author: Maxim Krasnyansky , Marcel Holtmann
description: Bluetooth Core ver 2.8
version: 2.8
license: GPL
alias: net-pf-31
vermagic: 2.6.16.10 preempt PENTIUM4 gcc-3.4
depends:
srcversion: 33ACC2EE4F276D024C8AC67

Unfortunately I can't test with another bt-mouse. Wind0wsXP works perfectly with my mouse.
Have You any idea?
By n on May 16, 2006:
The only cases I've heard of where bluetooth stops working is on suspend/resume, like this.

If you run
rmmod uhci-hcd
modprobe uhci-hcd
or
rmmod bluetooth
modprobe bluetooth
when it stops working, does it help?

Otherwise, I recommend asking at bluez-users.

I compiled all the bluetooth stuff into the kernel instead of loading modules. If you didn't you could try that.
By Anton on May 17, 2006:
Seems like it's not my case (suspend/resume), manipulatios
with un/loading modules don't help me too.
Althogh, mouse works longer if bluetooth stuff compliled into the kernel :-)
Please, can You send the lsmod issue, bluetooth/usb settings in kernel-config and /etc/bluetooth/hcid.conf ?

ps: I have already send question to bluez-users, but for some reason, it isn't appears in mail-archive, so You are the single way to force my mouse start working correctly. Thanks!
By n on May 19, 2006:
I don't have any bluetooth-related modules loaded, it's all compiled in. Check every option under bluetooth in the kernel config. The config file quotes above are taken directly from my system.
By Anton on May 19, 2006:
>The config file quotes above are taken directly from my system
Sorry, I can't see any referencies to config of kernel.

I have problem with network too: it disappears when i try download large file from net or stay in active connection long time. Problem was solved after setting "noapic" option as kernel loading parameter in lilo.conf. Obviously it is related with problem of mouse, because mouse works fine now.
Just now i reveal solution on this site :) Thanks!
By n on May 19, 2006:
np, though I can't take credit for it. I'm glad you got it to work.
By Pavol Madeja on Jul 10, 2006:
Hi guys, okay so the thing is that I spent like two weeks trying to
convince my mouse to automaticaly connect while booting up the system.
The thing is following:
1. I can run mouse in X without problem after several scans with
"hcitool scan" command (it almost never find mouse for the first time)
and "hidd --connect xx:xx:xx:xx:xx:xx" command
2. I'd like to get a rid of this anoying routine everytime i start up my linux.

HCID.CONF
#
# HCI daemon configuration file.
#

# HCId options
options {
# Automatically initialize new devices
autoinit yes;

# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming connections
# user - Always ask user for a PIN
#
security none;

# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired devices
# once - Pair once and deny successive attempts
pairing multi;

# PIN helper
pin_helper /usr/lib/kdebluetooth/kbluepin;

# D-Bus PIN helper
#dbus_pin_helper;
}

# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
name "%h-%d";

# Local device class
class 0x3e0100;

# Default packet type
#pkt_type DH1,DM1,HV1;

# Inquiry and Page scan
iscan enable; pscan enable;

# Default link mode
# none - no specific policy
# accept - always accept incoming connections
# master - become master on incoming connections,
# deny role switch on outgoing connections
lm accept;

# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;

# Authentication and Encryption (Security Mode 3)
auth disable;
#encrypt enable;
}

should i take care of some additional files like rfcomm.conf etc.?
By Simon on Mar 20, 2007:
THANK YOU!

I couldn't work out why my mouse wasn't working, even after ensuring it was connected via bluetooth.

Your article solved it :-)

Simon
By I still can't find my mouse using linux on Jul 3, 2007:
... This is how I got my bluetooth mouse to work: Tried to scan it in linux. Could not ever find it. Booted up into vista to see if that would identify it. It did, and it worked fine. Booted up into linux, and it works automagically. I can't even _disable_ it. Even if I don't start the bluetooth daemon, it works. Disabling all input in xorg.conf, and it still works. It's freakin' creepy. Bad news: the mousewheel doesn't work
By Ken on Sep 18, 2007:
No such directory as /etc/conf.d in my ubuntu Linux.

Leave a comment:

Name:  
URL:  
Comment:  


Home   Top  RSS