Connecting to an ISP with your iPAQ and a Nokia 8210

See also "Useful AT commands for 8210" below.
<disclaimer>I'm quite confident that this will work with most IR-capable GSM phones that can emulate a Hayes modem, and most ISPs that do PAP, but i have only tested it with an 8210 against Tele2 in Sweden. </disclaimer>

System requirements:

This document assumes that you have something like the "Familiar (v0.02-v0.5)" linux dist. on your iPAQ.

v0.5

ttySA2 is no longer initialized, so irattach can not and should not be used

v0.02

You need the IrDA kernel modules and the 'irattach' program, which was not included with v0.02 of the familiar dist. I got them from Jim Conner's ipaq.secret.org.uk.

Setup

First, you need some basic things like name resolution:

Make sure that /etc/nsswitch.conf contains something like

passwd:   files
group:    files

hosts:    files dns
networks: files
rpc:      files
netmasks: files
...
Several ISPs uses an M$-feature, which the PPP deamon can utilize (option usepeerdns) to create a resolv.conf in /etc/ppp, so make a symbolic link in /etc:
ln -s /etc/ppp/resolv.conf /etc/resolv.conf

Next, you need a chat-script that will do the dialling. My ISP uses PAP, so it is quite easy:

ABORT "BUSY"
"" "\d"
"" "ate1"
"" "atz"
OK "atdt???????"
CONNECT
Note the "ate1" send-string, which turns on echo. My Nokia 8210 seemed to have echo off by default. The ???'s in the script should be replaced by the phone number to your ISP

Using PAP, also means that you have to have an /etc/ppp/pap-secrets file. I like to generate mine on the fly, so that if my iPAQ gets in the wrong hands, my password will still be safe. This is the format of the pap-secrets file:

[user] [server] [password]
Since you probably don't know what server will pick up your call, a '*' in the server field is a good idea.

Finally, you need to call 'pppd' with a bunch of options. A script like :

#!/bin/sh

echo -n user:
read PPPUSERNAME
echo -n password:
read PPPPASSWORD

echo $PPPUSERNAME' * '$PPPPASSWORD > /etc/ppp/pap-secrets 

pppd /dev/ircomm0 115200 \ 
defaultroute usepeerdns \
nocrtscts noauth local lock \
connect ´chat -f /etc/ppp/chatfile' \
user $PPPUSERNAME

sleep 15 # wait for a connection

ifconfig | grep -A 6 ppp # show the connection

sleep 15 # wait some more

rm /etc/ppp/pap-secrets # remove the file containing your password

will do the trick.

Note: v0.02 of the familiar images do not have the /var/lock directory, so pppd will exit with an error message. Create this directory, and then run the script /root/backupToFlash (which is not bulletproof either, btw. To ensure flash writing, umount /usr/local before cutting power.)

To disconnect the PPP connection, I just hang up the phone or pull it out of reach from the iPAQ's IR eye. pppd will clean up once it times out.

IrDA stuff

Before you call the pppd script, the irda modules must be loaded, and 'irattach' must be running. Either write a clever /etc/modules.conf, or just put the following commands into the above script:

If you have a kernel that does not initialize /dev/ttySA2 (> 2.4.7):

insmod irda
insmod ircomm
insmod ircomm-tty
insmod sa1100_ir
sleep 1
ifconfig irda0 up
echo '1' > /proc/sys/net/irda/discovery

If you have ttySA2 (<= 2.4.3)

modprobe ircomm-tty
modprobe irtty
irattach /dev/ttySA2 -s &

Useful AT commands for the 8210

You need some kind of terminal emulator for this. Minicom works, and can be snarfed from debian-unstable for arm.

Extracting (all) phone book entries

  1. Select Character set (optional)
    AT+CSCS="8859-1"
  2. Select sim or phone memory
    AT+CPBS="SM" _or_ AT+CPBS="ME"
  3. Extract entries 1-250 (1-240 on my sim)
    AT+CPBR=1,240

Write a phone book entry

  1. Select memory and charset as above.
  2. Find a free entry, in my case 47
  3. Write entry
    AT+CPBW=47,"555-1234",129,"John Doe"

Send an SMS

  1. Select message format (Text, in this case)
    AT+CMGF=1
  2. Select charset as above (optional)
  3. Enter recipient number
    AT+CMGS="555-1234"
  4. Enter data, and end it with Ctrl-Z

Read SMS

Misc.

Further reading


Last update 2001-12-13
Tor-Åke Fransson   Tue Jan 23 18:17:28 CET 2001