Posts Tagged ‘3G’

Recently I bought an Airtel 3G connection using Huawei E1731Bu-1 USB modem. As usual, I wanted to get it working in Debian GNU/Linux amd64 version. As a first step, installed the following packages using apt-get.

sudo apt-get install ppp pppconfig wvdial

Normally this modem is detected properly, but I was curious to know the extra modules loaded when it is connected. So, I tried lsmod before and after connecting the device and found the following extra modules.

cdc_ether, mii, option, usbnet, usbserial, usb_storage, usb_wwan


First, I tried to configure wvdial since that seems to be the easiest thing to try. Google gave me reference to PJP’s website.


He was kind enough to answer my questions also.

Pon and Poff

WvDial is great. But, I wanted to try Pon and Poff also. They offer a few advantages over wvdial. As an “original” command, many distributions support them out of the box where as wvdial has to be installed separately. There used be a lot of problems in using WvDial on ARM based systems because of getcontext/setcontext support on ARM.

Already I experienced that while using EC1261 Tata Photon, posted the following on Debian forum.



For my Debian desktop, I used pppconfig with the following configuration. But, it did not create a proper /etc/chatscripts/airtel. So, I had to update it to the one given at bottom.

Change 98xxxxxxxx to the mobile number associated with the modem.

pppconfig options

Create Create a connection

Provider Name: airtel
Configure Nameservers (DNS): None
Authentication Method for airtel: Peer Authentication Protocol
User Name: 98xxxxxxxx
Password: 98xxxxxxxx
Speed: 460800
Pulse or Tone: Tone
Phone Number: *99#
Choose Modem Config Method: No
Manually Select Modem Port: /dev/ttyUSB0

Finished Write files and return to main menu.

For the Debian laptop, instead of using pppconfig, I just copied the following generated files from desktop, set the ownership and permissions properly.

cp /path/to/chatscripts/airtel /etc/chatscripts/airtel
chown root:dip /etc/chatscripts/airtel
chmod 640 /etc/chatscripts/airtel

cp /path/to/ppp/pap-secrets /etc/ppp
chown root:root /etc/ppp/pap-secrets
chmod 600 /etc/ppp/pap-secrets

cp /path/to/ppp/peers/airtel /etc/ppp/peers/airtel
chown root:dip /etc/ppp/peers/airtel
chmod 640 /etc/ppp/peers/airtel

That is all. You could use pon/poff to connect and disconnect to the network.

pon airtel
poff airtel

MobilePartner Application

Surprisingly, I could get Airtel application to work. Note that we absolutely do not require this to connect to the network. But, it is good to have it, since it is easy to check 3G Balance using *123*11#. It is also helpful while sending and receiving SMS.

There is a CDROM device associated with the modem. It could be found using the “dmesg” command.

sr1: scsi-1 drive
sr 12:0:0:0: Attached scsi CD-ROM sr1

That means the device is /dev/sr1. Just mount it and install it.

sudo mount /dev/sr1 /media/cdrom
cp -fr /media/cdrom/Linux /tmp
cd /tmp/Linux
sudo ./install

You may find a few errors because it is trying to install “NDIS” driver, but it could be ignored since we are not planning to use NDIS driver to connect to the network. By default it is installed in /usr/local/airtel directory. Start the “/usr/local/airtel/MobilePartner” application.


These are the Configurations I used.


cat /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","airtelgprs.com"
Modem Type = Analog Modem
Phone = *99#
Username = 98xxxxxxxx
Password = 98xxxxxxxx
New PPPD = yes
Modem = /dev/ttyUSB0
Baud = 460800
Stupid Mode = 1


cat /etc/chatscripts/airtel
# This chatfile was generated by pppconfig 2.3.18.
# Please do not delete any of the comments. Pppconfig needs them.
# ispauth PAP
# abortstring


# modeminit
'' ATZ
OK 'ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0'
OK 'AT+CGDCONT=1,"IP","airtelgprs.com"'

# ispnumber
# ispconnect
# prelogin

# ispname
# isppassword
# postlogin

# end of pppconfig stuff


cat /etc/ppp/pap-secrets
# /etc/ppp/pap-secrets
# This is a pap-secrets file to be used with the AUTO_PPP function of
# mgetty. mgetty-0.99 is preconfigured to startup pppd with the login option
# which will cause pppd to consult /etc/passwd (and /etc/shadow in turn)
# after a user has passed this file. Don't be disturbed therefore by the fact
# that this file defines logins with any password for users. /etc/passwd
# (again, /etc/shadow, too) will catch passwd mismatches.
# This file should block ALL users that should not be able to do AUTO_PPP.
# AUTO_PPP bypasses the usual login program so it's necessary to list all
# system userids with regular passwords here.
# ATTENTION: The definitions here can allow users to login without a
# password if you don't use the login option of pppd! The mgetty Debian
# package already provides this option; make sure you don't change that.

# INBOUND connections

# Every regular user can use PPP and has to use passwords from /etc/passwd
* hostname "" *

# UserIDs that cannot use PPP at all. Check your /etc/passwd and add any
# other accounts that should not be able to use pppd!
guest hostname "*" -
master hostname "*" -
root hostname "*" -
support hostname "*" -
stats hostname "*" -

# OUTBOUND connections

# Here you should add your userid password to connect to your providers via
# PAP. The * means that the password is to be used for ANY host you connect
# to. Thus you do not have to worry about the foreign machine name. Just
# replace password with your password.
# If you have different providers with different passwords then you better
# remove the following line.

# * password

"98xxxxxxxx" airtel "98xxxxxxxx"


cat /etc/ppp/peers/airtel
# This optionfile was generated by pppconfig 2.3.18.
connect "/usr/sbin/chat -v -f /etc/chatscripts/airtel"
user "98xxxxxxxx"
remotename airtel

Read Full Post »

%d bloggers like this: