From owner-freebsd-bluetooth@FreeBSD.ORG Thu Jul 1 10:50:59 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 3C48A16A4CE for ; Thu, 1 Jul 2004 10:50:59 +0000 (GMT) Received: from gvr.gvr.org (gvr-gw.gvr.org [80.126.103.228]) by mx1.FreeBSD.org (Postfix) with ESMTP id A63A043D3F for ; Thu, 1 Jul 2004 10:50:58 +0000 (GMT) (envelope-from guido@gvr.org) Received: by gvr.gvr.org (Postfix, from userid 657) id B9A3F60; Thu, 1 Jul 2004 12:49:06 +0200 (CEST) Date: Thu, 1 Jul 2004 12:49:06 +0200 From: Guido van Rooij To: freebsd-bluetooth@freebsd.org Message-ID: <20040701104906.GA55892@gvr.gvr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: problem pairing with a Sony-Ericsson T610 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: Thu, 01 Jul 2004 10:50:59 -0000 The subject says it all. I have the following in hcsecd.conf: device { bdaddr 00:0e:07:46:b5:c4; name "Gonz"; key nokey; pin "5449"; } with hcccpontrol I see: beck# hccontrol -n ubt0hci inquiry Inquiry result, num_responses=1 Inquiry result #0 BD_ADDR: 00:0e:07:46:b5:c4 Page Scan Rep. Mode: 0x1 Page Scan Period Mode: 00 Page Scan Mode: 00 Class: 52:02:04 Clock offset: 0x1013 Inquiry complete. Status: No error [00] I can create connections with hccontrol: beck# hccontrol -n ubt0hci Create_Connection 00:0e:07:46:b5:c4 BD_ADDR: 00:0e:07:46:b5:c4 Connection handle: 41 Encryption mode: Disabled [0] beck# hccontrol -n ubt0hci read_connection_list Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State 00:0e:07:46:b5:c4 41 ACL 0 MAST NONE 0 0 OPEN beck# hccontrol -n ubt0hci disconnect 41 Connection handle: 41 Reason: Connection terminated by local host [0x16] When I try to pair with hcsecd running (with -d, and a small patch that shows if it receives anything at all in the recvfrom() call), I don't see anything at all. During the pairing attempt, hcidump shows: > HCI Event: Connect Request(0x04) plen 10 < HCI Command: Accept Connection Request(0x01|0x0009) plen 7 > HCI Event: Command Status(0x0f) plen 4 > HCI Event: Connect Complete(0x03) plen 11 and then the mobile phone says that the connection failed. The system I use is 5.2.1-RELEASE-p4. Relevant output: dmesg: ubt0: vendor 0x413c product 0x8000, rev 1.10/5.65, addr 2 ubt0: Interface 0 endpoints: interrupt=0x81, bulk-in=0x82, bulk-out=0x2 ubt0: Interface 1 (alt.config 5) endpoints: isoc-in=0x83, isoc-out=0x3; wMaxPacketSize=49; nframes=6, buffer size=294 rc.bluetooth start ubt0: BD_ADDR: 00:10:c6:1d:33:d9 Features: 0xff 0xff 0xf 00 00 00 00 00 <3-Slot> <5-Slot> Max. ACL packet size: 192 bytes Number of ACL packets: 8 Max. SCO packet size: 64 bytes Number of SCO packets: 8 Any help on how to proceed is highly appreciated. -Guido From owner-freebsd-bluetooth@FreeBSD.ORG Thu Jul 1 18:29: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 621D116A4CF for ; Thu, 1 Jul 2004 18:29:21 +0000 (GMT) Received: from mproxy.gmail.com (mproxy.gmail.com [216.239.56.248]) by mx1.FreeBSD.org (Postfix) with SMTP id 48AC143D4C for ; Thu, 1 Jul 2004 18:29:21 +0000 (GMT) (envelope-from maksim.yevmenkin@gmail.com) Received: by mproxy.gmail.com with SMTP id w29so3152955cwb for ; Thu, 01 Jul 2004 11:28:16 -0700 (PDT) Received: by 10.11.99.23 with SMTP id w23mr125781cwb; Thu, 01 Jul 2004 11:21:36 -0700 (PDT) Message-ID: Date: Thu, 1 Jul 2004 11:21:36 -0700 From: Maksim Yevmenkin To: Guido van Rooij , freebsd-bluetooth@freebsd.org In-Reply-To: <40E451EE.7090601@cw.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <40E451EE.7090601@cw.com> Subject: Re: problem pairing with a Sony-Ericsson T610 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: Thu, 01 Jul 2004 18:29:21 -0000 Hello > I have the following in hcsecd.conf: > device { > bdaddr 00:0e:07:46:b5:c4; > name "Gonz"; > key nokey; > pin "5449"; > } looks fine > with hcccpontrol I see: > beck# hccontrol -n ubt0hci inquiry > Inquiry result, num_responses=1 > Inquiry result #0 > BD_ADDR: 00:0e:07:46:b5:c4 > Page Scan Rep. Mode: 0x1 > Page Scan Period Mode: 00 > Page Scan Mode: 00 > Class: 52:02:04 > Clock offset: 0x1013 > Inquiry complete. Status: No error [00] looks fine too > I can create connections with hccontrol: > beck# hccontrol -n ubt0hci Create_Connection 00:0e:07:46:b5:c4 > BD_ADDR: 00:0e:07:46:b5:c4 > Connection handle: 41 > Encryption mode: Disabled [0] > beck# hccontrol -n ubt0hci read_connection_list > Remote BD_ADDR Handle Type Mode Role Encrypt Pending Queue State > 00:0e:07:46:b5:c4 41 ACL 0 MAST NONE 0 0 OPEN > beck# hccontrol -n ubt0hci disconnect 41 > Connection handle: 41 > Reason: Connection terminated by local host [0x16] you do not have to do it but it looks fine anyway :) > When I try to pair with hcsecd running (with -d, and a small patch that > shows if it receives anything at all in the recvfrom() call), I don't > see anything at all. you won't see anything unless there is link key/pin code request > During the pairing attempt, hcidump shows: > > HCI Event: Connect Request(0x04) plen 10 > < HCI Command: Accept Connection Request(0x01|0x0009) plen 7 > > HCI Event: Command Status(0x0f) plen 4 > > HCI Event: Connect Complete(0x03) plen 11 hcidump -x would be more useful :) but it looks like you are trying to initiate connection from the phone, right? by default freebsd will accept any connection without authentication. if you really want to make freebsd authenticate incoming connections then you need to # hccontrol -n ubt0hci write_authentication_enable 1 on the other hand you might pair devices by initiating connection to the phone, i.e. for example try to use obexapp(1) to get phone book. the very first time phone asks if you want to add device to the trusted list. that is how i do it on my t68i. and if i need to push data from my phone to pc i just push it. i do not need to pair devices because freebsd does not ask for it. > and then the mobile phone says that the connection failed. well, it is hard to say its really "failed" because i can not tell what status was returned in "Connect Complete" event. next time please use 'hcidump -x'. you also might need to # hccontrol -n ubt0hci write_node_role_switch 0 if your phone does not support role switch, see "troubleshooting" section at http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-bluetooth.html thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Fri Jul 2 09:25:06 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 7D5E816A4CE for ; Fri, 2 Jul 2004 09:25:06 +0000 (GMT) Received: from gvr.gvr.org (gvr-gw.gvr.org [80.126.103.228]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF28943D31 for ; Fri, 2 Jul 2004 09:25:05 +0000 (GMT) (envelope-from guido@gvr.org) Received: by gvr.gvr.org (Postfix, from userid 657) id 09FA150; Fri, 2 Jul 2004 11:23:50 +0200 (CEST) Date: Fri, 2 Jul 2004 11:23:49 +0200 From: Guido van Rooij To: Maksim Yevmenkin Message-ID: <20040702092349.GA70090@gvr.gvr.org> References: <40E451EE.7090601@cw.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-bluetooth@freebsd.org Subject: Re: problem pairing with a Sony-Ericsson T610 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: Fri, 02 Jul 2004 09:25:06 -0000 On Thu, Jul 01, 2004 at 11:21:36AM -0700, Maksim Yevmenkin wrote: > > > During the pairing attempt, hcidump shows: > > > HCI Event: Connect Request(0x04) plen 10 > > < HCI Command: Accept Connection Request(0x01|0x0009) plen 7 > > > HCI Event: Command Status(0x0f) plen 4 > > > HCI Event: Connect Complete(0x03) plen 11 > > hcidump -x would be more useful :) but it looks like you are trying to > initiate connection from > the phone, right? by default freebsd will accept any connection Yep. > without authentication. if you > really want to make freebsd authenticate incoming connections then you need to > > # hccontrol -n ubt0hci write_authentication_enable 1 Before issuing this command I got: beck# ./hcidump -x HCIDump - HCI packet analyzer ver 1.5 device: any snap_len: 65535 filter: 0xffffffff > HCI Event: Connect Request(0x04) plen 10 C4 B5 46 07 0E 00 04 02 52 01 < HCI Command: Accept Connection Request(0x01|0x0009) plen 7 C4 B5 46 07 0E 00 00 > HCI Event: Command Status(0x0f) plen 4 00 01 09 04 > HCI Event: Connect Complete(0x03) plen 11 1A 29 00 C4 B5 46 07 0E 00 01 00 then: < HCI Command: Write Authentication Enable(0x03|0x0020) plen 1 01 > HCI Event: Command Complete(0x0e) plen 4 01 20 0C 00 and after a new attempt: > HCI Event: Connect Request(0x04) plen 10 C4 B5 46 07 0E 00 04 02 52 01 < HCI Command: Accept Connection Request(0x01|0x0009) plen 7 C4 B5 46 07 0E 00 00 > HCI Event: Command Status(0x0f) plen 4 00 01 09 04 > HCI Event: Connect Complete(0x03) plen 11 1A 29 00 C4 B5 46 07 0E 00 01 00 > > on the other hand you might pair devices by initiating connection to > the phone, i.e. for example try to use obexapp(1) to get phone book. > the very first time phone asks if you want to add device to the > trusted list. that is how i do it on my t68i. and if i need to push > data from my phone to pc i just push it. i do not need to pair devices > because freebsd does not ask for it. I am trying to create a situation where my FreeBSD systems starts executing certain commands when the mobile is in range. I think it is more handy that the mobile initiates the connection. > > > and then the mobile phone says that the connection failed. > > well, it is hard to say its really "failed" because i can not tell > what status was returned in "Connect Complete" event. next time please > use 'hcidump -x'. > > you also might need to > > # hccontrol -n ubt0hci write_node_role_switch 0 > > if your phone does not support role switch, see "troubleshooting" section at > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-bluetooth.html Bingo! That's it! Thanks a lot! -Guido From owner-freebsd-bluetooth@FreeBSD.ORG Fri Jul 2 09:28:26 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 0EDA216A4CE for ; Fri, 2 Jul 2004 09:28:26 +0000 (GMT) Received: from gvr.gvr.org (gvr-gw.gvr.org [80.126.103.228]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB9FF43D41 for ; Fri, 2 Jul 2004 09:28:25 +0000 (GMT) (envelope-from guido@gvr.org) Received: by gvr.gvr.org (Postfix, from userid 657) id A1A6750; Fri, 2 Jul 2004 11:26:53 +0200 (CEST) Date: Fri, 2 Jul 2004 11:26:53 +0200 From: Guido van Rooij To: Maksim Yevmenkin Message-ID: <20040702092653.GA70378@gvr.gvr.org> References: <40E451EE.7090601@cw.com> <20040702092349.GA70090@gvr.gvr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040702092349.GA70090@gvr.gvr.org> cc: freebsd-bluetooth@freebsd.org Subject: Re: problem pairing with a Sony-Ericsson T610 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: Fri, 02 Jul 2004 09:28:26 -0000 On Fri, Jul 02, 2004 at 11:23:49AM +0200, Guido van Rooij wrote: > I am trying to create a situation where my FreeBSD systems starts executing > certain commands when the mobile is in range. I think it is more handy > that the mobile initiates the connection. Hmm. It seems there is no 'device out of range' event. Is that correct? -Guido From owner-freebsd-bluetooth@FreeBSD.ORG Fri Jul 2 16:24:37 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 9F43A16A4E0 for ; Fri, 2 Jul 2004 16:24:37 +0000 (GMT) Received: from mproxy.gmail.com (mproxy.gmail.com [216.239.56.252]) by mx1.FreeBSD.org (Postfix) with SMTP id 69C3943D45 for ; Fri, 2 Jul 2004 16:24:37 +0000 (GMT) (envelope-from maksim.yevmenkin@gmail.com) Received: by mproxy.gmail.com with SMTP id w29so4307695cwb for ; Fri, 02 Jul 2004 09:23:06 -0700 (PDT) Received: by 10.11.116.64 with SMTP id o64mr89043cwc; Fri, 02 Jul 2004 09:16:26 -0700 (PDT) Message-ID: Date: Fri, 2 Jul 2004 09:16:26 -0700 From: Maksim Yevmenkin To: Guido van Rooij In-Reply-To: <20040702092653.GA70378@gvr.gvr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <40E451EE.7090601@cw.com> <20040702092349.GA70090@gvr.gvr.org> <20040702092653.GA70378@gvr.gvr.org> cc: freebsd-bluetooth@freebsd.org Subject: Re: problem pairing with a Sony-Ericsson T610 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: Fri, 02 Jul 2004 16:24:37 -0000 Hello Guido, [...] > > I am trying to create a situation where my FreeBSD systems starts executing > > certain commands when the mobile is in range. I think it is more handy > > that the mobile initiates the connection. > > Hmm. > It seems there is no 'device out of range' event. Is that correct? no, there is not. when device goes out of range, all active connections to the device are terminated by the link manager (firmware). the host (pc) just gets notification on connection termination. thanks, max