From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 06:14:46 2009 Return-Path: Delivered-To: bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 341FF1065676 for ; Sun, 27 Dec 2009 06:14:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D55E08FC0C for ; Sun, 27 Dec 2009 06:14:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBR6EiBf017156 for ; Sat, 26 Dec 2009 23:14:44 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 26 Dec 2009 23:15:14 -0700 (MST) Message-Id: <20091226.231514.519459540419527384.imp@bsdimp.com> To: bluetooth@freebsd.org From: "M. Warner Losh" X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 06:14:46 -0000 OK. I must be pathologically dense... I've tried to get my apple mini keyboard working with my machine. I'm so close. I'm getting the following messages on the console: kbd2 at vkbd16 kbd2 at vkbd17 kbd2 at vkbd18 kbd2 at vkbd19 kbd2 at vkbd20 kbd2 at vkbd21 kbd2 at vkbd22 kbd2 at vkbd23 kbd2 at vkbd24 but don't know what to do next. Typing on the keyboard doesn't do a dang thing. Oh, while typing this message, I have a few more: kbd2 at vkbd25 kbd2 at vkbd26 kbd2 at vkbd27 kbd2 at vkbd28 kbd2 at vkbd29 What's up? Warner From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 06:38:22 2009 Return-Path: Delivered-To: bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39B621065672 for ; Sun, 27 Dec 2009 06:38:22 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D33D48FC13 for ; Sun, 27 Dec 2009 06:38:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBR6VaxQ017273 for ; Sat, 26 Dec 2009 23:31:36 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 26 Dec 2009 23:32:06 -0700 (MST) Message-Id: <20091226.233206.999284355998308258.imp@bsdimp.com> To: bluetooth@freebsd.org From: "M. Warner Losh" In-Reply-To: <20091226.231514.519459540419527384.imp@bsdimp.com> References: <20091226.231514.519459540419527384.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 06:38:22 -0000 In message: <20091226.231514.519459540419527384.imp@bsdimp.com> M. Warner Losh writes: : OK. I must be pathologically dense... : : I've tried to get my apple mini keyboard working with my machine. I'm : so close. I'm getting the following messages on the console: : : kbd2 at vkbd16 : kbd2 at vkbd17 : kbd2 at vkbd18 : kbd2 at vkbd19 : kbd2 at vkbd20 : kbd2 at vkbd21 : kbd2 at vkbd22 : kbd2 at vkbd23 : kbd2 at vkbd24 : : but don't know what to do next. Typing on the keyboard doesn't do a : dang thing. Oh, while typing this message, I have a few more: : : kbd2 at vkbd25 : kbd2 at vkbd26 : kbd2 at vkbd27 : kbd2 at vkbd28 : kbd2 at vkbd29 : : What's up? /var/log/messages is telling me: Dec 26 23:29:02 lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:ce:b1 (new_device=1, reconnect_initiate=1) Dec 26 23:29:02 lighthouse kernel: kbd2 at vkbd68 Dec 26 23:29:07 lighthouse bthidd[638]: Could not connect to 00:1d:4f:a6:ce:b1. Host is down (64) Dec 26 23:29:15 lighthouse sudo: imp : TTY=pts/0 ; PWD=/hp/imp ; USER=root ; COMMAND=/usr/bin/vi /etc/bluetooth/hcsecd.conf Dec 26 23:29:22 lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:ce:b1 (new_device=1, reconnect_initiate=1) Dec 26 23:29:22 lighthouse kernel: kbd2 at vkbd69 Dec 26 23:29:37 lighthouse sudo: imp : TTY=pts/0 ; PWD=/hp/imp ; USER=root ; COMMAND=/usr/bin/killall hcsecd Dec 26 23:29:37 lighthouse hcsecd[1559]: Could not remove PID file /var/run/hcsecd.pid. No such file or directory (2) Dec 26 23:29:46 lighthouse sudo: imp : TTY=pts/0 ; PWD=/hp/imp ; USER=root ; COMMAND=/usr/sbin/hcsecd -f /etc/bluetooth/hcsecd.conf Dec 26 23:30:34 lighthouse wpa_supplicant[1209]: CTRL-EVENT-SCAN-RESULTS Dec 26 23:30:44 lighthouse bthidd[638]: Could not connect to 00:1d:4f:a6:ce:b1. Operation timed out (60) Dec 26 23:31:02 lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:ce:b1 (new_device=1, reconnect_initiate=1) Dec 26 23:31:02 lighthouse kernel: kbd2 at vkbd70 Dec 26 23:31:07 lighthouse bthidd[638]: Could not connect to 00:1d:4f:a6:ce:b1. Host is down (64) Dec 26 23:31:22 lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:ce:b1 (new_device=1, reconnect_initiate=1) Dec 26 23:31:22 lighthouse kernel: kbd2 at vkbd71 Dec 26 23:31:27 lighthouse bthidd[638]: Could not connect to 00:1d:4f:a6:ce:b1. Host is down (64) how can I know if I've properly authenticated? Warner From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 06:57:24 2009 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D98E1065670 for ; Sun, 27 Dec 2009 06:57:24 +0000 (UTC) (envelope-from freebsd-bluetooth@dino.sk) Received: from loki.netlab.sk (ns3.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id BD6BC8FC14 for ; Sun, 27 Dec 2009 06:57:23 +0000 (UTC) Received: from via.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: PLAIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by loki.netlab.sk with esmtp; Sun, 27 Dec 2009 07:44:21 +0100 id 0002E0D4.4B370245.00001984 From: Milan Obuch To: freebsd-bluetooth@freebsd.org Date: Sun, 27 Dec 2009 07:46:58 +0100 User-Agent: KMail/1.9.10 References: <20091226.231514.519459540419527384.imp@bsdimp.com> In-Reply-To: <20091226.231514.519459540419527384.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200912270746.59264.freebsd-bluetooth@dino.sk> Cc: "M. Warner Losh" Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 06:57:24 -0000 On Sunday 27 December 2009 07:15:14 M. Warner Losh wrote: > OK. I must be pathologically dense... > > I've tried to get my apple mini keyboard working with my machine. I'm > so close. I'm getting the following messages on the console: > > kbd2 at vkbd16 > kbd2 at vkbd17 > kbd2 at vkbd18 > kbd2 at vkbd19 > kbd2 at vkbd20 > kbd2 at vkbd21 > kbd2 at vkbd22 > kbd2 at vkbd23 > kbd2 at vkbd24 > > but don't know what to do next. Typing on the keyboard doesn't do a > dang thing. Oh, while typing this message, I have a few more: > > kbd2 at vkbd25 > kbd2 at vkbd26 > kbd2 at vkbd27 > kbd2 at vkbd28 > kbd2 at vkbd29 > > What's up? > > Warner > Could you describe what you did to get this far? In my case, I have a Logitech Cordless MediaBoard Pro keyboard (details could be found at http://www.logitech.com/index.cfm/gaming/playstation_3/keyboards/devices/3616&cl=za,en). I see similar behavior, but only in connection with keyboard being switched off and on. I did report this problem here at 08:46, 22.05.2009, but no response. This does not help you probably, but you are not alone, at least :) I can try it again, if it works for me, still - I did at least in 7.2 then. Regards, Milan From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 07:01:07 2009 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BE6B1065670 for ; Sun, 27 Dec 2009 07:01:07 +0000 (UTC) (envelope-from freebsd-bluetooth@dino.sk) Received: from loki.netlab.sk (loki.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id 115468FC0A for ; Sun, 27 Dec 2009 07:01:06 +0000 (UTC) Received: from via.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: PLAIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by loki.netlab.sk with esmtp; Sun, 27 Dec 2009 07:48:07 +0100 id 0002E0CF.4B370327.000019AB From: Milan Obuch To: freebsd-bluetooth@freebsd.org Date: Sun, 27 Dec 2009 07:50:49 +0100 User-Agent: KMail/1.9.10 References: <20091226.231514.519459540419527384.imp@bsdimp.com> <20091226.233206.999284355998308258.imp@bsdimp.com> In-Reply-To: <20091226.233206.999284355998308258.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200912270750.49578.freebsd-bluetooth@dino.sk> Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 07:01:07 -0000 On Sunday 27 December 2009 07:32:06 M. Warner Losh wrote: > In message: <20091226.231514.519459540419527384.imp@bsdimp.com> > > M. Warner Losh writes: > : OK. I must be pathologically dense... > : > : I've tried to get my apple mini keyboard working with my machine. I'm > : so close. I'm getting the following messages on the console: > : > : kbd2 at vkbd16 > : kbd2 at vkbd17 [ snip ] > > /var/log/messages is telling me: > > Dec 26 23:29:02 lighthouse bthidd[638]: Opening outbound session for > 00:1d:4f:a6:ce:b1 (new_device=1, reconnect_initiate=1) Dec 26 23:29:02 > lighthouse kernel: kbd2 at vkbd68 > Dec 26 23:29:07 lighthouse bthidd[638]: Could not connect to > 00:1d:4f:a6:ce:b1. Host is down (64) Dec 26 23:29:15 lighthouse sudo: > imp : TTY=pts/0 ; PWD=/hp/imp ; USER=root ; COMMAND=/usr/bin/vi > /etc/bluetooth/hcsecd.conf Dec 26 23:29:22 lighthouse bthidd[638]: Opening > outbound session for 00:1d:4f:a6:ce:b1 (new_device=1, reconnect_initiate=1) > Dec 26 23:29:22 lighthouse kernel: kbd2 at vkbd69 > Dec 26 23:29:37 lighthouse sudo: imp : TTY=pts/0 ; PWD=/hp/imp ; > USER=root ; COMMAND=/usr/bin/killall hcsecd Dec 26 23:29:37 lighthouse > hcsecd[1559]: Could not remove PID file /var/run/hcsecd.pid. No such file > or directory (2) Dec 26 23:29:46 lighthouse sudo: imp : TTY=pts/0 ; > PWD=/hp/imp ; USER=root ; COMMAND=/usr/sbin/hcsecd -f > /etc/bluetooth/hcsecd.conf Dec 26 23:30:34 lighthouse wpa_supplicant[1209]: > CTRL-EVENT-SCAN-RESULTS Dec 26 23:30:44 lighthouse bthidd[638]: Could not > connect to 00:1d:4f:a6:ce:b1. Operation timed out (60) Dec 26 23:31:02 > lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:ce:b1 > (new_device=1, reconnect_initiate=1) Dec 26 23:31:02 lighthouse kernel: > kbd2 at vkbd70 > Dec 26 23:31:07 lighthouse bthidd[638]: Could not connect to > 00:1d:4f:a6:ce:b1. Host is down (64) Dec 26 23:31:22 lighthouse > bthidd[638]: Opening outbound session for 00:1d:4f:a6:ce:b1 (new_device=1, > reconnect_initiate=1) Dec 26 23:31:22 lighthouse kernel: kbd2 at vkbd71 > Dec 26 23:31:27 lighthouse bthidd[638]: Could not connect to > 00:1d:4f:a6:ce:b1. Host is down (64) > > how can I know if I've properly authenticated? > > Warner > Could you try pairing under The other OS :) eventually? I am not sure, but I tested my keyboard this way first, it worked, then I follow with FreeBSD tests. Milan From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 07:55:55 2009 Return-Path: Delivered-To: freebsd-bluetooth@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E7721065676 for ; Sun, 27 Dec 2009 07:55:55 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D29158FC12 for ; Sun, 27 Dec 2009 07:55:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBR7nNZT017743; Sun, 27 Dec 2009 00:49:24 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 27 Dec 2009 00:49:54 -0700 (MST) Message-Id: <20091227.004954.119882392218644339.imp@bsdimp.com> To: freebsd-bluetooth@dino.sk From: "M. Warner Losh" In-Reply-To: <200912270746.59264.freebsd-bluetooth@dino.sk> References: <20091226.231514.519459540419527384.imp@bsdimp.com> <200912270746.59264.freebsd-bluetooth@dino.sk> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@FreeBSD.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 07:55:55 -0000 In message: <200912270746.59264.freebsd-bluetooth@dino.sk> Milan Obuch writes: : On Sunday 27 December 2009 07:15:14 M. Warner Losh wrote: : > OK. I must be pathologically dense... : > : > I've tried to get my apple mini keyboard working with my machine. I'm : > so close. I'm getting the following messages on the console: : > : > kbd2 at vkbd16 : > kbd2 at vkbd17 : > kbd2 at vkbd18 : > kbd2 at vkbd19 : > kbd2 at vkbd20 : > kbd2 at vkbd21 : > kbd2 at vkbd22 : > kbd2 at vkbd23 : > kbd2 at vkbd24 : > : > but don't know what to do next. Typing on the keyboard doesn't do a : > dang thing. Oh, while typing this message, I have a few more: : > : > kbd2 at vkbd25 : > kbd2 at vkbd26 : > kbd2 at vkbd27 : > kbd2 at vkbd28 : > kbd2 at vkbd29 : > : > What's up? : > : > Warner : > : : Could you describe what you did to get this far? In my case, I have a Logitech : Cordless MediaBoard Pro keyboard (details could be found at : http://www.logitech.com/index.cfm/gaming/playstation_3/keyboards/devices/3616&cl=za,en). : : I see similar behavior, but only in connection with keyboard being switched : off and on. I did report this problem here at 08:46, 22.05.2009, but no : response. : : This does not help you probably, but you are not alone, at least :) I can try : it again, if it works for me, still - I did at least in 7.2 then. Here's a thumbnail: Added my device to /etc/bluetooth/hosts: 00:1d:4f:a6:c0:ed mac-kbd Added entries to bthidd.conf generated by the "bthidcontrol -a mac-kbd query" command: device { bdaddr 00:1d:4f:a6:c0:ed; control_psm 0x11; interrupt_psm 0x13; reconnect_initiate true; battery_power false; normally_connectable true; hid_descriptor { 0x05 0x01 0x09 0x06 0xa1 0x01 0x85 0x01 0x05 0x07 0x19 0xe0 0x29 0xe7 0x15 0x00 0x25 0x01 0x75 0x01 0x95 0x08 0x81 0x02 0x75 0x08 0x95 0x01 0x81 0x01 0x75 0x01 0x95 0x05 0x05 0x08 0x19 0x01 0x29 0x05 0x91 0x02 0x75 0x03 0x95 0x01 0x91 0x01 0x75 0x08 0x95 0x06 0x15 0x00 0x26 0xff 0x00 0x05 0x07 0x19 0x00 0x2a 0xff 0x00 0x81 0x00 0xc0 0x05 0x0c 0x09 0x01 0xa1 0x01 0x85 0x47 0x05 0x01 0x09 0x06 0xa1 0x02 0x05 0x06 0x09 0x20 0x15 0x00 0x26 0xff 0x00 0x75 0x08 0x95 0x01 0x81 0x02 0xc0 0xc0 0x05 0x0c 0x09 0x01 0xa1 0x01 0x85 0x11 0x15 0x00 0x25 0x01 0x75 0x01 0x95 0x03 0x81 0x01 0x75 0x01 0x95 0x01 0x05 0x0c 0x09 0xb8 0x81 0x02 0x06 0xff 0x00 0x09 0x03 0x81 0x02 0x75 0x01 0x95 0x03 0x81 0x01 0x05 0x0c 0x85 0x12 0x15 0x00 0x25 0x01 0x75 0x01 0x95 0x01 0x09 0xcd 0x81 0x02 0x09 0xb3 0x81 0x02 0x09 0xb4 0x81 0x02 0x09 0xb5 0x81 0x02 0x09 0xb6 0x81 0x02 0x81 0x01 0x81 0x01 0x81 0x01 0x85 0x13 0x15 0x00 0x25 0x01 0x75 0x01 0x95 0x01 0x06 0x01 0xff 0x09 0x0a 0x81 0x02 0x75 0x01 0x95 0x07 0x81 0x01 0x85 0x09 0x09 0x0b 0x75 0x08 0x95 0x01 0xb1 0x02 0x75 0x08 0x95 0x02 0xb1 0x01 0xc0 }; } Added an entry to the hhcsecd.conf file: device { bdaddr 00:1d:4f:a6:c0:ed; name "Apple Kbd"; key nokey; pin "9876"; } and added the following to /etc/rc.conf: # # Bluetooth # hcsecd_enable=YES sdpd_enable=YES bthidd_enable=YES rebooted a few times. The error in the logs looks like: Dec 27 00:45:32 lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:c0:ed (new_device=1, reconnect_initiate=1) Dec 27 00:45:32 lighthouse kernel: kbd2 at vkbd289 Dec 27 00:45:37 lighthouse bthidd[638]: Could not connect to 00:1d:4f:a6:c0:ed. Host is down (64) Dec 27 00:45:52 lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:c0:ed (new_device=1, reconnect_initiate=1) Dec 27 00:45:52 lighthouse kernel: kbd2 at vkbd290 Dec 27 00:45:57 lighthouse bthidd[638]: Could not connect to 00:1d:4f:a6:c0:ed. Host is down (64) sure hope that vkbd290 isn't going to run me out of memory :) Sure wish there was a way to say "I'd like to know what I've paired with please"... Warner From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 08:02:32 2009 Return-Path: Delivered-To: freebsd-bluetooth@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EF5A1065679 for ; Sun, 27 Dec 2009 08:02:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E9B2C8FC1D for ; Sun, 27 Dec 2009 08:02:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBR7vRoM017801; Sun, 27 Dec 2009 00:57:27 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 27 Dec 2009 00:57:57 -0700 (MST) Message-Id: <20091227.005757.195066307562707339.imp@bsdimp.com> To: freebsd-bluetooth@dino.sk From: "M. Warner Losh" In-Reply-To: <20091227.004954.119882392218644339.imp@bsdimp.com> References: <20091226.231514.519459540419527384.imp@bsdimp.com> <200912270746.59264.freebsd-bluetooth@dino.sk> <20091227.004954.119882392218644339.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@FreeBSD.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 08:02:32 -0000 In message: <20091227.004954.119882392218644339.imp@bsdimp.com> M. Warner Losh writes: : In message: <200912270746.59264.freebsd-bluetooth@dino.sk> : Milan Obuch writes: : : On Sunday 27 December 2009 07:15:14 M. Warner Losh wrote: : : > OK. I must be pathologically dense... : : > : : > I've tried to get my apple mini keyboard working with my machine. I'm : : > so close. I'm getting the following messages on the console: : : > : : > kbd2 at vkbd16 : : > kbd2 at vkbd17 : : > kbd2 at vkbd18 : : > kbd2 at vkbd19 : : > kbd2 at vkbd20 : : > kbd2 at vkbd21 : : > kbd2 at vkbd22 : : > kbd2 at vkbd23 : : > kbd2 at vkbd24 : : > : : > but don't know what to do next. Typing on the keyboard doesn't do a : : > dang thing. Oh, while typing this message, I have a few more: : : > : : > kbd2 at vkbd25 : : > kbd2 at vkbd26 : : > kbd2 at vkbd27 : : > kbd2 at vkbd28 : : > kbd2 at vkbd29 : : > : : > What's up? : : > : : > Warner : : > : : : : Could you describe what you did to get this far? In my case, I have a Logitech : : Cordless MediaBoard Pro keyboard (details could be found at : : http://www.logitech.com/index.cfm/gaming/playstation_3/keyboards/devices/3616&cl=za,en). : : : : I see similar behavior, but only in connection with keyboard being switched : : off and on. I did report this problem here at 08:46, 22.05.2009, but no : : response. : : : : This does not help you probably, but you are not alone, at least :) I can try : : it again, if it works for me, still - I did at least in 7.2 then. : : Here's a thumbnail: : : Added my device to /etc/bluetooth/hosts: : : 00:1d:4f:a6:c0:ed mac-kbd : : Added entries to bthidd.conf generated by the "bthidcontrol -a mac-kbd : query" command: : : device { : bdaddr 00:1d:4f:a6:c0:ed; : control_psm 0x11; : interrupt_psm 0x13; : reconnect_initiate true; : battery_power false; : normally_connectable true; : hid_descriptor { : 0x05 0x01 0x09 0x06 0xa1 0x01 0x85 0x01 : 0x05 0x07 0x19 0xe0 0x29 0xe7 0x15 0x00 : 0x25 0x01 0x75 0x01 0x95 0x08 0x81 0x02 : 0x75 0x08 0x95 0x01 0x81 0x01 0x75 0x01 : 0x95 0x05 0x05 0x08 0x19 0x01 0x29 0x05 : 0x91 0x02 0x75 0x03 0x95 0x01 0x91 0x01 : 0x75 0x08 0x95 0x06 0x15 0x00 0x26 0xff : 0x00 0x05 0x07 0x19 0x00 0x2a 0xff 0x00 : 0x81 0x00 0xc0 0x05 0x0c 0x09 0x01 0xa1 : 0x01 0x85 0x47 0x05 0x01 0x09 0x06 0xa1 : 0x02 0x05 0x06 0x09 0x20 0x15 0x00 0x26 : 0xff 0x00 0x75 0x08 0x95 0x01 0x81 0x02 : 0xc0 0xc0 0x05 0x0c 0x09 0x01 0xa1 0x01 : 0x85 0x11 0x15 0x00 0x25 0x01 0x75 0x01 : 0x95 0x03 0x81 0x01 0x75 0x01 0x95 0x01 : 0x05 0x0c 0x09 0xb8 0x81 0x02 0x06 0xff : 0x00 0x09 0x03 0x81 0x02 0x75 0x01 0x95 : 0x03 0x81 0x01 0x05 0x0c 0x85 0x12 0x15 : 0x00 0x25 0x01 0x75 0x01 0x95 0x01 0x09 : 0xcd 0x81 0x02 0x09 0xb3 0x81 0x02 0x09 : 0xb4 0x81 0x02 0x09 0xb5 0x81 0x02 0x09 : 0xb6 0x81 0x02 0x81 0x01 0x81 0x01 0x81 : 0x01 0x85 0x13 0x15 0x00 0x25 0x01 0x75 : 0x01 0x95 0x01 0x06 0x01 0xff 0x09 0x0a : 0x81 0x02 0x75 0x01 0x95 0x07 0x81 0x01 : 0x85 0x09 0x09 0x0b 0x75 0x08 0x95 0x01 : 0xb1 0x02 0x75 0x08 0x95 0x02 0xb1 0x01 : 0xc0 : }; : } : : Added an entry to the hhcsecd.conf file: : : device { : bdaddr 00:1d:4f:a6:c0:ed; : name "Apple Kbd"; : key nokey; : pin "9876"; : } : : and added the following to /etc/rc.conf: : : # : # Bluetooth : # : hcsecd_enable=YES : sdpd_enable=YES : bthidd_enable=YES : : rebooted a few times. The error in the logs looks like: : : Dec 27 00:45:32 lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:c0:ed (new_device=1, reconnect_initiate=1) : Dec 27 00:45:32 lighthouse kernel: kbd2 at vkbd289 : Dec 27 00:45:37 lighthouse bthidd[638]: Could not connect to 00:1d:4f:a6:c0:ed. Host is down (64) : Dec 27 00:45:52 lighthouse bthidd[638]: Opening outbound session for 00:1d:4f:a6:c0:ed (new_device=1, reconnect_initiate=1) : Dec 27 00:45:52 lighthouse kernel: kbd2 at vkbd290 : Dec 27 00:45:57 lighthouse bthidd[638]: Could not connect to 00:1d:4f:a6:c0:ed. Host is down (64) : : sure hope that vkbd290 isn't going to run me out of memory :) : : Sure wish there was a way to say "I'd like to know what I've paired : with please"... : : Warner What finally made it work was stupidly simple... On my apple keyboard, I turned it on, typed 9 8 7 6 return and then things started working. I'm typing this right now from the keyboard. Now, I guess the next step would be to find the bt mouse I have and try to get it going as well... This is my second favorite keyboard ever. The happy hacking keyboard (usb edition) was my first. Third is the original happy hacking keyboard. I just like small keyboards, I guess, that aren't too small. Warner From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 17:36:10 2009 Return-Path: Delivered-To: freebsd-bluetooth@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84D291065670 for ; Sun, 27 Dec 2009 17:36:10 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smtp6.freeserve.com (smtp5.freeserve.com [193.252.22.151]) by mx1.freebsd.org (Postfix) with ESMTP id 1CFD58FC14 for ; Sun, 27 Dec 2009 17:36:09 +0000 (UTC) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3509.me.freeserve.com (SMTP Server) with ESMTP id 45D287000085; Sun, 27 Dec 2009 18:36:08 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3509.me.freeserve.com (SMTP Server) with ESMTP id 3945B7000083; Sun, 27 Dec 2009 18:36:08 +0100 (CET) Received: from rya-online.net (unknown [89.194.194.54]) by mwinf3509.me.freeserve.com (SMTP Server) with SMTP id 23A387000085; Sun, 27 Dec 2009 18:36:07 +0100 (CET) X-ME-UUID: 20091227173607146.23A387000085@mwinf3509.me.freeserve.com Received: (nullmailer pid 557 invoked by uid 1000); Sun, 27 Dec 2009 17:36:04 -0000 Date: Sun, 27 Dec 2009 17:36:04 +0000 (GMT) To: "M\. Warner Losh" In-Reply-To: <20091227.005757.195066307562707339.imp@bsdimp.com> References: <20091226.231514.519459540419527384.imp@bsdimp.com> <200912270746.59264.freebsd-bluetooth@dino.sk> <20091227.004954.119882392218644339.imp@bsdimp.com> <20091227.005757.195066307562707339.imp@bsdimp.com> User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1261935364.501662.751.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@FreeBSD.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 17:36:10 -0000 On Sun, 27 Dec 2009, M. Warner Losh wrote: > What finally made it work was stupidly simple... > > On my apple keyboard, I turned it on, typed 9 8 7 6 return and then > things started working. I'm typing this right now from the keyboard. Heh, I've been away but was just going to suggest that reading your mails.. btw a few words on security (though the scenario where somebody uses this information and tracks you down to interfere with your system seems pretty unlikely :) - now that you have posted the PIN you used and bdaddr of your device, you might want to re-pair with a different (more secure) PIN as I think the link key may be derivable - Not sure but I think that the keyboard will probably force auth and encryption when making connections. The FreeBSD stack does not have a way to do this except globally so unless you have the auth or encrypt flags set (see hccontrol(8)) then a remote device can break right in - IMO the PIN should be ephemeral and use-once so when you are paired you should remove it from the config file or at least comment it out > Now, I guess the next step would be to find the bt mouse I have and > try to get it going as well... that is probably fixed pin 0000 if not in the documentation > This is my second favorite keyboard ever. How is the keypress feel? I've not had a go on one of those, but I have an original apple bluetooth keyboard (white with clear undershell, full sized with num keypad) that works well though a smaller one might be interesting. iain From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 18:22:23 2009 Return-Path: Delivered-To: freebsd-bluetooth@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6E0D1065679 for ; Sun, 27 Dec 2009 18:22:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6BDE38FC1D for ; Sun, 27 Dec 2009 18:22:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBRIGecT025091; Sun, 27 Dec 2009 11:16:40 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 27 Dec 2009 11:17:11 -0700 (MST) Message-Id: <20091227.111711.287595822663154592.imp@bsdimp.com> To: plunky@rya-online.net From: "M. Warner Losh" In-Reply-To: <1261935364.501662.751.nullmailer@galant.ukfsn.org> References: <20091227.004954.119882392218644339.imp@bsdimp.com> <20091227.005757.195066307562707339.imp@bsdimp.com> <1261935364.501662.751.nullmailer@galant.ukfsn.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@FreeBSD.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 18:22:23 -0000 In message: <1261935364.501662.751.nullmailer@galant.ukfsn.org> Iain Hibbert writes: : On Sun, 27 Dec 2009, M. Warner Losh wrote: : : > What finally made it work was stupidly simple... : > : > On my apple keyboard, I turned it on, typed 9 8 7 6 return and then : > things started working. I'm typing this right now from the keyboard. : : Heh, I've been away but was just going to suggest that reading your : mails.. : : btw a few words on security (though the scenario where somebody uses this : information and tracks you down to interfere with your system seems pretty : unlikely :) : : - now that you have posted the PIN you used and bdaddr of your device, you : might want to re-pair with a different (more secure) PIN as I think the : link key may be derivable Actually I faked both when I posted it. Most devices don't have c0:ed at the end, and my certainly don't :) : - Not sure but I think that the keyboard will probably force auth and : encryption when making connections. The FreeBSD stack does not have a : way to do this except globally so unless you have the auth or : encrypt flags set (see hccontrol(8)) then a remote device can : break right in That's good to know. I think that I have these set... : - IMO the PIN should be ephemeral and use-once so when you are paired you : should remove it from the config file or at least comment it out The whole pairing thing is kind of ugly atm in FreeBSD. I used big hammers, I think, to make it work. In other OSes, I just see what is discoverable, click a couple of times, maybe enter a PIN and I then promptly forget about it until I have to 'unpair'. : > Now, I guess the next step would be to find the bt mouse I have and : > try to get it going as well... : : that is probably fixed pin 0000 if not in the documentation Yes, it is :) The default is to no pin, so it wasn't authenticating. : > This is my second favorite keyboard ever. : : How is the keypress feel? I've not had a go on one of those, but I have : an original apple bluetooth keyboard (white with clear undershell, full : sized with num keypad) that works well though a smaller one might be : interesting. It is ok. Not as good as the happy hacking keyboard, but certainly nice enough to use. Better than most to my feel, but ymmv. btw, is there some way I can easily list the paired devices? Warner From owner-freebsd-bluetooth@FreeBSD.ORG Sun Dec 27 18:59:34 2009 Return-Path: Delivered-To: freebsd-bluetooth@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B5C106568B for ; Sun, 27 Dec 2009 18:59:34 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smtp6.freeserve.com (smtp6.freeserve.com [193.252.22.191]) by mx1.freebsd.org (Postfix) with ESMTP id 11FFF8FC17 for ; Sun, 27 Dec 2009 18:59:33 +0000 (UTC) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3611.me.freeserve.com (SMTP Server) with ESMTP id C96D9700008B; Sun, 27 Dec 2009 19:59:32 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3611.me.freeserve.com (SMTP Server) with ESMTP id B8E00700008F; Sun, 27 Dec 2009 19:59:32 +0100 (CET) Received: from rya-online.net (unknown [89.194.194.54]) by mwinf3611.me.freeserve.com (SMTP Server) with SMTP id A4BAB700008B; Sun, 27 Dec 2009 19:59:31 +0100 (CET) X-ME-UUID: 20091227185931674.A4BAB700008B@mwinf3611.me.freeserve.com Received: (nullmailer pid 685 invoked by uid 1000); Sun, 27 Dec 2009 18:59:31 -0000 Date: Sun, 27 Dec 2009 18:59:31 +0000 (GMT) To: "M\. Warner Losh" In-Reply-To: <20091227.111711.287595822663154592.imp@bsdimp.com> References: <20091227.004954.119882392218644339.imp@bsdimp.com> <20091227.005757.195066307562707339.imp@bsdimp.com> <1261935364.501662.751.nullmailer@galant.ukfsn.org> <20091227.111711.287595822663154592.imp@bsdimp.com> User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1261940371.044739.879.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@FreeBSD.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2009 18:59:34 -0000 On Sun, 27 Dec 2009, M. Warner Losh wrote: > In message: <1261935364.501662.751.nullmailer@galant.ukfsn.org> > Iain Hibbert writes: > : - IMO the PIN should be ephemeral and use-once so when you are paired you > : should remove it from the config file or at least comment it out > > The whole pairing thing is kind of ugly atm in FreeBSD. I used big > hammers, I think, to make it work. In other OSes, I just see what is > discoverable, click a couple of times, maybe enter a PIN and I then > promptly forget about it until I have to 'unpair'. I have had complaints about it in NetBSD too and while I think I improved on Max's start it still needs further work and should be graphical. I'm not sure about the whole dbus thing that BlueZ is moving to now though it does work well as you say with the GNOME application. I thought about working something lightweight up with (eg) tcl/tk but haven't got around to it yet.. > : > Now, I guess the next step would be to find the bt mouse I have and > : > try to get it going as well... > : > : that is probably fixed pin 0000 if not in the documentation > > Yes, it is :) The default is to no pin, so it wasn't authenticating. Some devices that I noticed will only enforce the auth on making or accepting the connection. Even the Linux stack used to do this (on the accept path only) but I think they fixed it now. > : > This is my second favorite keyboard ever. > : > : How is the keypress feel? I've not had a go on one of those, but I have > : an original apple bluetooth keyboard (white with clear undershell, full > : sized with num keypad) that works well though a smaller one might be > : interesting. > > It is ok. Not as good as the happy hacking keyboard, but certainly > nice enough to use. Better than most to my feel, but ymmv. I will have to take a trip to the Apple store as it looks a bit rubbery, I want to play with a magic mouse too and I saw that they had some of them last week. (it will not be easy to support properly, I have seen some connection logs and it does some private internal feature back and forth conversation first - we thought that probably enables the touch pad feature which might not be too hard to do, but the driver must then interpret all the swipes itself) > btw, is there some way I can easily list the paired devices? 'easily' not really, but /var/db/hcsecd.keys should contain keys for all paired devices. Actually, there can be more keys stored in the device itself (if you paired with another OS that might happen or you can do it manually). I think you can check/change/remove those with hccontrol but must edit the hcsecd.keys file manually. iain From owner-freebsd-bluetooth@FreeBSD.ORG Tue Dec 29 22:29:28 2009 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DD011065670 for ; Tue, 29 Dec 2009 22:29:28 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id D69F78FC1F for ; Tue, 29 Dec 2009 22:29:27 +0000 (UTC) Received: by pzk15 with SMTP id 15so7892463pzk.3 for ; Tue, 29 Dec 2009 14:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=7loTfOR7xlG+mFgXpYcU82cNda4C0OOESrY7GeaDszY=; b=L4r1l2YR2ODXDlfVdUVveFKBaXl6NdNezNfekvmOxFHdKgY4A0sLl1gtM6afd6T/CX 24S9UBKnGlphBLYYzcNx0Fp3Z1URf0Cj0fCxiwgMVT/52tL9d4P3RjHfWRRo6zlg+9HU rxRv3F0VDvRyIZ+pDdUh8wLILdsUk0HsE75jE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=rpUCClLUPP+GpX8T/7OoBAJX53xzbt7bQq+wYbrOALe1+nenBfahYxLEbyMq01o5T/ jI7on3sX8CiG729nabHJjFXwR9rzimrOxh73rFM5ISzZhDnCdwb4fVw1Gz/mPFA837sL o6/Yqp5hq62GiIWC8E327oX9RETnuruuoBHKE= MIME-Version: 1.0 Received: by 10.115.149.10 with SMTP id b10mr11896154wao.157.1262125754458; Tue, 29 Dec 2009 14:29:14 -0800 (PST) In-Reply-To: <1261940371.044739.879.nullmailer@galant.ukfsn.org> References: <20091227.004954.119882392218644339.imp@bsdimp.com> <20091227.005757.195066307562707339.imp@bsdimp.com> <1261935364.501662.751.nullmailer@galant.ukfsn.org> <20091227.111711.287595822663154592.imp@bsdimp.com> <1261940371.044739.879.nullmailer@galant.ukfsn.org> Date: Tue, 29 Dec 2009 14:29:14 -0800 Message-ID: From: Maksim Yevmenkin To: "M. Warner Losh" , Iain Hibbert Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-bluetooth@freebsd.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 22:29:28 -0000 On Sun, Dec 27, 2009 at 10:59 AM, Iain Hibbert wrote: > On Sun, 27 Dec 2009, M. Warner Losh wrote: > >> In message: <1261935364.501662.751.nullmailer@galant.ukfsn.org> >> Iain Hibbert writes: >> : - IMO the PIN should be ephemeral and use-once so when you are paired you >> : should remove it from the config file or at least comment it out >> >> The whole pairing thing is kind of ugly atm in FreeBSD. I used big >> hammers, I think, to make it work. In other OSes, I just see what is >> discoverable, click a couple of times, maybe enter a PIN and I then >> promptly forget about it until I have to 'unpair'. > > I have had complaints about it in NetBSD too and while I think I improved > on Max's start it still needs further work and should be graphical. I'm > not sure about the whole dbus thing that BlueZ is moving to now though it > does work well as you say with the GNOME application. I thought about > working something lightweight up with (eg) tcl/tk but haven't got around > to it yet.. yep, the whole thing is "ugly" because pairing basically requires some form of (graphical) user interface. its an interactive process. i have a patch somewhere that teaches hcsecd(8) how to execute external program and pass requester and pin info back and forth. with this, one can use something like xdialog and get prompted when pairing is happening. apple keyboard is not giving you any indication that it wants pairing. basically, user supposed to follow instructions on screen -- and it makes perfect sense. we don't have the luxury of uniform graphical user interface, so, you had to use "big hammers". i guess, it would be possible to write text based guided 'pair bluetooth device' tool, that would work together with hcsecd(8) and basically instruct it to do the pairing and then, on successful completion, update config/keys file. >> : > Now, I guess the next step would be to find the bt mouse I have and >> : > try to get it going as well... >> : >> : that is probably fixed pin 0000 if not in the documentation >> >> Yes, it is :) The default is to no pin, so it wasn't authenticating. > > Some devices that I noticed will only enforce the auth on making or > accepting the connection. Even the Linux stack used to do this (on the > accept path only) but I think they fixed it now. i know for a fact that both apple mouse (older version) and apple keyboard (older version) work just fine with freebsd. be warned that bthidd(8) is not really tracking mouse buttons' state and relies on os to do so. bthidd(8) simply translates hid events into ioctl(CONS_MOUSECTL), i.e. things like double-click, etc. will not work in console, but will work in X. [...] >> btw, is there some way I can easily list the paired devices? > > 'easily' not really, but /var/db/hcsecd.keys should contain keys for all > paired devices. Actually, there can be more keys stored in the device > itself (if you paired with another OS that might happen or you can do it > manually). I think you can check/change/remove those with hccontrol but > must edit the hcsecd.keys file manually. yes, edit /var/db/hcsecd.keys and hup/restart hcsecd(8) thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Tue Dec 29 22:41:56 2009 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45D71065670 for ; Tue, 29 Dec 2009 22:41:56 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id 9BC6E8FC1A for ; Tue, 29 Dec 2009 22:41:56 +0000 (UTC) Received: by pzk15 with SMTP id 15so7897394pzk.3 for ; Tue, 29 Dec 2009 14:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=WwpFvF2Fl0WkiBWA/zGFW0SZFEZ16uZHyvifWoZC/qA=; b=pRN/PsRReq3AAVKH7SvAUXl2w9Z//zSFCIxRxSBGWOC1uE0R1GFMX6NdQdY6dnLAek XPRk58C3Xaq3R587q5EuEFtL6zxYUKZssa8YqvaVL00una/9EkutrIeOrPRLS4q+Zkq/ hSIgnmqJa5rEny5ZrN5k+kqoVMP2e3TVEJzzo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=kEEWZD7oQP394rx8QiP/wHBLv9BgaQad7NDM8K9j9o2ItHh3llgz5/EtwYlqqKAfHK RWJozC9Pr60WlltBVBqLpD3wI25E6PZCOyCtUO+JXiiaQCYAh8OxpIKgmh7TZ9+Vjuvw N+9AQ6RMuMMKF9keR6XHEP9VnDbAwp8EhPvsE= MIME-Version: 1.0 Received: by 10.115.39.11 with SMTP id r11mr11865634waj.152.1262126509474; Tue, 29 Dec 2009 14:41:49 -0800 (PST) In-Reply-To: <20091227.004954.119882392218644339.imp@bsdimp.com> References: <20091226.231514.519459540419527384.imp@bsdimp.com> <200912270746.59264.freebsd-bluetooth@dino.sk> <20091227.004954.119882392218644339.imp@bsdimp.com> Date: Tue, 29 Dec 2009 14:41:49 -0800 Message-ID: From: Maksim Yevmenkin To: "M. Warner Losh" Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-bluetooth@freebsd.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 22:41:56 -0000 On Sat, Dec 26, 2009 at 11:49 PM, M. Warner Losh wrote: > In message: <200912270746.59264.freebsd-bluetooth@dino.sk> > Milan Obuch writes: > : On Sunday 27 December 2009 07:15:14 M. Warner Losh wrote: > : > OK. I must be pathologically dense... > : > > : > I've tried to get my apple mini keyboard working with my machine. I'm > : > so close. I'm getting the following messages on the console: > : > [...] > sure hope that vkbd290 isn't going to run me out of memory :) well, that is how "auto cloning" apparently works. bthidd(8) opens /dev/vkbdctl basically asking for the first available instance of /dev/vkbdctl. however, cloning "gets there first" and always gives new clone. same as if_tun(4), if_tap(4) etc. i never liked that. seems like something is missing in clone_xxxx api. thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Wed Dec 30 00:31:33 2009 Return-Path: Delivered-To: freebsd-bluetooth@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E963106568B for ; Wed, 30 Dec 2009 00:31:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id ED9118FC15 for ; Wed, 30 Dec 2009 00:31:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBTNP02w092392; Tue, 29 Dec 2009 16:25:30 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 29 Dec 2009 16:25:35 -0700 (MST) Message-Id: <20091229.162535.190753344529111277.imp@bsdimp.com> To: maksim.yevmenkin@gmail.com From: "M. Warner Losh" In-Reply-To: References: <20091227.111711.287595822663154592.imp@bsdimp.com> <1261940371.044739.879.nullmailer@galant.ukfsn.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@FreeBSD.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 00:31:33 -0000 In message: Maksim Yevmenkin writes: : On Sun, Dec 27, 2009 at 10:59 AM, Iain Hibbert wrote: : > On Sun, 27 Dec 2009, M. Warner Losh wrote: : > : >> In message: <1261935364.501662.751.nullmailer@galant.ukfsn.org> : >> Iain Hibbert writes: : >> : - IMO the PIN should be ephemeral and use-once so when you are paired you : >> : should remove it from the config file or at least comment it out : >> : >> The whole pairing thing is kind of ugly atm in FreeBSD. I used big : >> hammers, I think, to make it work. In other OSes, I just see what is : >> discoverable, click a couple of times, maybe enter a PIN and I then : >> promptly forget about it until I have to 'unpair'. : > : > I have had complaints about it in NetBSD too and while I think I improved : > on Max's start it still needs further work and should be graphical. I'm : > not sure about the whole dbus thing that BlueZ is moving to now though it : > does work well as you say with the GNOME application. I thought about : > working something lightweight up with (eg) tcl/tk but haven't got around : > to it yet.. : : yep, the whole thing is "ugly" because pairing basically requires some : form of (graphical) user interface. its an interactive process. i have : a patch somewhere that teaches hcsecd(8) how to execute external : program and pass requester and pin info back and forth. with this, one : can use something like xdialog and get prompted when pairing is : happening. Exactly... That would be cool. Wanna pass them over to me? : apple keyboard is not giving you any indication that it wants : pairing. basically, user supposed to follow instructions on screen -- : and it makes perfect sense. we don't have the luxury of uniform : graphical user interface, so, you had to use "big hammers". i guess, : it would be possible to write text based guided 'pair bluetooth : device' tool, that would work together with hcsecd(8) and basically : instruct it to do the pairing and then, on successful completion, : update config/keys file. Yes. That's annoying, but enough googling showed me that others have to do this on OS X even... I wonder how hard that would be to write? Is there any way to get the details of what devices hcsecd is tracking? In the IP world, things like ifconfig, arp, netstat -r, etc show you the different aspects of the state of the device. I don't see anything equivalent in bluetooth land. Did I miss them? : >> : > Now, I guess the next step would be to find the bt mouse I have and : >> : > try to get it going as well... : >> : : >> : that is probably fixed pin 0000 if not in the documentation : >> : >> Yes, it is :) The default is to no pin, so it wasn't authenticating. : > : > Some devices that I noticed will only enforce the auth on making or : > accepting the connection. Even the Linux stack used to do this (on the : > accept path only) but I think they fixed it now. : : i know for a fact that both apple mouse (older version) and apple : keyboard (older version) work just fine with freebsd. be warned that : bthidd(8) is not really tracking mouse buttons' state and relies on os : to do so. bthidd(8) simply translates hid events into : ioctl(CONS_MOUSECTL), i.e. things like double-click, etc. will not : work in console, but will work in X. Makes sense... : [...] : : >> btw, is there some way I can easily list the paired devices? : > : > 'easily' not really, but /var/db/hcsecd.keys should contain keys for all : > paired devices. Actually, there can be more keys stored in the device : > itself (if you paired with another OS that might happen or you can do it : > manually). I think you can check/change/remove those with hccontrol but : > must edit the hcsecd.keys file manually. : : yes, edit /var/db/hcsecd.keys and hup/restart hcsecd(8) How do I know what the key is for a given device? BTW, after the big hammers, the newer apple keyboard and mouse (2008) are working just fine[*] with my FreeBSD box and it they seem to wake up better than OS X does (or maybe they just never go to sleep). Is there some way to find out what the battery level in these devices is? Thanks a bunch... If I had a phone that would do internet over ip, that would be my next set of questions... Warner [*] the keyboard doesn't always register pressing the caps lock key quite right. I have it mapped to control and 10% of the time I get the character instead of the control character (eg, a gets inserted in emacs, rather than going to the start of the line). But I had similar issues under OS X on an old MacBook Pro I used to have... From owner-freebsd-bluetooth@FreeBSD.ORG Wed Dec 30 10:39:13 2009 Return-Path: Delivered-To: freebsd-bluetooth@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75EA61065692 for ; Wed, 30 Dec 2009 10:39:13 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smtp6.freeserve.com (smtp5.freeserve.com [193.252.22.151]) by mx1.freebsd.org (Postfix) with ESMTP id 147528FC12 for ; Wed, 30 Dec 2009 10:39:12 +0000 (UTC) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3513.me.freeserve.com (SMTP Server) with ESMTP id 57AA47000084; Wed, 30 Dec 2009 11:39:11 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3513.me.freeserve.com (SMTP Server) with ESMTP id 48C03700008B; Wed, 30 Dec 2009 11:39:11 +0100 (CET) Received: from rya-online.net (unknown [89.194.128.19]) by mwinf3513.me.freeserve.com (SMTP Server) with SMTP id 22B607000084; Wed, 30 Dec 2009 11:39:10 +0100 (CET) X-ME-UUID: 20091230103910142.22B607000084@mwinf3513.me.freeserve.com Received: (nullmailer pid 944 invoked by uid 1000); Wed, 30 Dec 2009 10:39:09 -0000 Date: Wed, 30 Dec 2009 10:39:09 +0000 (GMT) To: "M\. Warner Losh" In-Reply-To: <20091229.162535.190753344529111277.imp@bsdimp.com> References: <20091227.111711.287595822663154592.imp@bsdimp.com> <1261940371.044739.879.nullmailer@galant.ukfsn.org> <20091229.162535.190753344529111277.imp@bsdimp.com> User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1262169549.695652.1010.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@FreeBSD.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 10:39:13 -0000 On Tue, 29 Dec 2009, M. Warner Losh wrote: > : yep, the whole thing is "ugly" because pairing basically requires some > : form of (graphical) user interface. its an interactive process. i have > : a patch somewhere that teaches hcsecd(8) how to execute external > : program and pass requester and pin info back and forth. with this, one > : can use something like xdialog and get prompted when pairing is > : happening. > > Exactly... That would be cool. Wanna pass them over to me? If you are working on something, please look at the NetBSD implementation as I think having a system daemon execute an external program to request input from the user is wrong. What I did is to have the daemon[1] open a socket and accept client connections. When it sees a PIN request it offers it out to the clients to see if any of them can provide a PIN. When users log in, they can run a PIN application[2] that registers on the socket and will put up a requester when required. Alternatively, I can use the base application[3] to set a PIN before trying to pair. [1] http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.sbin/bthcid [2] http://homepages.rya-online.net/plunky/btpin-qt-1.4.tar.gz [3] http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/btpin As said, I don't think its ideal (and Qt4 takes way too long to build!) but it does work ok for my purposes. > BTW, after the big hammers, the newer apple keyboard and mouse (2008) > are working just fine[*] with my FreeBSD box and it they seem to wake > up better than OS X does (or maybe they just never go to sleep). I'm not sure if having things like 'Sniff', 'Park' and 'Hold' modes enabled will make a difference to this. Certainly enabling sniff mode keeps the batteries going for longer (many weeks vs some days) but I think hold and park require active OS support to be effective. > Is there some way to find out what the battery level in these devices > is? I investigated this somewhat. The HID descriptor (of the Mighty Mouse, not my older keyboard or mouse) shows a feature report: Feature id=71 size=8 count=1 page=Device_Controls usage=Battery_Strength Variable NoPref Volatile logical range 0..100 and I think this means that the host can poll the device by sending the feature report and getting a return value with battery strength. I never tried it though.. (the keyboard descriptor you posted earlier also shows this, except the logical range is 0..255) Also, my mouse (and keyboard) both send an undocumented input report with id#42 containing a single byte (0x01 or 0x02) just before the batteries finally shut down. No idea what this should be interpreted as, but I use NiMH batteries and the voltage remains constant until they run out of power, so perhaps the 'strength' would not be a very useful value anyway. If you have OSX there is a way to capture bluetooth packets and you could investigate more there. I think something like hold down 'option' key while opening the bluetooth menu and you should see it listed. Not sure if it shows a live stream but hcidump can interpret the packet capture files. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Wed Dec 30 19:57:08 2009 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65F641065672 for ; Wed, 30 Dec 2009 19:57:08 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-px0-f190.google.com (mail-px0-f190.google.com [209.85.216.190]) by mx1.freebsd.org (Postfix) with ESMTP id 390808FC18 for ; Wed, 30 Dec 2009 19:57:08 +0000 (UTC) Received: by pxi28 with SMTP id 28so8307429pxi.7 for ; Wed, 30 Dec 2009 11:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=6xRNWHaloVxnf+/UK+Imsxdm2wn3gR+FReLg7AW5Kvw=; b=OPxWKv/p3rcPjlDLVKmClfvEMjOWqt2H9CEQPSzvC3nlrJe8C9jN8WnZ4bBHQLIeRk HFammD9cx2x80+kAjglODFbRVMGMdbVsWg1Oh9fW04aUwOOtOFeCn++8IoFy5QLSy8P3 lPEIutV8HsKWXI9pkhY32OTrDM6ViDvp7OvVI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=HpbK/Gp5ZhLbt1VxT6OQmilSbL9VRrzJTvVdGPdb5G2SX8caRM4VZBa3sBobMc8AY2 w0585/Nw/qKn44NEO7ogd+r6VqsceCYSvCemRRiXiMtaAlqQzQQOXEVGvb6O+INcWjFG ghfkG9gkrOfPyWM9qzWZRp6fDZQ9mNWu5FNSU= MIME-Version: 1.0 Received: by 10.115.133.2 with SMTP id k2mr12800969wan.113.1262203027908; Wed, 30 Dec 2009 11:57:07 -0800 (PST) In-Reply-To: <1262169549.695652.1010.nullmailer@galant.ukfsn.org> References: <20091227.111711.287595822663154592.imp@bsdimp.com> <1261940371.044739.879.nullmailer@galant.ukfsn.org> <20091229.162535.190753344529111277.imp@bsdimp.com> <1262169549.695652.1010.nullmailer@galant.ukfsn.org> Date: Wed, 30 Dec 2009 11:57:07 -0800 Message-ID: From: Maksim Yevmenkin To: Iain Hibbert Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-bluetooth@freebsd.org, "M. Warner Losh" Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 19:57:08 -0000 On Wed, Dec 30, 2009 at 2:39 AM, Iain Hibbert wrote: > On Tue, 29 Dec 2009, M. Warner Losh wrote: >> : yep, the whole thing is "ugly" because pairing basically requires some >> : form of (graphical) user interface. its an interactive process. i have >> : a patch somewhere that teaches hcsecd(8) how to execute external >> : program and pass requester and pin info back and forth. with this, one >> : can use something like xdialog and get prompted when pairing is >> : happening. >> >> Exactly... That would be cool. Wanna pass them over to me? sure, let me dig those out first :) > If you are working on something, please look at the NetBSD implementation > as I think having a system daemon execute an external program to request > input from the user is wrong. What I did is to have the daemon[1] open a > socket and accept client connections. When it sees a PIN request it offers > it out to the clients to see if any of them can provide a PIN. When users > log in, they can run a PIN application[2] that registers on the socket and > will put up a requester when required. Alternatively, I can use the base > application[3] to set a PIN before trying to pair. ok, i guess, i can see the value of having dynamic pin/key configuration, i.e. replace static /etc/bluetooht/hcsecd.conf with one built dynamically based on client's request. i could even see how generated link keys are stored in user's home directory together with user's pins etc. having said all that, i do not see why executing external pin program from hcsecd(8) is a bad idea. bluetooth is essentially single user. there is no good way, imo, to basically share multiple devices between multiple users on the same computer. what you have in netbsd is a little bit more flexible, but, i bet, in 99.9% cases it probably ends up the same way, i.e. only one user, uses only only handful or remote devices connected to the same local device (or computer). >> BTW, after the big hammers, the newer apple keyboard and mouse (2008) >> are working just fine[*] with my FreeBSD box and it they seem to wake >> up better than OS X does (or maybe they just never go to sleep). > > I'm not sure if having things like 'Sniff', 'Park' and 'Hold' modes > enabled will make a difference to this. Certainly enabling sniff mode > keeps the batteries going for longer (many weeks vs some days) but I think > hold and park require active OS support to be effective. it probably never goes to sleep :) freebsd will try to become 'master' on link, and, we are not actively enforce any link policy, so, i'm guessing link is always running with the default policy. 'sniff' mode definitely helps to reduce power consumption, and, i'm guessing, progressively (in|de)creasing 'sniff' interval based on keyboard's (in)activity is the right thing to do. >> Is there some way to find out what the battery level in these devices >> is? > > I investigated this somewhat. The HID descriptor (of the Mighty Mouse, not > my older keyboard or mouse) shows a feature report: > > Feature id=71 > size=8 > count=1 > page=Device_Controls > usage=Battery_Strength > Variable NoPref Volatile > logical range 0..100 > > and I think this means that the host can poll the device by sending the > feature report and getting a return value with battery strength. I never > tried it though.. (the keyboard descriptor you posted earlier also shows > this, except the logical range is 0..255) yep, usually device has some sort of hid report. i think, but not 100% sure, there also might be something that comes over hid control channel. need to re-check the specs again. > Also, my mouse (and keyboard) both send an undocumented input report with > id#42 containing a single byte (0x01 or 0x02) just before the batteries > finally shut down. No idea what this should be interpreted as, but I use > NiMH batteries and the voltage remains constant until they run out of > power, so perhaps the 'strength' would not be a very useful value anyway. > > If you have OSX there is a way to capture bluetooth packets and you could > investigate more there. I think something like hold down 'option' key > while opening the bluetooth menu and you should see it listed. Not sure if > it shows a live stream but hcidump can interpret the packet capture files. oh, neat-o! i did not know about this! i will try this today. thanks! thanks max From owner-freebsd-bluetooth@FreeBSD.ORG Wed Dec 30 21:16:00 2009 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E38B4106566C for ; Wed, 30 Dec 2009 21:16:00 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smtp5.freeserve.com (smtp5.freeserve.com [193.252.22.128]) by mx1.freebsd.org (Postfix) with ESMTP id 7CFCD8FC0C for ; Wed, 30 Dec 2009 21:16:00 +0000 (UTC) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3416.me.freeserve.com (SMTP Server) with ESMTP id E0C411C00087; Wed, 30 Dec 2009 22:15:48 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3416.me.freeserve.com (SMTP Server) with ESMTP id CFAE01C0008F; Wed, 30 Dec 2009 22:15:48 +0100 (CET) Received: from rya-online.net (unknown [89.194.134.134]) by mwinf3416.me.freeserve.com (SMTP Server) with SMTP id 37A331C00088; Wed, 30 Dec 2009 22:15:46 +0100 (CET) X-ME-UUID: 20091230211547228.37A331C00088@mwinf3416.me.freeserve.com Received: (nullmailer pid 2024 invoked by uid 1000); Wed, 30 Dec 2009 21:15:41 -0000 Date: Wed, 30 Dec 2009 21:15:41 +0000 (GMT) To: Maksim Yevmenkin In-Reply-To: References: <20091227.111711.287595822663154592.imp@bsdimp.com> <1261940371.044739.879.nullmailer@galant.ukfsn.org> <20091229.162535.190753344529111277.imp@bsdimp.com> <1262169549.695652.1010.nullmailer@galant.ukfsn.org> User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1262207741.839354.13401.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: Keyboard - how? X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 21:16:01 -0000 On Wed, 30 Dec 2009, Maksim Yevmenkin wrote: > ok, i guess, i can see the value of having dynamic pin/key > configuration, i.e. replace static /etc/bluetooht/hcsecd.conf with one > built dynamically based on client's request. i could even see how > generated link keys are stored in user's home directory together with > user's pins etc. I would like some of that but I think its a bit complex to handle properly. I wanted to associate user credentials with sockets, so that for example a user could have their own PIN/key daemon running and keep their own keys for their own devices private (also, piggybacking onto another users baseband connection would be prevented) but, I never did really work out how and where incoming connections would be dealt with. One associated thing I thought of which I forgot to mention at the time, do you think it would be useful to extend the bluetooth(3) host lookup routines (eg bt_gethostbyname()) to search in a user file (eg ~/.bluetooth/hosts ?) in addition to the system /etc/bluetooth/hosts so that users did not need root privileges to add an alias for their favourite device? That might be a fairly simple addition.. > having said all that, i do not see why executing external pin program > from hcsecd(8) is a bad idea. If the daemon runs an external program, the daemon must run as root or the logged in user otherwise it won't be able to write anything to the screen, and I think its a bit scary to have root daemons running X programs (ok I'm a coward :). Also, I'm not sure about this, but root might not actually have permission to write on the display which could be on another machine entirely. Then, if a machine has several displays, what do you set DISPLAY env variable to, and when? Its much easier I think to just have the user who wants to do PIN entering just run her own daemon.. > > If you have OSX there is a way to capture bluetooth packets and you could > > investigate more there. I think something like hold down 'option' key > > while opening the bluetooth menu and you should see it listed. Not sure if > > it shows a live stream but hcidump can interpret the packet capture files. > > oh, neat-o! i did not know about this! i will try this today. thanks! btw if you don't find the magic key combo, the program should be in /Developer/Applications/Utilities/Bluetooth iain