From owner-freebsd-bluetooth@FreeBSD.ORG Thu Mar 25 04:42:22 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 0DA6E16A4CE for ; Thu, 25 Mar 2004 04:42:22 -0800 (PST) Received: from mail27.cn4e.com (unknown [218.107.207.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 618CD43D2F for ; Thu, 25 Mar 2004 04:42:21 -0800 (PST) (envelope-from zhangweiwu@realss.com) Received: from realss.com (unknown [218.85.105.169]) by mail27.cn4e.com (WorldPost) with ESMTP id 276F7D6DE6FD; Thu, 25 Mar 2004 21:08:36 +0800 (CST) Message-ID: <4062D379.9020500@realss.com> Date: Thu, 25 Mar 2004 20:41:29 +0800 From: Zhang Weiwu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040227 X-Accept-Language: zh-cn, en-us, en MIME-Version: 1.0 To: Dmitry Yaitskov References: <84hdwfvtzq.fsf@nothing.nowhere.com> <4061729F.4010504@realss.com> <84lllp1vaz.fsf@nothing.nowhere.com> <84d6711k72.fsf@nothing.nowhere.com> In-Reply-To: <84d6711k72.fsf@nothing.nowhere.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-bluetooth@freebsd.org cc: =?UTF-8?B?546LIOWuh+e/lA==?= Subject: Re: Windows client/FreeBSD server Q. on bluetooth LAN 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, 25 Mar 2004 12:42:22 -0000 Hi. Dmitry Yaitskov wrote: >Hi again, > >Ok, I got somewhat closer to where I want to be I think... I found a >set of bluetooth tools on the CDs that came with my laptop (Toshiba >satellite 5000) and installed them. After some tweaking and following >the rfcomm_pppd man pages I got to the point where I can see the BT >device on FreeBSD from the laptop, and see the "LAN access over PPP" >service on it. I can even "connect' from the laptop to that service. >But then nothing happens (on the laptop's network connections panel, >there is a "Bluetooth LAN emulation from Toshiba" connection, and it >stays in the "network cable unplugged" status)... My guess is that the >PPP part on the FreeBSD side is not configured correctly. Using the >hcidump I see lots of activity when I connect, here's the last >fragment: > > > >>> HCI Event: Number of Completed Packets(0x13) plen 5 >> >> >< ACL data: handle 0x0028 flags 0x02 dlen 72 > L2CAP(d): cid 0x7a len 68 [psm 3] > RFCOMM(d): UIH: cr 0 dlci 2 pf 0 ilen 64 fcs 0x40 > > >>> HCI Event: Number of Completed Packets(0x13) plen 5 >> >> >< ACL data: handle 0x0028 flags 0x02 dlen 72 > L2CAP(d): cid 0x7a len 68 [psm 3] > RFCOMM(d): UIH: cr 0 dlci 2 pf 0 ilen 64 fcs 0x40 > > >>> HCI Event: Number of Completed Packets(0x13) plen 5 >> >> >< ACL data: handle 0x0028 flags 0x02 dlen 8 > L2CAP(d): cid 0x7a len 4 [psm 3] > RFCOMM(s): DISC: cr 0 dlci 2 pf 1 ilen 0 fcs 0xd9 > > >>> HCI Event: Number of Completed Packets(0x13) plen 5 >>> ACL data: handle 0x0028 flags 0x02 dlen 8 >> >> > L2CAP(d): cid 0x5a len 4 [psm 3] > RFCOMM(s): UA: cr 0 dlci 2 pf 1 ilen 0 fcs 0xf3 > >then nothing happens for a while, and finally (after several minutes) >this: > > > >>> ACL data: handle 0x0028 flags 0x02 dlen 12 >> >> > L2CAP(s): Disconn req: dcid 0x0059 scid 0x0078 >< ACL data: handle 0x0028 flags 0x02 dlen 12 > L2CAP(s): Disconn rsp: dcid 0x0059 scid 0x0078 > > >>> HCI Event: Number of Completed Packets(0x13) plen 5 >>> HCI Event: Disconn Complete(0x05) plen 4 >> >> > >which I guess means that the connection was terminated for >lack of activity: > >My best guess is that ppp is misconfigured on the server. Here's what >my ppp.conf contains (the only part that I changed is rfcomm-server): > >################################################################# ># PPP Sample Configuration File ># Originally written by Toshiharu OHNO ># Simplified 5/14/1999 by wself@cdrom.com ># ># See /usr/share/examples/ppp/ for some examples ># ># $FreeBSD: src/etc/ppp/ppp.conf,v 1.8 2001/06/21 15:42:26 brian Exp $ >################################################################# > >default: > set timeout 180 > enable dns > set log Phase Chat LCP IPCP CCP tun command > ident user-ppp VERSION (built COMPILATIONDATE) > > > # Ensure that "device" references the correct serial port > # for your modem. (cuaa0 = COM1, cuaa1 = COM2) > # > set device /dev/cuaa1 > > set speed 115200 > set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \ > \"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT" > set timeout 180 # 3 minute idle timer (the default) > enable dns # request DNS info (for resolv.conf) > >rfcomm-server: > set timeout 0 > set lqrperiod 10 > set ifaddr 10.0.0.1 10.0.0.2 255.255.255.0 > enable lqr > accept lqr > disable pap > deny pap > disable chap > deny chap > >papchap: > # > # edit the next three lines and replace the items in caps with > # the values which have been assigned by your ISP. > # > > set phone PHONE_NUM > set authname USERNAME > set authkey PASSWORD > > set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 > add default HISADDR # Add a (sticky) default route > > >Any ideas will be much appreciated. Thanks. > > -- Cheers, -Dima. > I'm sorry I'm too busy today to give a detailed reply. I copied this email to my friend who has a Windows notebook connecting to my bluetooth server, I think he can help you if he has time:) Here is my ppp configure file, for your reference: == On the client side == thinkpad# cat /etc/ppp/ppp.conf bluetooth: enable lqr accept lqr set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0 add default HISADDR enable dns set dial set timeout 0 disable iface-alias deny pap disable pap deny chap disable chap On the client, to connect use /etc/rc.bluetooth start ubt0 rfcomm_pppd -c -a 00:04:61:80:6f:e4 -C 1 -l bluetooth == On server side == dino# cat /etc/ppp/ppp.conf # on dino ppp is *only* used with rfcomm as bluetooth LAN # access server. This ppp.conf is written to fit that purpose. rfcomm-server: set timeout 0 set lqrperiod 10 #enable lqr disabled because Xiaojuan's notebook doesn't support lqr accept lqr set ifaddr 192.168.0.120 192.168.0.53-192.168.0.119 255.255.255.0 accept dns enable proxy #enable proxyall disable pap deny pap disable chap deny chap On the server I copied /etc/rc.bluetooth to /usr/local/etc/rc.d/bluetooth.sh and modified it to let the server start up accepting PPP connection. dino# diff /usr/local/etc/rc.d/bluetooth.sh /etc/rc.bluetooth 32,35d31 < # Zhang Weiwu: modifications --- < ## Usage check is disabled < ## Device is set to ubt0 < ## Call sdpd and rfcomm_pppd 154,157c150,153 < #if [ $# -lt 2 ]; then < # usage $0 < # exit 1 < #fi --- > if [ $# -lt 2 ]; then > usage $0 > exit 1 > fi 161,163c157,158 < #dev=$1 < #shift < dev=ubt0 --- > dev=$1 > shift 236,241d230 < # weiwu added: < hccontrol -n ubt0hci inquiry < sdpd < sdptool add --channel=1 LAN < rfcomm_pppd -s -C 1 -l rfcomm-server < echo -n ' bluetooth'