PPP over GPRS from a UNIX machine

If you have a machine which will run Paul's PPP Package (Linux, xBSD, Solaris, ...), then

FreeBSD/OpenBSD PPP

Alternatively, if you want to use the user-space PPP daemon that ships with FreeBSD and OpenBSD, your configuration file should look something like this. N.B. this configuration is for ppp(8); FreeBSD calls the other PPP system (see above) pppd(8).

IRDA on Linux

You can use the Linux IRDA support to talk to your GPRS phone. Here's how to get IrDA running (tested on a Sony Vaio N505x, running RedHat Linux, with a 2.4.12 kernel, compiled with the "CONFIG_IRDA_FAST_RR=y" option):
  1. Add the following to /etc/modules.conf
    
    # Linux IrDA
    alias tty-ldisc-11 irtty
    alias char-major-161 ircomm-tty
    alias irda0 nsc-ircc 
    options nsc-ircc dongle_id=0xe
    pre-install nsc-ircc setserial /dev/ttyS2 port 0 irq 0
    
  2. Start the IrDA sub system
    
    modprobe nsc-ircc
    modprobe ircomm
    modprobe ircomm-tty
    modprobe irtty
    # limit max baud rate to 115200 to avoid MIR/FIR bug
    echo 115200 > /proc/sys/net/irda/max_baud_rate 
    irattach irda0 -s 1 
    
  3. Check IrDA has discovered the phone
    
    user@host$ cat /proc/net/irda/discovery 
    IrLMP: Discovery log:
    
    nickname: T39, hint: 0x9124, saddr: 0x8dbbfc0a, daddr: 0x26b5068c
    
  4. Check ircomm works by using dip
    
    root@host# dip -t
    DIP: Dialup IP Protocol Driver version 3.3.7o-uri (8 Feb 96)
    Written by Fred N. van Kempen, MicroWalt Corporation.
    
    DIP> port ircomm0
    DIP: tty: lock: UUCP user uucp unknown!
    DIP> term
    [ Entering TERMINAL mode.  Use CTRL-] to get back ]
    
    at
    OK
    
    [ Back to LOCAL mode. ]
    DIP> quit
    
You can now use /dev/ircomm0 as the serial device in /etc/ppp/peers/gprs-eric.

PPP debug output

This is a trace from a successful GPRS connection using ppp v2.4.1 and the scripts linked above, on an Ericsson R520m. (To get this output, edit /etc/ppp/peers/gprs-eric to add a line with the word 'debug', and add '-e' to the calls to chat.

drummond$ pppd call gprs-eric
GPRS Modem init: press <ctrl>-C to disconnect
+++ATATQ0V1&C1
OK
ATE1
OK
AT&F
OK
AT+CMEE=1
OK
 + defining PDP context
AT+CGDCONT=2,"IP","mob.cl.cam.ac.uk","0.0.0.0",0,0
OK
 + defining QoS requirements
AT+CGQREQ=2,0,0,0,0,0
OK
AT+CGQMIN=2,0,0,0,0,0
OK
 + attaching to GPRS
AT+CGATT=1
OK
 + requesting data connection
AT+CGDATA="PPP",2
CONNECT
 + connected
Serial connection established.
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS1
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xa2594e61> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <pcomp> <accomp> <auth chap MD5>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <pcomp> <accomp> <auth chap MD5>]
rcvd [LCP ConfRej id=0x1 <magic 0xa2594e61>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [CHAP Challenge id=0x1 <a43725fg7475287e0913d904780f9b7f>, name = "\37777777714\37777777714\37777777714\37777777714"]
sent [CHAP Response id=0x1 <5ac1c07c9bcfdcdd9d99eea97458ec5a>, name = "tjd21"]
sent [CHAP Response id=0x1 <5ac1c07c9bcfdcdd9d99eea97458ec5a>, name = "tjd21"]
rcvd [CHAP Success id=0x1 ""]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0>]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
rcvd [LCP ProtRej id=0x3 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
rcvd [IPCP ConfReq id=0x1 <addr 128.232.98.254>]
sent [IPCP ConfAck id=0x1 <addr 128.232.98.254>]
rcvd [IPCP ConfNak id=0x1 <addr 128.232.98.23>]
sent [IPCP ConfReq id=0x2 <addr 128.232.98.23>]
rcvd [IPCP ConfAck id=0x2 <addr 128.232.98.23>]
local  IP address 128.232.98.23
remote IP address 128.232.98.254
Script /etc/ppp/ip-up started (pid 22420)
Script /etc/ppp/ip-up finished (pid 22420), status = 0x0
At this point the link is up. Bringing it back down looks like this:

Terminating on signal 2.
Script /etc/ppp/ip-down started (pid 22450)
sent [LCP TermReq id=0x3 "User request"]
rcvd [LCP TermAck id=0x3]
Connection terminated.
Connect time 0.3 minutes.
Sent 259 bytes, received 227 bytes.
 + sending break
 + dropping data connection
OK
 + disconnecting from GPRS
AT+CGATT=0
OK
 + disconnected.
Serial link disconnected.
Waiting for 1 child processes...
  script /etc/ppp/ip-down, pid 22450
Script /etc/ppp/ip-down finished (pid 22450), status = 0x0
drummond$ 


This work is made possible by the support of Benchmark Capital and Vodafone
$Id: unix.html,v 1.4 2003/10/20 09:10:04 tjd21 Exp $