Thursday, June 18, 2009

Internet connection in Ubuntu using Aircel GPRS

INTERNET BROWSING USING AIRCEL GPRS

Requirement:

  • PC with Linux OS

  • Mobile phone with USB data cable

  • GPRS Enabled Aircel SIM card

  • wvdial application package in Linux OS. (Mostly available in all flavour of Linux OS)


Pre-Configuration:


  1. Ensure your mobile phone in data connection mode. By default, It is in Memory card connection mode.

  2. Open a terminal,

    # tail -f /var/log/messages.

  3. plugin the data cable of mobile in USB port and listen messages. It will show Product ID, Vendor ID and Port Number. It is also shows that New USB Modem is pluged in. You should be note it.

  4. Check that your Kernel recognise the device by viewing,

    # cat /proc/bus/usb/devices


    If it is shows the devices list then leave rest of points below. Otherwise do the following things.

  1. Open another terminal,

    # modprobe usbserial vendor=0x1111 product=0x2222

    In another terminal,

    # dmesg

    This shows that the USB device (Mobile) is recognised by kernel as a log message.

    (This should be made for Old Linux OS and not for recent Ones)]

  1. Reboot your machine, Then open terminal, and type

    #tail -f /var/log/messages

    Then insert the usb cable,This shows the USB devices recognised as below।


Jun 18 22:09:37 padhu-desktop kernel: [ 125.452018] usb 3-2: new full speed USB device using uhci_hcd and address 2

Jun 18 22:09:38 padhu-desktop kernel: [ 125.705635] usb 3-2: configuration #1 chosen from 1 choice

Jun 18 22:09:38 padhu-desktop kernel: [ 125.831801] cdc_acm 3-2:1.0: ttyACM0: USB ACM device

Jun 18 22:09:38 padhu-desktop kernel: [ 125.836367] usbcore: registered new interface driver cdc_acm

Jun 18 22:09:38 padhu-desktop kernel: [ 125.837118] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters


Aircel Mobile Offices:


Aircel pre-paid provides Mobile Internet Freedom Pack to their customers to make an internet browsing.

To activate for Three Day, Reacharge for Rs 14/= from nearest aircel easy recharge center.

For 30 Days, Reacharge for Rs 98/= from nearest aircel easy recharge center.

They will send the mobile office settings to your mobile. Save it. Username and Password is not required. Phone number for Dial-up the connection is '*99#'


Using wvdial:


  • In terminal,

    #wvdialconfig /etc/wvdial.conf

    This will create the wvdial configuration file.

  • Open /etc/wvdial.conf by using vi editor or nano, then remove ';' at the starting of every line.

    Then add some missed lines in the file. The correct content of wvdial.conf as below.

[Dialer Defaults]

Init1 = ATZ

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

Modem Type = USB Modem

Baud = 460800

New PPPD = 1

Modem = /dev/ttyACM0

ISDN = 0

Stupid Mode = 1

Phone =*99#

Username = a

Password = a

Init3 = AT+CGDCONT=1,"IP","aircelgprs.pr"

Dial Command = ATDT

Ask Password = 0

Compuserve =0

Auto DNS = 1

Flow Control = Hardware


  • Now unplug the USB Cable . Reinsert it after few sconds. In terminal

    # wvdial

    Now few details are showed. Internal IP and External IPs will be displayed. DNS IPs also displayed. At the end 'Connection was made' message displayed. Don't close the terminal. Start Browsing. After completion of browsing, terminate the connection by pressing 'Ctrl+C' in the terminal. After disconnecting internet, # prompt will come back.

The screen shot is as below

padhu@padhu-desktop:~$ sudo wvdial

[sudo] password for padhu:

--> WvDial: Internet dialer version 1.60

--> Cannot get information for serial port.

--> Initializing modem.

--> Sending: ATZ

ATZ

OK

--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

OK

--> Sending: AT+CGDCONT=1,"IP","aircelgprs.pr"

AT+CGDCONT=1,"IP","aircelgprs.pr"

OK

--> Modem initialized.

--> Sending: ATDT*99#

--> Waiting for carrier.

ATDT*99#

CONNECT

--> Carrier detected. Starting PPP immediately.

--> Starting pppd at Thu Jun 18 22:09:57 2009

--> Pid of pppd: 5793

--> Using interface ppp0

--> pppd: Џ����� ��� [01]

--> pppd: Џ����� ��� [01]

--> pppd: Џ����� ��� [01]

--> pppd: Џ����� ��� [01]

--> local IP address 10.1.7.248

--> pppd: Џ����� ��� [01]

--> remote IP address 192.168.100.101

--> pppd: Џ����� ��� [01]

--> primary DNS address 192.168.35.199

--> pppd: Џ����� ��� [01]

--> secondary DNS address 192.168.35.200

--> pppd: Џ����� ��� [01]

/etc/var/log/messages shows as below


Jun 18 22:09:57 padhu-desktop kernel: [ 145.029608] PPP generic driver version 2.4.2

Jun 18 22:09:57 padhu-desktop pppd[5793]: pppd 2.4.4 started by root, uid 0

Jun 18 22:09:57 padhu-desktop pppd[5793]: Using interface ppp0

Jun 18 22:09:57 padhu-desktop pppd[5793]: Connect: ppp0 <--> /dev/ttyACM0

Jun 18 22:09:57 padhu-desktop pppd[5793]: PAP authentication succeeded

Jun 18 22:09:57 padhu-desktop kernel: [ 145.176902] PPP BSD Compression module registered

Jun 18 22:09:57 padhu-desktop kernel: [ 145.248560] PPP Deflate Compression module registered

Jun 18 22:10:03 padhu-desktop pppd[5793]: local IP address 10.1.7.248

Jun 18 22:10:03 padhu-desktop pppd[5793]: remote IP address 192.168.100.101

Jun 18 22:10:03 padhu-desktop pppd[5793]: primary DNS address 192.168.35.199

Jun 18 22:10:03 padhu-desktop pppd[5793]: secondary DNS address 192.168.35.200

  • Ensure that your firewall should be configured suitabily to use USB Modem. Otherwise disable it if you are an Home user or short time browser.

Happy browsing......

by

Padhu