Setting up a UMTS connection using a KPN mobile connect card

Preparing

First you will need to see which serial port is used by your UMTS card.
So plugin your KPN Mobile connect card and start up the PCMCIA service.

# /etc/init.d/pcmcia start

Then you will see something like this in your dmesg output:

ttyS1 at I/O 0x2f8 (irq = 19) is a 16550A

So ttyS1 is our serial port.

Config files

Make sure to change the ttyS# in the config files.
vi /usr/bin/umtsinit

#!/bin/sh
DEFAULTPIN="0000";
TTYDEV="/dev/ttyS1";
if [ $1 ] ; then
PIN=$1;
else
PIN=$DEFAULTPIN;
fi
echo "at" > $TTYDEV;
sleep 1;
echo "at+cpin=\"$PIN\"" > $TTYDEV;
echo "PIN send to $TTYDEV";

vi /etc/ppp/peers/umts

/dev/ttyS1 460800
connect '/usr/sbin/chat -v -f /etc/ppp/chat-umts'
novj
crtscts
noauth
defaultroute
debug
nodeflate
noccp
noipdefault
noaccomp
usepeerdns

vi /etc/ppp/chat-umts

TIMEOUT 5
ECHO ON
ABORT 'nBUSYr'
ABORT 'nERRORr'
ABORT 'nNO ANSWERr'
ABORT 'nNO CARRIERr'
ABORT 'nNO DIALTONEr'
ABORT 'nRINGINGrnrnRINGINGr'
'' rAT
TIMEOUT 12
OK ATZ
OK 'AT+cgdcont=1,"IP","internet",,0,0'
OK ATD*99***1#

Start/Stop Script

vi /etc/init.d/umts

#!/bin/sh

case "$1" in
  start)
        echo "Starting up UMTS"
        echo "Checking for files"
        if [ -f /etc/ppp/chat-umts ] ; then
          echo "/etc/ppp/chat-umts                      [OK]"
         else
          echo "ERROR: The file /etc/ppp/chat-umts does not exist."
        fi

        if [ -f /etc/ppp/peers/umts ] ; then
          echo "/etc/ppp/peers/umts                     [OK]"
         else
          echo "ERROR: The file /etc/ppp/chat-umts does not exist."
        fi

        if [ -f /usr/bin/umtsinit ] ; then
          echo "/usr/bin/umtsinit                       [OK]"
         else
          echo "ERROR: The file /etc/ppp/chat-umts does not exist."
        fi
        echo "Shuting down network interfaces"
        ifdown eth0
        ifdown eth1

        /usr/bin/umtsinit
        sleep 10
        /usr/sbin/pppd call umts
        ;;
  stop)
        /usr/bin/poff
        ;;
  *)
        N=/etc/init.d/umts
        echo "Usage: $N start/stop" >&2
        exit 1
        ;;
esac

exit 0

Related Sites

http://www.xs4all.nl/helpdesk/mobielinternet/umts/linux/

Tags: ,
Copyright 2021. All rights reserved.

Posted February 23, 2007 by TroubleNow in category "linux