From owner-freebsd-bluetooth@FreeBSD.ORG Mon Mar 17 00:29:41 2008 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 ABD93106566B for ; Mon, 17 Mar 2008 00:29:41 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 273DE8FC27 for ; Mon, 17 Mar 2008 00:29:40 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so4476805fgg.35 for ; Sun, 16 Mar 2008 17:29:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=auBurzcSVzOmTgSd2Ca1GE8RdHx+DEqx5dZVog/Aw1o=; b=c3sFN8sSJGsD6DFDohOIs94Fp7WLH1TJoeYNCS2el0R/d3cDu1Wils5GU9A1REXYQtDJiE+QKdjhN0Cy102Xqe/QVLPT9ZzUeHdycJghQUZXqO/LjX1jsSGXm3MNoI2XkMRDj9y/ShoT42RffrhvtBpPIgTfA9jZg4yHfiIifKQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZxLtX+vdYyMeD7CzkHYwAjDbicGEBaKnOQVMON8/8KCMJdTWEEzQFNV2T4SaJlN0kEWqpbG8xVW1vB1aMaQtx0fU843HrIBSd/ic5mchsR1gXIzDUyUK7DeQXDmmdJ4WjGWfeUoggkk7w81hJmehmIeMTIERRHtl2klOqt0S2wA= Received: by 10.86.99.9 with SMTP id w9mr13127606fgb.44.1205713779468; Sun, 16 Mar 2008 17:29:39 -0700 (PDT) Received: by 10.86.23.12 with HTTP; Sun, 16 Mar 2008 17:29:39 -0700 (PDT) Message-ID: Date: Sun, 16 Mar 2008 17:29:39 -0700 From: "Maksim Yevmenkin" To: mato In-Reply-To: <47DBE7A4.3060006@users.sf.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47DBE7A4.3060006@users.sf.net> X-Mailman-Approved-At: Mon, 17 Mar 2008 00:35:13 +0000 Cc: Subject: Re: BT issues 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: Mon, 17 Mar 2008 00:29:41 -0000 Hello, > I've got two questions regarding bluetooth in FreeBSD: > > 1) I'd like to start rfcomm_pppd automatically upon connecting my BT > dongle. I know about /etc/devd.conf but from my understanding only one > action takes place and there's already action for ubt device and so I don't > know how to trigger my script. you do not really have to do it. you can run rfcomm_pppd even if no bluetooth devices are connected to the system. basically, all you need to do is to run both sdpd and rfcomm_pppd bound to wildcard (aka ANY) bd_addr. 1) to enable sdpd at boot time just add to your /etc/rc.conf the following line sdpd_enanble="YES" this should start sdpd on boot automatically. to start/stop sdpd at run time use /etc/rc.d/sdpd start/stop 2) please cut and paste the following rc script into /etc/rc.d/rfcomm_pppd_server == #!/bin/sh # # $FreeBSD$ # # PROVIDE: rfcomm_pppd_server # REQUIRE: DAEMON sdpd # BEFORE: LOGIN # KEYWORD: nojail . /etc/rc.subr name="rfcomm_pppd_server" rcvar=`set_rcvar` command="/usr/sbin/rfcomm_pppd" command_args="-s" start_precmd="rfcomm_pppd_server_prestart" required_modules="ng_btsocket" rfcomm_pppd_server_prestart() { if [ -n "${rfcomm_pppd_server_bd_addr}" ]; then command_args="${command_args} -a ${rfcomm_pppd_server_bd_addr}" fi command_args="${command_args} -C ${rfcomm_pppd_server_channel:-1}" command_args="${command_args} -l ${rfcomm_pppd_server_label:-rfcomm-server}" if checkyesno rfcomm_pppd_server_register_sp ; then command_args="${command_args} -S" fi if checkyesno rfcomm_pppd_server_register_dun ; then command_args="${command_args} -D" fi } load_rc_config $name run_rc_command "$1" == 3) to enable rfcomm_pppd server at boot time just add to your /etc/rc.conf the following line rfcomm_pppd_server_enanble="YES" rfcomm_pppd_server_channel=1 # EDIT THIS IF NEEDED rfcomm_pppd_server_label="rfcomm-server" # EDIT THIS IF NEEDED rfcomm_pppd_server_register_sp="NO" rfcomm_pppd_server_register_dun="NO" this should start rfcomm_pppd server on boot automatically. to start/stop rfcomm_pppd server at run time use /etc/rc.d/rfcomm_pppd start/stop > 2) I've got two ppp.conf profiles, one for FreeBSD and one for Windows. > When I connect FreeBSD laptop via rfcomm_pppd it works and caches the hcsec > key. But if I try to connect Windows machine, it asks for password and it > seems the key is changed as from that time I cannot connect FreeBSD machine > and I have to remove hcsecd.keys and restart hcsecd. Why and what can be > done about it ? I'm not really sure what are you trying to do. before giving any suggestions, i'd like to see hcsecd.conf and hcidump that shows the problem with authentication. thanks, max p.s. please keep freebsd-bluetooth@ in the cc list