[Ilugc] HOWTO on connecting to the Internet with a mobile phone

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Wed Feb 20 18:22:09 2008

Hello friends,

As promised I am sending the HOWTO on Internet connectivity with  a
mobile phone using GPRS/EDGE. There is another method using CDMA but GSM
is far more common and moreover I have never used CDMA.

I guess this writeup will be relevant to people using BSNL, Airtel,
Vodafone etc. Basically anyone with a GSM mobile with GPRS support can
connect to Internet using linux. ( To know this check for the '(i)'
symbol in the mobile's '0' key)

The speeds achievable  depend upon if your mobile and the particular BTS
unit ( the "mobile tower" in common parlance).

In case both the handset and the particular tower in the area support
EDGE, you can get close to 112 kilobits per second. Otherwise you can
expect typical dialup speeds of ~ 30 kilobits per second. You might get
more but this is the average. 

I have not been very accurate about the speeds given above.

How to connect?

Firstly the mobile has to be configured correctly. This can be tested
very easily by pressing the '0' key for few seconds. If you connect to
the Internet you are set. Otherwise you have to ask your service
provider for support. You can check for EDGE support by looking for an
'E' display in the panel. (Thanks to Noorul Islam for this)

I get only 'G' in Tambaram. Which means I can get only GPRS speeds.

Regardless the configuration is same.

Now that you have configured your mobile to talk GPRS/EDGE, next step is
compiling the linux kernel to create the /dev/ttyACM0 device. Noorul
asked me to check the ACM support in the kernel. I got it right after a
couple of tries.

(Interestingly OpenBSD worked out of the box for me. I first figured
this out on OpenBSD.)

So once you cross this second hurdle, then you can refer to this HOWTO
for the remaining rituals.

Get hold of  a cheap USB cable with one end host interface and the other
end device. It is very cheap. I guess mobile phone shops sell it at a
huge price but you are better off buying the same thing from Richie
street.

I used the same cable I use for my camera/card reader.

Once you connect your mobile you have to select the appropriate mode in
the phone. Since mine is a Nokia 3110 Classic I selected "Nokia phone
mode".

Next step is the most important one.

Getting the PPP handshake right. For that you need three files. One is the
chat script. Another is the options configuration file. You also  need
the pap-password file or chap-password. It is very likely you are going
to use PAP authentication. But it is really trivial to figure this out.

I have attached my chat script here.

$ cat /etc/ppp/peers/gprs.chat

#----------------------------------------
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
"" AT
OK      AT+CGDCONT=1,"IP","gprssouth.cellone.in",""
OK       ATDT*99#
'CONNECT'       '\c'
'TIMEOUT'       '5'

#----------------------------------------

And here is the options file.

$ cat /etc/ppp/peers/gprs

#----------------------------------------
/dev/ttyACM0
115200
noipdefault
defaultroute
nocrtscts
lock 
noauth
user ppp
usepeerdns
remotename bsnl
connect '/usr/sbin/chat -v -f /etc/ppp/peers/gprs.chat'
#----------------------------------------

Be sure to include "usepeerdns" or else you won't be able to resolve
host names.

Note that the password for BSNL is "ppp123". I have also attached my
/etc/ppp/pap-secrets
#----------------------------------------
# client server secret IP addresses
*       bsnl    ppp123
#----------------------------------------

After this you only have to type this as root.

# pon gprs

You can check for connectivity with ifconfig. It should list ppp0 as one
of the interfaces.

I also had to create the /etc/ppp device on gentoo.

# mknod /dev/ppp c 180 0

For other providers you have to change the chat script. Instead of
gprssouth.cellone.in, you have to use some other address. But I am
guessing that the remaining instructions should be 
by and large similar.

You can check the /var/log/messages file to figure out what is going on.

Be careful with the chat script as it can be quite unforgiving with
spaces, tabs and newlines.

Best of luck!

-Girish

Other related posts: