On 26 April 2009 c. 15:41:56 Thomas Pfaff wrote:
> Hi.  Is it possible to use ubt(4) to connect to my cellphone and then
> create a ppp interface so I can gain Internet access?  My MSI Wind has
> a built-in USB bluetooth adapter that connects to ubt(4):
>
>   $ dmesg | grep ubt0
>   ubt0 at uhub4 port 1 "Micro Star International Bluetooth" rev
> 2.00/31.64 addr 2
>
> I've installed the following packages:
>
>   $ pkg_info | grep blue
>   bluetooth-libs-20081122 bluetooth network libraries
>   bluetooth-tools-20081122 bluetooth network tools
>   bluez-hcidump-1.42  Bluetooth packet analyzer
>
> I can activate the interface and locate my cellphone:
>
>   $ sudo btconfig ubt0 up
>   $ btconfig
>   ubt0: bdaddr 00:21:85:b2:51:41 flags=3<UP,RUNNING>
>   $ btconfig ubt0 inquiry
>   Device Discovery from device: ubt0 .... 1 response
>     1: bdaddr 00:1d:e9:e5:ad:01
>
>      : name "Nokia 6233"
>      : class: [0x5a0204] Cellular Phone <Networking> <Capturing>
>      : <Object Transfer>
>
>           <Telephony>
>
>      : page scan rep mode 0x01
>      : clock offset 14038
>
> I'm not sure where to go from here.  I've searched the archives
> and asked Google, but I've been unable to find anything.  Can I
> use this device to connect to the Internet through my cellphone?
> If so, do you have any pointers to what I should be looking at?

Here is my setup for
"put-bluetooth-in-and-connect-to-Internet-via-my-phone-automagically".
I hope I didn't miss anything. Built by Paul de Weird's suggestions
on his site (thanks, BTW!).

Beeline is my cellar phone network operator. I didn't tried 3G yet -
there are problems implementing 3G in the Moscow: military use "normal"
3G frequencies. :(

Please note: not all Bluetooth adapters work here, even with the same
Vendor and Product IDs!

--
  Best wishes,
    Vadim Zhukov

A: Because it messes up the way people read text.
Q: Why is a top-posting such a bad thing?


/etc$ fgrep cx bluetooth/hosts
# My mobile phone
00:01:e3:d6:96:59 cx
/etc$ cat bluetooth/autonet
# Bluetooth dongles that I insert into PC. Nothing secret:
# One isn't working, and one is phisically broken :).
00:18:e4:0a:b3:19
00:00:00:00:00:00
00:15:83:04:1a:a8
/etc$ tail -1 rc.conf.local
tunnel_beeline_bt=YES
/etc$ cat rc.local | head -30
#       $OpenBSD: rc.local,v 1.39 2006/07/28 20:19:46 sturm Exp $

# Site-specific startup actions, daemons, and other things which
# can be done AFTER your system goes into securemode.  For actions
# which should be done BEFORE your system has gone into securemode
# please see /etc/rc.securelevel.

echo -n 'starting tunnels:'
ls /etc/tunnels | while read tunnel
do
        eval tunnel_enabled=\"\$tunnel_${tunnel}\"
        if [ -r /etc/tunnels/"$tunnel" -a X"$tunnel_enabled" = XYES ]; then
                echo -n " $tunnel"
                sh "/etc/tunnels/$tunnel" &
        fi
done
echo .

echo -n 'starting local daemons:'

# Add your local startup actions here.
if [ X"$bt_init" == XYES -a -x /usr/local/sbin/btconfig ]; then
        bt_devs=`/usr/local/sbin/btconfig -l`
        for bd in $bt_devs; do
                /usr/local/sbin/btconfig $bd up
        done
        if [ -x /usr/local/sbin/bthcid -a X"$bthcid_flags" != XNO ]; then
                echo -n ' bthcid'; /usr/local/sbin/bthcid $bthcid_flags
        fi
fi
/etc$ cat tunnels/beeline_bt
#!/bin/sh

connectMe() {
        (ifconfig | egrep '^ppp0:' >/dev/null 2>&1) || \
            ifconfig ppp0 create

        if [ $? -eq 0 ]; then
                /usr/local/bin/rfcomm_sppd -a cx -d $1 -s DUN \
                    -t /dev/ttypz
                if [ $? -eq 0 ]; then
                        #/usr/sbin/ppp -foreground beeline </dev/null
                        /usr/sbin/pppd call beeline_bt </dev/null
                        #wait
                fi
        fi
}

while true; do
        if pgrep sppd ppp >/dev/null; then
                sleep 10
                continue;
        fi

        ALLOWED="`sed -e '/^\\(#.*\\)\$/d' /etc/bluetooth/autonet | xargs |
sed -e 's/ /|/g'`"

        if ! [ -e /var/run/nobtautoconn ]; then
                /usr/local/sbin/btconfig | while read DEV JUNK BDADDR FLAGS;
do
                        if echo -n "$BDADDR" | egrep -- "$ALLOWED" >/dev/null;
then
                                connectMe "${DEV%:}" "$BDADDR"
                                break
                        fi
                done
        fi
        sleep 5
done
/etc$ sudo cat ppp/options
lock
auth
#usehostname
/etc$ sudo cat ppp/ip-common
#!/bin/sh

# Parameters:
# interface-name tty-device speed local-IP-address remote-IP-address ipparam
#
# We use "ipparam" to specify name of DNS configuration to load
DNSCONF="$6"

test X"$DNSCONF" = X && exit 0

CONFPATH=/etc/resolv.conf."$DNSCONF"
SAVEPATH=/etc/resolv.conf.save."$DNSCONF"

test -r "$CONFPATH" || exit 2
/etc$ sudo cat ppp/ip-up
#!/bin/sh
. /etc/ppp/ip-common

set -e
umask 022
cp /etc/resolv.conf "$SAVEPATH"
cp "$CONFPATH" /etc/resolv.conf
if [ -r /etc/resolv.conf.tail ]; then
        cat /etc/resolv.conf.tail >>/etc/resolv.conf
fi
touch "$SAVEPATH"
/etc$ sudo cat ppp/ip-down
#!/bin/sh
. /etc/ppp/ip-common

test /etc/resolv.conf -nt "$SAVEPATH" && exit 4
mv "$SAVEPATH" /etc/resolv.conf
/etc$ cat ppp/peers/beeline_bt
/dev/ttypz
115200
crtscts
file /etc/ppp/peers/beeline
/etc$ cat ppp/peers/beeline



# 10.0.0.1:192.168.254.254

connect "/usr/sbin/chat -V -f /etc/ppp/peers/chat/gprs -U internet.beeline.ru
-T *99***1#"

noauth
user beeline
pap-restart 20

noipdefault
ipcp-restart 20
ipcp-accept-local
ipcp-accept-remote
defaultroute

nobsdcomp
noaccomp
nopcomp
nodeflate
nopredictor1
# novjccomp
novj
noccp

idle 300

ipparam "beeline"
/etc$ cat ppp/peers/chat/gprs
TIMEOUT 60
ABORT 'BUSY'
ABORT 'DELAYED'
ABORT 'NO CARRIER'
ABORT 'NO DIALTONE'
ABORT 'VOICE'
'' ATZ
OK \dAT+CGDCONT=1,"IP","\U"
OK \dAT+CGQREQ=1,0,0,0,0,0
OK \dAT+CGQMIN=1,0,0,0,0,0
TIMEOUT 60
OK \dATDT\T
CONNECT \c

Reply via email to