Monday, April 26, 2010

Airtel GPRS Internet on Your Linux PC through USB Cable

Internet through GPRS is not a joyride, but you might need it during some bad times when your ISP is down, broadband cabling in your area is messed up, or you are on the move. In such circumstances you may pair your mobile phone with your pc and easily get connected to the Internet. Here are some details on how to get internet working on your pc using GPRS in your Airtel Mobile Phone.

First, you need to active GPRS on your Airtel mobile phone. Dial  *567*11# to activate gprs and dial *567*13# to get mobile internet. Usually Airtel (or any other mobile service provider) will send settings which you will have save/install on your mobile phone. After that you should recharge your prepaid Airtel mobile phone with Rs. 98/- (as of 27th April, 2010) to get unlimated GPRS internet access for one month.

Next, you need to install ppp and wvdial on your Linux PC. Then change your /etc/wvdial.conf file to read:

[Dialer Defaults]
Init1 = AT+CGDCONT=1,"IP","","",0,0
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
stupid mode = 1
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM0
ISDN = 0
Phone = *99#
Password = manmath
Username = manmath

(You might change the Username and Password the way you like, the above is just an example)

Additionally you should also consider adding the following few lines to your /etc/sysctl.conf as a root user. It will reduce packet transfer overhead considerably.

net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_no_metrics_save = 1

That's it! Now connect your Airtel Mobile phone to your PC through USB cable, and as a root user (su or sudo, whatever appropriate in your case) enter wvdial in a terminal. And lo! You are connected to the web. If you want to connect to web as a non-root user, follow this link for further instructions.

You can also use Airtel SIM in your USB modem and connect to the Internet. For this you will have to use "Modem=/dev/ttyUSB0" in place of "Modem = /dev/ttyACM0" in your /etc/wvdial.conf


alpha1 said...

Tell me the settings for CDMA modem - I have Photon +, and on PCLOS 2010, all I can see is GPRS EDGE modem settings, not the CDMA.

It also asks for a PIN for the SIM.

We all know that in India, we don't get any of these things with mobile broadband.

manmath sahu said...

Hi Alpha!,

- Install wvdial (apt-get install wvdial)
- Open a terminal
- Be root user (sudo su)
- Type wvdialconf/etc/wvdial.conf (this will detect the modem and install)
- Edit /etc/wvdial.conf on terminal using your favorite text editor.
- Delete the semicolon before the last three lines, i.e., phone, username and password.
- Enter the following details in that file:
stupid mode=1
- Save the file and exit terminal.
- Now run wvdial as root user, you will get connected.

To run wvdial as a non-root user follow the instructions mentioned in the original post.

alpha1 said...

Thanks will try this out.

I actually got Mint/Ubuntu working pretty easily - for mobile as well as wi-fi.

Now will do the same for PCLOS ... I had actually hoped that PCLOS/Madriva have better GUI based configurations though.

Right now my distros have been narrowed to Mint and PCLOS.

Any idea about setting up nvidia geforce 4000 card?

Tried many times on Mint and failed epically each time.

manmath sahu said...

Hi Alpha1,

Better try the latest PCLinuxOS 2010.07. I am sure your Nvidia card will be autoconfigured.

Thanks for dropping by.

Touch Screen on Linux said...

Interesting blog. It would be great if you can provide more details about Linux PC. Thanks you for this nice information.

bala said...

Hi I follow your instruction but its display this error how to solve....
root@embdes-laptop:/home/embdes# /etc/wvdial.conf
bash: /etc/wvdial.conf: Permission denied

How about this