LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Linux Answers > Hardware
User Name
Password

Notices

By NoUse4ANick at 2006-04-03 21:56
Everyone that has bluetooth on their laptop knows how hard it is to pair their mouse with their distro. They probably have read multiple howto's on the subject with little or no success. Well in this 'how to' I'm going to show you how I got my laptop to talk to a non-Microsoft/Logitech bluetooth mouse.

I am personally running Gentoo, so the actual unpacking/installing of each file will be left up to the user and their distro. I would highly recommend that IF you are doing a fresh install of a distro that you tell it to include bluetooth support (go through it and select EVERY option for bluetooth). If you are doing a patch, then go into your .config file and edit the 'BT' section then recompile your kernal, I'll just go over here and wait while you do that.....

Done? Ok, if your using gentoo emerge the bluez libs and utils (you might need some of the other packages depending on your hardware and window manager), or go to http://www.bluez.org/download.html to get the packages & install them.

Ok, now your bluetooth should kinda work, you should be able to (after you get the stuff running) run hidd --search to see bluetooth devices that are in discover mode (note: you MUST put your mouse in this mode otherwise your computer won't see it!). For more info on how to get your hcid and hidd demons running google it or search the forums.

Now for the part that was REALLY tripping me up for the longest of time: the hcid.conf file!

This file should be in your /etc/bluetooth directory, open it up in your favorite editor (you might have to change permissions on it or open it as the root) and configure it to something simmilar to this:
Code:
#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.4 2004/04/29 20:14:21 holtmann Exp $
#

# 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 user;
	#security auto;

	# 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/bin/bluepin;
	#pin_helper /etc/bluetooth/cbpinscript;
	pin_helper /usr/lib/kdebluetooth/kbluepin;

	# D-Bus PIN helper
	#dbus_pin_helper;
}

# Default settings for HCI devices
device {
	# Local device name - change to whatever you want
	#   %d - device id
	#   %h - host name
	name "laptopcb (%d)";

	# Local device class (orig)
	# class 0x100;
	# Local device class (modified from kde-bluetooth)
        # might want to leave this to whatever it was set to orginally
	class 0x100100;

	# 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
        # this is the key section!
	auth disable;
	#encrypt enable;
}
At this point restart hcid/hidd (or restart your computer), once your computer is back up and running turn on your mouse and see if your computer picks it up!

If anyone finds more links about bluetooth mice, please put them here in a comment so others can hopefully find either a better solution, a better step-by-step walkthough, or something for their distro/hardware that I didn't cover, and below are a couple of links that I used in this article:
Connect a Logitech MX900 bt mouse: http://www.bueche.ch/comp/mx900/mx900.html
Gentoo wiki info on bt: http://gentoo-wiki.com/HARDWARE_Gentoo_on_Dell_Inspiron_8600#Bluetooth

copyright: 2006 Art Miller, do with this as you please, if you are going to copy this please at least link back to it, thanks!

by zimon on Sat, 2006-10-28 05:47
Quote:
Originally Posted by NoUse4ANick
This thread is to discuss the article titled:
Bluetooth on a Dell 600m laptop
I'd rather have authorization and encryption on, also with mouse and especially with a bluetooth keyboard.

The changes I need to make to the instructions of the article above, in hcid.conf file are these:

security auto;
# instead of user

lm accept,master;
# instead of just accept

auth enable;
encrypt enable;


Connecting the mouse works first time by pressing the "pairing button" on the mouse (in the bottom of my Epox mouse) and right after that on the host:
# hidd --search
...it should find the mouse HW bluetooth address and will ask a PIN code in a dialog window (the PIN code for my EPoX Bluetooth mouse is "1234")

Latter times the mouse will autoreconnect after the sleep mode just by clicking the left or the right mouse button.

After that, the connection looks something like this:
$ hcitool con
Connections:
< ACL 00:04:61:XX:XX:XX handle 40 state 1 lm MASTER AUTH ENCRYPT


  



All times are GMT -5. The time now is 07:12 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration