ES 388 (Broadcom based)

Iain Hibbert plunky at rya-online.net
Fri Feb 25 08:15:09 UTC 2011


On Thu, 24 Feb 2011, Maksim Yevmenkin wrote:

> 2011/2/24 ????????? ???????? <c.kworr at gmail.com>:
> > 24.02.2011 11:50, Iain Hibbert wrote:
> >>>>
> >>>> and NAP, which we do tell them all about
> >>>
> >>> Strange. The phone doesn't show anything. I have tried PANU and GN but
> >>> nothing
> >>> changes.
> >>
> >> What phone is it?  I guess that the phone is not set up to access an
> >> external network in this way even though somebody set the probes up to
> >> check it..
> >
> > It's SoneEricsson K530i and SonyEricsson W810i. I'll try to check with other
> > phones...
> >
> > The phone can access Internet by GPRS. What I'm trying to do is to give
> > access to internet from my computer to my phone, so the phone can connect to
> > the Internet over Bluetooth.
>
> btpand(8) is your best bet.

google isn't much help here either since the results are overloaded with
spam for phone models. Its not clear but I think you have to set up a new
'data account' on the phone to get it to connect using an alternative
method than GPRS..

I did manage something like this with my windows mobile phone one time,
set up a new 'Bluetooth modem' on the phone for the internet service, then
configured DUN on the host using rfcomm_sppd, a fake modem script and pppd
(script for NetBSD attached). Not sure if that will work in this case
though, since the phone does not search for DUN. It might work for LAN
which is basically PPP over serial (I think no fake modem required) though
the FreeBSD specifics will be slightly different..

The LAN probe could be unrelated though, as it also looks for WAP which is
basically sitting atop the LAN profile (I think WAP is an IP based
service, it was specified in the early Bluetooth Core documents)

iain
-------------- next part --------------
#!/bin/sh

#

PTY=/dev/ttys3
LINKNAME=DUN
ADDR=192.168.3.1:192.168.3.2
DNS1=193.36.79.100
DNS2=193.36.79.101

#
# provide Bluetooth DUN profile. Basically, we wait for the
# RFCOMM connection on the PTY, then emulate a Hayes compatible
# modem by responding OK to any AT command except ATD where we
# provide a CONNECT response, and channel pppd on the link.
#
# set up /etc/ipnat.conf
# /etc/rc.d/ipnat forcestart
#

debug()
{
    logger -p daemon.debug -t dun "$*"
}

send()
{
    debug "< $*"
    printf "$*\r\n"
}

modem()
{
    while
	read cmd
    do
	debug "> $cmd"
	case $cmd in
	[aA][tT][dD]*)
	    send "CONNECT"
	    return 0
	    ;;
	[aA][tT]*|"")
	    send "OK"
	    ;;
	*)
	    send "ERROR"
	    ;;
	esac
    done
    return 1
}

dun()
{
    debug "Starting MODEM"
    modem || return 1
    debug "Starting PPP"
    # TODO - can remove sudo here?
    sudo pppd ${ADDR} nodetach nocrtscts nodefaultroute noauth linkname ${LINKNAME} ms-dns ${DNS1} ms-dns ${DNS2}
}

if [ $(sysctl -n net.inet.ip.forwarding) -eq 0 ]; then
    echo "WARNING: net.inet.ip.forwarding is off"
    exit 0
fi

while
    rfcomm_sppd -m auth -s DUN -t ${PTY}
do
    dun 1<>${PTY} 0<&1
done

debug "Exiting..."


More information about the freebsd-bluetooth mailing list