Wednesday, March 12, 2008

Making GPRS Vodafone card work on Ubuntu

I spent a couple of hours trying to make a GPRS Vodafone PCMCIA card to work in my Ubuntu laptop. And It's working, and here are my tips. But I believe the following instructions should be useful in other Linux distributions.

Make sure the following packages are installed:
sudo apt-get install pcmcia-cs
sudo apt-get install gnome-ppp
Configuring Gnome-ppp
There some Vodafone Egypt specific data needed for connection
APN: internet.vodafone.net
user: internet
password: internet
Type on a shell the following command and try to know the device assigned to the pcmcia GPRS card. In my laptop it was /dev/ttyS3. I noticed other blogs mentioning cards assigned to USB devices! So look carefully. You may need to eject and reinsert the card again and observe the messages on the syslog.
tail -f /var/log/syslog
After knowing the device assign to GPRS card, click "Setup" and choose the device from the list.

Select speed like 115200, there are bloggers mentioning 460800 so you may try it later. It doesn't work for me.

Select "Tone" as the phone line type.

Click on "Init Strings" and enter the following lines in Init2 and Init3 respectively.
Init2: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3: AT+CGDCONT=1,"IP","internet.vodafone.net"
.. and uncheck "wait for dialtone"

After I configured gnome-ppp I tried to connect, I used *99***1# as the dial number, clicked connect, and see the log. And I got the pppd died unexpectedly error message, that very message traveled me back 12 years ago, trying and failing to make ppp work. My frustration didn't last more than 10 minutes, I figured out that gnome-ppp was trying and failed to open wvdial files in /etc/ppp/peers, so i searched the net and get me a bunch of wvdial conf files, put them in place and here are them.

# File: /etc/ppp/peers/wvdial
# WvDial options
#
plugin passwordfd.so
#
noauth
name wvdial
defaultroute
replacedefaultroute
noipdefault
usepeerdns
novj
#File: /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyS3
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 = AT+CGDCONT=1,"IP","internet.vodafone.net"
Area Code =
Phone = *99***1#
Username = internet
Password = internet
Ask Password = 0
Dial Command = ATDT
Stupid Mode = 1
Compuserve = 0
Force Address =
Idle Seconds = 3000
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1

[Dialer Another]
Init3 = AT+CGDCONT=1,"IP","internet.vodafone.net"
And then i tried again, and it worked this time, it connects, and fetch the DNS and I browsed to google.com successfully. But for only 120 seconds. Excactly 120 secs every time i connect and then ppd dies unexpectedly, as the error keeps saying. I noticed after some more google results that two options called lcp-echo-interval and lcp-echo-failure and that one of them was set to 30 that's the interval and the other was set to 4 and that was the number of failure and then pppd should die if it didn't receive response. But when i set those options to 0 the connection get stable and didn't disconnect. Those lcp values should be (or i add them) to '/etc/ppp/options'.

###################
# /etc/ppp/options
###################
asyncmap 0
noauth
crtscts
lock
hide-password
modem
proxyarp
lcp-echo-interval 0
lcp-echo-failure 0
noipx
novj
And that's it, now I can launch gnome-ppp and connect, but as a root. I created a gnome-ppp "gksu gnome-ppp" launcher on gnome panel.

And I can launch it from command line by `wvdial`.

The connection speed may not be the useful for real work, but it's faster


Related links:

2 comments:

dr.zizo said...

Asalamo alikom, sorry for the interruption but I am windows user and I want to change to Linux , I got a cd for ubunto but without any application, a friend told me that open suse is much better than ubunto so I downloaded it from the web.
in ur opinion which is better ? and can u help me later if I faced any problem. again I am sorry for this interruption, my email is zizo313@hotmail.com

Ibrahim Ahmed said...

dr.zizo: Alikom assalam, It's too hard recommending open suse over ubuntu or vice versa, both are polished and rich. I chose ubuntu over Fedora and Suse, because it is well supported by the community. That means you will easily find packages, tutorials and help. I recommend Ubuntu if you have a fast internet connection, cause as you said Ubuntu CD comes with the basic applications only like OpenOffice, firefox and utilities. If internet connection is not always available then go for Open Suse, but make sure the CD you downloaded is not Live CD.

And you're most welcome Dr.zizo, anytime you need help just send me an email: ia dot ibrahim at gmail dot com

How can you work with a JSON value if you know nothing about it?

I have talked about the difficulty of typing certain JSON values coming from some APIs. The JSON is just very complicated. When I do that,...