Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Mar 2008 12:25:41 +0200
From:      mato <gamato@users.sf.net>
To:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
Cc:        freebsd-bluetooth@freebsd.org
Subject:   Re: BT issues
Message-ID:  <47EF6AA5.60403@users.sf.net>
In-Reply-To: <bb4a86c70803161729y51f376d0t8333c30713c646d6@mail.gmail.com>
References:  <47DBE7A4.3060006@users.sf.net> <bb4a86c70803161729y51f376d0t8333c30713c646d6@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Maksim Yevmenkin wrote:
> 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
>   

Hallo Max,

1)  I did'n know it.  Thanks for your explanation.  I used it the same 
way only I ran rfcomm_pppd manually.  And btw will the provided rc.d 
script be included in FreeBSD ?

2) What am I trying to do ?  Well, I set up internet sharing on my home 
laptop via BT and I can use it from my other laptop.  Now, it works when 
my other (work) laptop runs FreeBSD.  When I boot the other laptop in to 
Windows it asks me for PIN and then it works OK.  But when I boot in to 
FreeBSD again I cannot connect and I have to reinitialise as explained 
in my original email.  So to me it seems connecting from Windows somehow 
changes stored key which is unusable for subsequent FreeBSD uses.
If this explanation is not enough, I can try to capture and provide 
hcidump for you.

Cheers,

Martin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47EF6AA5.60403>