From owner-freebsd-bluetooth@FreeBSD.ORG Mon Dec 20 19:41:21 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 B68E216A4CE for ; Mon, 20 Dec 2004 19:41:21 +0000 (GMT) Received: from mailgate1b.savvis.net (mailgate1b.savvis.net [216.91.182.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C86F43D2D for ; Mon, 20 Dec 2004 19:41:21 +0000 (GMT) (envelope-from Maksim.Yevmenkin@savvis.net) Received: from out001.email.savvis.net (out001.apptix.savvis.net [216.91.32.44])iBKJegfX027251; Mon, 20 Dec 2004 13:40:42 -0600 Received: from s228130hz1ew17.apptix-01.savvis.net ([10.146.4.29]) by out001.email.savvis.net with Microsoft SMTPSVC(6.0.3790.211); Mon, 20 Dec 2004 13:40:21 -0600 Received: from [10.254.186.111] ([66.35.239.94]) by s228130hz1ew17.apptix-01.savvis.net with Microsoft SMTPSVC(6.0.3790.211); Mon, 20 Dec 2004 13:40:08 -0600 Message-ID: <41C72A9B.6090405@savvis.net> Date: Mon, 20 Dec 2004 11:40:11 -0800 From: Maksim Yevmenkin User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040822 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> <41C63A62.20304@savvis.net> <1103527349.1024.18.camel@localhost> In-Reply-To: <1103527349.1024.18.camel@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Dec 2004 19:40:09.0066 (UTC) FILETIME=[B6AB84A0:01C4E6CB] X-ECS-MailScanner: No virus is found 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 19:41:21 -0000 Vladimir, >>> # 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). > > Yes, I did. I've edited it while tried to make mouse works. you should not edit this file by hand. >>> 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. > > I see. good. >> 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) > > looks like it does not require key or pin, also winXP connects only > without pin. how can you tell? the pin code may be hardwired somewhere in the windows registry. did windows software prompt you for anything during install? can you check all the documentation that came with the mouse to see if there is a pin code? Arne: could you please tell us what did you do to make your mouse work? >> 7) start bthidd(8) >> >> if you did everything right the mouse should work. > > Still no luck, but this time there is attempt to connect from host to > mouse on bthidd start: > > # bthidd -d bthidd[1398]: Opening outbound session for > 00:07:61:17:9b:27 (new_device=1, reconnect_initiate=1) bthidd[1398]: > Could not connect to 00:07:61:17:9b:27. Socket is not connected (57) that the way it should work. > There hcidump output while bthidd connection attempt # hcidump -r > mouse.dump HCIDump - HCI packet analyzer ver 1.5 [...] 1103525841.696334 < ACL data: handle 0x002a flags 0x02 dlen 12 L2CAP(s): Connect req: psm 17 scid 0x0060 here host is trying to open hid-control channel (psm 17 (0x11)) 1103525841.738294 > ACL data: handle 0x002a flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x005c scid 0x0060 result 1 status 2 1103525841.772308 > ACL data: handle 0x002a flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0000 scid 0x0060 result 2 status 0 and these are mouse responses. the first response returns with result code 1 (Connection Pending) and status code 2 (Authorization Pending). the second response is with result code 2 (PSM Not Supported) and status code 0 (No Information). note timestamps - responses are only 34 msec apart - not much time. so it looks like the mouse does not like the host. are you using different bluetooth adapters on your freebsd and winxp boxes? if so, can you try and use winxp adapter on your freebsd box? also did you check the manual to find out what is the correct reset procedure for the mouse? > also, after hardware reset by batteries, /var/db/bthidd.hids get > address of mouse, but do not write anything new to output and mouse > still does not work. ok > bthidd[1610]: Opening outbound session for 00:07:61:17:9b:27 > (new_device=1, reconnect_initiate=1) bthidd[1610]: Could not connect > to 00:07:61:17:9b:27. Socket is not connected (57) > > hcidump while this is: < ACL data: handle 0x0029 flags 0x02 dlen 12 L2CAP(s): Connect req: psm 17 scid 0x006d again host is trying to open hid-control channel > ACL data: handle 0x0029 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0042 scid 0x006d result 1 status 2 > ACL data: handle 0x0029 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0042 scid 0x006d result 0 status 0 whoa! this time it has opened hid-control channel. lets see what happens next... < ACL data: handle 0x0029 flags 0x02 dlen 12 L2CAP(s): Config req: dcid 0x0042 flags 0x0000 clen 0 > ACL data: handle 0x0029 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x006d flags 0x0000 result 0 clen 0 here host configures its side of the l2cap channel (hid control) and mouse accepts it. > ACL data: handle 0x0029 flags 0x01 dlen 13 L2CAP(s): Config req: dcid 0x006d flags 0x0000 clen 28 MTU 48 Unknown (type 03, len 22) < ACL data: handle 0x0029 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0042 flags 0x0000 result 0 clen 0 here mouse configures its side of the l2cap channel (hid control), sets mtu and qos. (ignore Unknown - hcidump does not know how to parse qos option). host accepts it. so far everything looks fine to me. after this point hid control channel should be opened and configured. the next step is to open hid interrupt channel. < ACL data: handle 0x0029 flags 0x02 dlen 12 L2CAP(s): Connect req: psm 25 scid 0x006e > ACL data: handle 0x0029 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0000 scid 0x006e result 2 status 0 ok, this does not make any sense. psm 25 ?! why the hell it tries to connect to psm 25? of course mouse tells host to get lost, because it does not want to talk on psm 25. wait, i know why. i just checked your older email and find out that you have "interrupt_psm 0x19;" line in your /etc/bluetooth/bthidd.conf file (mouse section). could you please try to change it to "interrupt_psm 0x13;" then do the following: 0) run 'hcidump -w mouse.dump' as root 1) remove mouse bd_addr from /var/db/bthidd.hids file 2) disconnect and reconnect batteries on your mouse 3) press 'connect' button on your mouse 4) restart bthidd(8) > It happens when I disconnect/connect batteries and then press connect > button. > > Even after that mouse does not moved. if I restart bthidd - it does > not connects and mouse does not send any traffic. it will not move - you do not have hid session, that is you need to open both hid control and hid interrupt channels. if the above works then there is a problem with 1) bthidcontrol(8) - because it has incorrectly parsed sdp response and showed wrong psm for the hid interrupt channel. that is what you put into the /etc/bluetooth/bthidd.conf file (unless of course you hand-edited it as well) or 2) mouse itself. it advertises wrong psm for the hid interrupt channel. thanks, max