From owner-freebsd-bluetooth@FreeBSD.ORG Mon Dec 20 02:35:08 2004 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C621216A4CE for ; Mon, 20 Dec 2004 02:35:08 +0000 (GMT) Received: from mta9.adelphia.net (mta9.adelphia.net [68.168.78.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A30543D3F for ; Mon, 20 Dec 2004 02:35:08 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [192.168.1.254] (really [70.32.233.78]) by mta9.adelphia.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20041220023505.EJPJ14945.mta9.adelphia.net@[192.168.1.254]>; Sun, 19 Dec 2004 21:35:05 -0500 Message-ID: <41C63A62.20304@savvis.net> Date: Sun, 19 Dec 2004 18:35:14 -0800 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: vova@fbsd.ru References: <1100552998.1098.5.camel@localhost> <419B8353.7040908@savvis.net> <419B9EF8.2090401@savvis.net> <1103269957.974.7.camel@localhost> <41C32471.2050805@savvis.net> <866530fusa.fsf@kamino.rfc1149.org> <41C35B92.7080908@savvis.net> <1103489813.1721.14.camel@localhost> In-Reply-To: <1103489813.1721.14.camel@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: bluetooth@freebsd.org Subject: Re: Bluetooth mouse X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2004 02:35:08 -0000 Vladimir, >>>>bthidcontrol(8) is a utility that can query bluetooth hid devices and >>>>create configuration for bthidd(8). >>>> >>>>% nroff -man bthidcontrol.8 | less -- for more information >>>> >>>>bthidd(8) is a bluetooth hid daemon (incomplete but mouse should work). >>>>it will read configuration created by bthidcontrol(8) and talk to >>>>bluetooth hid devices. >>> >>>I just tried it with my Logitech MX900 mouse, it works! :) >> >>good. > > I was not such lucky with mx900. > > My experience: > > bthidcontrol works ok: [...] good. > my configurations files are: > > # cat /etc/bluetooth/bthidd.conf [...] > # cat /var/db/bthidd.hids > 00:07:61:17:9b:27 hmmm... you did not hand-edit /var/db/bthidd.hids, did you? this file is not supposed to be edited by user. this file contains "hints" for bthidd(8), that is bluetooth hid devices "known" to bthidd(8). > When I start bthidd it waits for mouse connection forever, clicking on mouse connect button does not seems to have any effect, > moreover hcidump does not show any traffic. again if you hand-edited /var/db/bthidd.hids, then this is the correct behavior. the typical behavior of bluetooth hid devices is: the very first time bluetooth hid device needs to be contacted by the host. this is because in its default state bluetooth hid device does not know anything about host, i.e. its bd_addr etc. in its default state the hid device will answer inquiry, etc. the host finds new hid device and initiates bluetooth hid session (opens interrupt and control channels). after the hid device was contacted by the host for the very first time, the hid device will "remember" host bd_addr. after that bluetooth hid device will reject all connection attempts from the different hosts and may even stop responding to inquires. so, the /var/db/bthidd.hids file contains bd_addrs of the bluetooth hid devices that were contacted by the host (bthidd(8)) at least once. in order to get bluetooth hid device in its default state you will need to press reset button (if any) or just disconnect batteries for a few seconds. > But bthidd listens on /17 and /19 (why not /11 ?) 0x11 = 17 and 0x13 = 19 :) [...] > If I try to change reconnect_initiative to false bthidd try to connect to mouse but gets error: > > # bthidd -d > bthidd[1785]: Opening outbound session for 00:07:61:17:9b:27 (new_device=0, reconnect_initiate=0) > bthidd[1785]: Could not connect to 00:07:61:17:9b:27. Socket is not connected (57) that will not work. what you put into /etc/bluetooth/bthidd.conf (output of bthidcontrol(8)) is what devices tells us to do. that is a locally cached copy of bluetooth hid descriptor. "reconnect_initiate = true" and "normally_connectable = false" tells the host that device will initiate reconnect and host should not try to attempt to contact it. [...] > On mouse I have picture where attaching procedure shown as > 1. Click connect on mouse > 2. Click connect on USB receiver. > > Looks like mouse gets passive state and waits for receiver connection after connect button. 0) run hcidump -w mouse.dump as root 1) make sure bthidd(8) is NOT running 2) reset the mouse (press reset button or disconnect batteries for a few seconds) 3) use bthidcontrol(8) to query the mouse 4) put output of the bthidcontrol(8) in the /etc/bluetooth/bthidd.conf 5) make sure mouse bd_addr IS *NOT* in the /var/db/bthidd.hids 6) (OPTIONAL) *if* your mouse requests authentication then edit /etc/bluetooth/hcsecd.conf file and add pin code or link key. the pin code can be obtained from the mouse documentation. after that run hcsecd(8) 7) start bthidd(8) if you did everything right the mouse should work. NOTE: the mouse will shutdown itself after some period of inactivity. to bring it back just move it and/or press the buttons. you do *NOT* need to fiddle with bthidd(8) and or bthidcontrol(8) anymore. if you done everything above and it still does not work then send me hcidump output. NOTE: if your have reset your mouse or replaced batteries you all you need to do is: use 'bthidcontrol forget' command and restart bthidd(8). > Mouse works Ok under winXP with onboard bt. > (Is there way with hcidump "listen" traffic between XP and mouse to get clue ?) bluetooth is a point-to-point link. i do not know a way to put bluetooth device in promiscuous mode, and, thus sniff traffic between another pair of devices. > If mouse already connected with USB receiver it do not answer even on l2ping. see above thanks, max