Saturday, June 28, 2008

Internet via GPRS in Linux

Its possible to access internet in Linux via GPRS even if you don't have drivers for your Cellphone. Thats all the magic of Linux Kernel.

Method 1

  • Connect the mobile via USB cable.
  • Open terminal and type su to become root.
  • It will ask for the root password, type in there.
  • Then use the command

    wvdialconf /etc/wvdial.conf

    Your phone will be detected as Modem
  • Then using a Text Editor open wvdial.conf using commands

    kwrite /etc/wvdial.conf (for KDE)

    gedit /etc/wvdial.conf (for GNOME)

    When we issued command in point 4, it showed the address of your phone that in which USB port it has been connected. note it down from there.
    "Modem = /dev/***"
  • When Text Editor opens the file, erase everything and paste the following code

    [Dialer Defaults]
    Modem = /dev/ttyUSB0 # <-- Replace it with the reading you got
    Phone = *99#
    Username = aa
    Password = bbc
    Baud = 230400
    Init1 = ATZ
    Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    ISDN = 0
    Modem Type = Analog Modem
    Carrier Check = No
  • This will configure your mobile phone as a modem

    To dial the internet connection, type

    wvdial

    If everything goes fine it would say that connected successfully.
    Press Ctrl+C to disconnect.

Method 2

  • Open Terminal and type the command

    lsusb

    Bus 001 Device 004: ID 0421:0445 Nokia Mobile Phones
  • Then use command

    /sbin/modprobe usbserial vendor=0x(vid) product=0x(pid)

    Ex in my case for above output

    /sbin/modprobe usbserial vendor=0×421 product=0×445
  • Then using a Text Editor open wvdial.conf using commands

    kwrite /etc/wvdial.conf (for KDE)

    gedit /etc/wvdial.conf (for GNOME)
  • Paste following contents in the file

    [Dialer Defaults]
    Init1 = ATZ
    Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    Modem Type = USB Modem
    ISDN = 0
    New PPPD = yes
    Phone = *99#
    Modem = /dev/ttyACM0
    Username = b
    Password = a
    Baud = 460800
  • This will configure your mobile phone as a modem

    To dial the internet connection, type

    wvdial

    If everything goes fine it would say that connected successfully.
    Press Ctrl+C to disconnect.

No comments:

Technology & Computers