GPRS network connection for the iPAQ

Introduction

In this document, I outline the steps necessary to get an iPAQ running Familiar Linux on the net via GPRS using a Bluetooth-capable phone.

Hard- and software

Provider

Belgian wireless carrier Base.

Steps

Get Bluetooth working

There's various HOWTO's available on getting Bluetooth functioning on (Familiar) Linux. Tip: use Bluez. If you are using the Opie image of Familiar 0.8.4, you will have to replace /bin/bluepin with a shell script like this one:

#!/bin/sh
echo -n PIN:
cat /etc/bluetooth/pin
exit 0

Find the hardware address of the phone

Use hcitool to find the various bluetooth devices in your neighbourhood. Provided you've made the phone broadcast its presence, it should show up in the scan.

~ # hcitool scan
Scanning ...
   <address> <friendly name>

Find the channel for dial-up networking

Check on what channel the phone provides dial-up networking (DUN):

sdptool search --bdaddr <bd> DUN

where <bd> is the hardware address of your mobile phone as detected by hcitool scan.

Bind rfcomm

I decided to bind /dev/rfcomm0 to the DUN channel of my phone.

/etc/init.d # cat bind_dun
rfcomm bind 0 <bdaddr> <channel>
mknod -m 666 /dev/rfcomm0 c 216 0

Configure PPP

I assume you have the point-to-point protocol set up on your device already. If not, ipkg search *ppp* is your friend.

On Familiar 0.8.x, the pppd options were changed versus 0.7.x. The file now only contains a minimal lock as option. I prefer the following:

---------------- cut and paste from here ----------------
cat > /etc/ppp/options << EOF
-detach
defaultroute
nocrtscts
lock
noauth
lcp-echo-interval 5
lcp-echo-failure 3
usepeerdns
460800
local
asyncmap 0
EOF
------------------------ end cut ------------------------

Now you'll need a chat script to tell the phone what to do.

---------------- cut and paste from here ----------------
cat > /etc/ppp/chat.gprs.base << EOF
ABORT "BUSY"
"" "\d"
SAY "Resetting modem\n"
"" "atz"
SAY "Dialing\n"
OK 'AT+cgdcont=1,"IP","gprs.base.be"'
OK "ATD*99#"
TIMEOUT 60
CONNECT ''
SAY "Connected\n"
EOF
------------------------ end cut ------------------------

You'll also need to provide some additional options for pppd:

---------------- cut and paste from here ----------------
cat > /etc/ppp/peers/base_gprs << EOF
debug
noauth
usepeerdns
/dev/rfcomm0 460800
460800
user base
password base
local
nocrtscts
defaultroute
noipdefault
connect '/usr/sbin/chat -f /etc/ppp/chat.gprs.base -r /dev/console'
EOF
------------------------ end cut ------------------------

Get connected

Start pppd as follows:

~ # pppd call base_gprs

If all goes well (and only if you changed the /etc/ppp/options file), you should see something like this:

Reseting modem
Dialing...
Connected
Serial connection established.
using channel 13
Using interface ppp0
Connect: ppp0 <--> /dev/rfcomm0

Check routing

As I had a default route already (via the USB connection in the cradle), I had to replace it:

route del default
route add default ppp0