Saturday, July 11, 2009

Connect BSNL's CDMA WLL clarity phone in ubuntu (jaunty)9.04;

Here i will give u the complete steps to connect BSNL's CDMA wll clarity phone in ubuntu (jaunty)9.04;
for connecting a usb modem in linux, we require:
1.usb serial diver
2.wvdial package
STEP1:
In ubuntu9.04, the usbserial driver is not a module(so,you cannot use the 'modprobe usbserial vendor=... product=...' command any more) the driver is built into the kernel.so,we have to pass the venor id and product id at the kernel command line.
(This step is required only if your kernel version is 2.6.28-11-generic.If it is 2.6.28-13-generic or later, this step can be skipped.To know which version is your's, in the terminal, type; uname -r )
The Kernel command line is the command that the grub boot manager uses to load the kernel.
The kernel command is set in the grub configuration in the file /boot/grub/menu.lst . At the bottom of the file you will find the default startup entry created by ubuntu (taken from my menu.lst):
title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 4ad20c2a-ceda-45bf-b72f-8d6ec59266a7
kernel /vmlinuz-2.6.28-11-generic root=UUID=b52debfa-eb68-4db5-b3a0-e484d74697d8 ro quiet splash
initrd /initrd.img-2.6.28-11-generic
quiet
the part that interests us is the line that starts with 'kernel'. To use the usbserial driver you have to add your parameters to this line so start editing the file by opening it in a texteditor with admin-rights by typing in a terminal:
for gnome: 'gksu gedit /boot/grub/menu.lst'
or(kde: 'kdesudo kate /boot/grub/menu.lst' , others: 'sudo nano -w /boot/grub/menu.lst')
Now go to the end of the File and Copy&Paste the block above so that you have the same boot config twice, like this you always have the original boot config if your configuration refuses to work (make sure not to change anything in the original configuration or you might get an unbootable system!):
eg:
title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 4ad20c2a-ceda-45bf-b72f-8d6ec59266a7
kernel /vmlinuz-2.6.28-11-generic root=UUID=b52debfa-eb68-4db5-b3a0-e484d74697d8 ro quiet splash
initrd /initrd.img-2.6.28-11-generic
quiet
title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 4ad20c2a-ceda-45bf-b72f-8d6ec59266a7
kernel /vmlinuz-2.6.28-11-generic root=UUID=b52debfa-eb68-4db5-b3a0-e484d74697d8 ro quiet splash
initrd /initrd.img-2.6.28-11-generic
quiet
title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid 4ad20c2a-ceda-45bf-b72f-8d6ec59266a7
kernel /vmlinuz-2.6.28-11-generic root=UUID=b52debfa-eb68-4db5-b3a0-e484d74697d8 ro single
initrd /initrd.img-2.6.28-11-generic
quiet
title Ubuntu 9.04, memtest86+
uuid 4ad20c2a-ceda-45bf-b72f-8d6ec59266a7
kernel /memtest86+.bin
quiet
### END DEBIAN AUTOMAGIC KERNELS LIST
title Other operating systems:
root
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1
Now take the first entry and first edit the title so that you can identify which config is yours (you can put anything you want there, I'll simply append custom)
Now add your parameters in the form module.option=value :
title Ubuntu 9.04, kernel 2.6.28-11-generic custom
uuid 4ad20c2a-ceda-45bf-b72f-8d6ec59266a7
kernel /vmlinuz-2.6.28-11-generic root=UUID=b52debfa-eb68-4db5-b3a0-e484d74697d8 ro quiet splash usbserial.vendor=0x15eb usbserial.product=0x0001
initrd /initrd.img-2.6.28-11-generic
quiet
Now double check that the settings are in the kernel line and didn't get broken up into a new line and save the file. Now you will have to reboot and select your new configuration on the next boot. (If you put your configuration above the others it should be the new default.)

STEP2:
You have to download the wvdial package from another computer having an internet connection from
http://packages.ubuntu.com/jaunty/i386/libxplc0.3.13/download
http://packages.ubuntu.com/jaunty/i386/libwvstreams4.4-base/download
http://packages.ubuntu.com/jaunty/i386/libwvstreams4.4-extras/download
http://packages.ubuntu.com/jaunty/i386/libuniconf4.4/download
http://packages.ubuntu.com/jaunty/i386/wvdial/download
Copy and extract .deb files to a USB stick, paste them to the ubuntu 9.04 running pc into /var/cache/apt/archives/ directory using sudo nautilus from terminal(not necessory). Double click each .deb icon to install it.
YOU HAVE TO INSTALL THEM IN ABOVE ORDER!
STEP3:
Type lsusb in the terminal it will display the devices that are connected in the usb ports
Look for your phone device there
it displays like below ...

[root@localhost ~]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 15eb:0001
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[root@localhost ~]#

HERE 15eb is the vendor id and 0001 is the product id
Now create the rules file named as /etc/udev/rules.d/50-cdma.rules
procedure for creating a file

In the terminal type sudo vi /etc/udev/rules.d/50-cdma.rules. press Esc+i for typing the rules in to it

SUBSYSTEM=="usb",SYSFS{idProduct}=="0001",SYSFS{idVendor}=="15eb",RUN+="/sbin/modprobe usbserial vendor=0x15eb product=0x0001"
SUBSYSTEM=="usb",SYSFS{idProduct}=="0001",SYSFS{idVendor}=="15eb",RUN+="/sbin/modprobe ppp_generic"

Now press ESC key and type :wq! and then press enter to save and quit
reboot the system and give the command sudo wvdialconf now the modem gets detected and gives some thing like this
root@localhost ~]# wvdialconf
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

Modem Port Scan<*1>: S0 S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB0<*1>: Modem Identifier: ATI -- ERROR
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Max speed is 9600; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
WvModem<*1>: Cannot get information for serial port.
ttyUSB1<*1>: ATQ0 V1 E1 -- �ܺ�[10]
ttyUSB1<*1>: failed with 2400 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
[root@localhost ~]#


STEP4:
Open the file wvdial.conf by giving the command as follows for editing and configuring the connection
sudo vi /etc/wvdial.conf
and press Esc and then i for typing
add the following script in to that file
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = at+crm=1;+cmux=1;+cps=33;+cta=0
Modem Type = Analog Modem
Baud = 460800
Stupid Mode = 1
Modem = /dev/ttyUSB0
ISDN = 0
Phone = #777
Password =
Username =
Auto DNS
Check Def Route
now press ESC key and type :wq! and then press enter to save and quit

In the terminal issue the command as sudo wvdial
now you will be able to get connected to the internet ...
To get disconnected from the internet press Ctrl + C
STEP 5:
To connect to the internet ;
method 1:use the command sudo wvdial
method 2:Use the gnome ppp dialer;
gnome-ppp is a graphical frontend to wvdial.To install it,connect to internet using wvdial command and then type the command $ sudo apt-get install gnome-ppp. You will find it in the Applications menu ( Menu => Internet => Gnome-PPP ) and the configuration is probably straightforward.
Configuration
In the Gnome-ppp window, fill login, password and telephone number of the Internet Service Provider(eg:#777).
Click “setup”
in the modem tab;
device: type “ /dev/ttyUSB0”. press “Detect” button
Type: Analog modem
phone line: tone
press “init strings”
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = at+crm=1;+cmux=1;+cps=33;+cta=0
If you get an "immediate" disconnection: in "Parameters" / "Options", unmark "check carrier line"
To connect, you must be in the gnome-ppp window. Click in "Connect".

2 comments:

  1. getting error "/dev/ttyUSB0 file not found.."
    what should i do?, help me ,please bro

    ReplyDelete
  2. Thnx...
    It really works for me...
    But now i cant connect to net...I m using ubuntu 8.10..I usually updates the system...After the last update, i cant connect to net..Dont knw wht the reason is, may be the updates?
    When i type sudo wvdial, I get the following message.....

    wahab@wahab-desktop:~$ sudo wvdial
    --> Ignoring malformed input line: "Auto DNS"
    --> Ignoring malformed input line: "Check Def Route"
    --> 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+crm=1;+cmux=1;+cps=33;+cta=0
    at+crm=1;+cmux=1;+cps=33;+cta=0
    OK
    --> Modem initialized.
    --> Sending: ATDT#777
    --> Waiting for carrier.
    ATDT#777
    CONNECT
    ~[7f]}#@!}!}!} }-}#}%B#}%}'}"}(}"{B~
    --> Carrier detected.
    Starting PPP immediately.
    --> Starting pppd at Fri Aug 7 19:05:22 2009
    --> Pid of pppd: 6152
    --> Using interface ppp0
    --> pppd:
    w蝝8]X�蝝8] x蝝8]
    --> pppd: �w蝝8]X�蝝8] x蝝8]
    --> pppd: �w蝝8]X�蝝8] x蝝8]
    --> pppd: �w蝝8]X�蝝8] x蝝8]
    --> pppd: �w蝝8]X�蝝8] x蝝8]
    --> Disconnecting at Fri Aug 7 19:05:26 2009
    --> The PPP daemon has died: Authentication error.
    --> We failed to authenticate ourselves to the peer.
    --> Maybe bad account or password? (exit code = 19)
    --> man pppd explains pppd error codes in more detail.
    --> I guess that's it for now, exiting
    --> The PPP daemon has died. (exit code = 19)

    i dont knw what to do..
    plz help me...

    ReplyDelete

Followers