HOWTO: Setup BSNL Data Card in Linux

Here’s how you can configure a BSNL CDMA data modem to work in Linux. The device I have is a HUAWEI EC325 meant for the 144 Kb/s connection, but this guide should work fine for other BSNL devices as well (2 Mb/s device, for eg.)

Let’s start off by installing the software. We’ll be needing wvdial and gnome-ppp. So let’s install that. On a Debian based system (Ubuntu, Mint, Elive etc.), do:

$ sudo aptitude update
$ sudo aptitude install wvdial gnome-ppp

Note: Since the net connection isn’t up and working just as yet (duh), make sure your installation CD/DVD is in the apt sources list before you issue the above commands. Use apt-cdrom add for that.

The next step is to setup wvdial. Follow these steps:

1. Make sure the device is plugged in.

2. Type the following command (as root)
# lsusb

3. You’ll see a bunch of lines of the form:
Bus XYZ Device XYZ: ID AAAA:BBBB [Name of Device]

4. Note down the AAAA and BBBB part of your BSNL device. In case no such device is listed, unplug all USB devices except your data card and run the command again. All entries except one will have AAAA and BBBB values of 0. Note this down.

5. Alright, now we have the vendor and product ID of the device. Type the following command:
#modprobe usbserial vendor=0xAAAA product=0xBBBB
(Here replace AAAA and BBBB with the ID you wrote down earlier)

6. Now we can configure wvdial. We’ll need to edit the wvdial.conf file. So do this:
$ sudo nano -w /etc/wvdial.conf

7. Edit it so that the [Dialer Defaults] section looks like this:

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = USB Modem
ISDN = 0
Phone = #777
New PPPD = yes
Modem = /dev/ttyUSB0
Username = Your BSNL username here
Password = Your BSNL Password
Baud = 460800

There. Make sure you save the file 🙂

8. Let’s test if everything’s working. Type:
$ sudo wvdial

9. If everything’s configured properly, you should see a series of lines in the terminal and the connection should be successful. You might want to fire up the browser and visit a site to check if it’s working…

10. Now let’s configure gnome-ppp. Start it up by running Run -> ‘gnome-ppp’

11. Click Setup

12. In the Modem page, set Device to “/tty/USB0”, Type -> USB Modem, Speed -> 460800, Volume -> Off, Wait for Dialtone -> Checked.

13. Leave the Networking page as it is. The Options page should look something like this:

gppp Options
gppp Options

14. Close the Setup page, type your username and password in the respective boxes and click connect. If you did everything right, the connection should get established.

15. All done! Now you can create a shortcut to ‘gnome-ppp’ and configure it to start at system startup (using Sessions manager in Gnome/KDE).

There you go… configuring a BSNL data card is a piece o’ cake 😉 In case you have any doubts/suggestions, please post it as a comment.

Advertisements

31 thoughts on “HOWTO: Setup BSNL Data Card in Linux

  1. hi i am dileep, i tried the methods you have given
    and i am getting the following message
    –> 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

    –>Modem initialized.
    –> Sending: ATDT#777
    –> Waiting for carrier.
    ATDT#777
    CONNECT 230400

    –> Carrier detected. Starting PPP immediately.
    –> Starting pppd at Sun Jul 27 16:33:55 2008

    –> Pid of pppd: 6769
    –> Using interface ppp0
    –> pppd: ��[06][08][10]�[06][08]

    –> pppd: ��[06][08][10]�[06][08]
    –> pppd: ��[06][08][10]�[06][08]

    –> pppd: ��[06][08][10]�[06][08]
    –> pppd: ��[06][08][10]�[06][08]

    –> Disconnecting at Sun Jul 27 16:34:02 2008

    –> 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)

    but i am able to login in windows(vista) using same username and password, pls help
    pls mail me if you can
    dineshdileep@gmail.com

  2. Your wvdial seems to be configured properly. Something’s wrong with the Username and Password.

    My guess is, you’ve put those square brackets in the wvdial.conf file 🙂 My mistake. I’ll correct it. The file should be something like:

    [Dialer Defaults]
    Init1 = ATZ
    Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    Stupid Mode = 1
    Modem Type = USB Modem
    ISDN = 0
    Phone = #777
    New PPPD = yes
    Modem = /dev/ttyUSB0
    Username = XXXXXXXXXX
    Password = YYYY
    Baud = 460800

    where XXXXXXXXXX is your username and YYYY is ur password. Hope that works.

  3. hi,
    i think that the settings are configured properly but on connecting it does not show any moving lines in the terminal
    Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    OK

    –>Modem initialized.
    –> Sending: ATDT#777
    –> Waiting for carrier.
    ATDT#777
    CONNECT 230400

    –> Carrier detected. Starting PPP immediately.
    –> Starting pppd at Sun Jul 27 16:33:55 2008

    –> Pid of pppd: 6769
    –> Using interface ppp0
    –> pppd: ��[06][08][10]�[06][08]

    –> pppd: ��[06][08][10]�[06][08]
    –> pppd: ��[06][08][10]�[06][08]

    –> pppd: ��[06][08][10]�[06][08]
    –> pppd: ��[06][08][10]�[06][08]

    it shows only this much content iam using ubuntu 8.04 lts version of linux pleez help

  4. Well that output seems ok to me… The output stops after displaying lines like this:

    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: local IP address X.X.X.X
    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: remote IP address 10.64.64.64
    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: primary DNS address 218.248.240.79
    WvDial: pppd: [08]�[06][08][10]�[06][08]
    WvDial: secondary DNS address 218.248.240.24
    WvDial: pppd: [08]�[06][08][10]�[06][08]

    After that you should be able to use the net.. Are you sure you’re unable to browse even after you see these lines?

  5. Edit /etc/ppp/options with your favorite (or not so favorite) editor. Find and comment out the following line:

    before:

    lcp-echo-failure 4

    after:

    #lcp-echo-failure 4

    As far as I understand this will disable LCP request/replies which can be very helpful in fringe coverage areas.

    -Running `sudo gnome-ppp` will create the appropriate files in /etc/ppp. Without sudo it may error out since /etc/ppp can only be written to by root by default.

    $ ls -ld /etc/ppp

    drwxr-xr-x 8 root dip 4096 2007-09-04 21:59 /etc/ppp

    -For effect I like using the “dock in notification area” option. It can be found at gnome-ppp -> Setup -> Options -> Dock in notification area

  6. While executing following command , I found some error message as network unreachable, pls give me the proper instruction in this regard

    sudo aptitude install wvdial gnome-ppp

  7. Hi

    It seems gnome-ppp is not available in the Ubuntu CD. You could try:

    sudo aptitude install wvdial

    Setup Wvdial as discussed in the post, go online using ‘sudo wvdial’ and then give:

    sudo aptitude install gnome-ppp

    ..and then follow the rest of the article.

  8. Hello,

    Very nice tut.. I would like to know that whether any drivers regarding BSNL NIC Modem are to be installed before following these statements. Coz for me im getting a error stating

    /dev/modem directory not found… something like tat…

    Plz clarify.. im in a desperate need

  9. It’s not necessary to install any drivers since Linux will recognize the device when you plug it into your USB port. That’s the reason why we have told wvdial to look for the modem in /dev/ttyUSB0.

    Follow the article carefully and please leave a comment if you encounter any errors.

  10. I tried it..

    Ok.. Let me come from the beginning..

    when i give sudo aptitude update, should i be connected to any internet..

    Im a newbie to Ubuntu & Linux Platform.. pls help e sortout this problem..

  11. You don’t need to.. you could just use the installation CD repos.

    But to make it simpler, skip the ‘sudo aptitude update’ step (and even the ‘aptitude install’ step if you want to, since wvDial comes preinstalled with Ubuntu if I remember correctly) and follow the rest of the tutorial..

  12. Hurray to saurav…

    My problem is solved. May be you should consider adding in the tutorial about saving the file after setting the Dialer Defaults. All these time i have been trying out without saving the file Lolz..

    Thanks…

    Could i know how to set up the gnome-ppp dialer on start up so that it starts up automatically..

    Thanks again tekguru

  13. Glad I was of help. I’ll update the post soon 🙂
    As for gnome-ppp, you can use the Sessions manager to make it start up automatically (See point no. 15 in the post).

  14. I would like to know whether there is any way of knowing the signal strength, coz i blindly have to browse even without knowing whether im in a place of strong signal or a weak one.

    Please do help with this..

  15. Now that’s an issue I haven’t payed much attention to.. So I have no idea how to get a signal strength monitor up and running. Maybe you should look for apps that monitor a mobile phone’s signal strength and then work your way up. Afterall, it is a CDMA device right?

  16. Excellent s stuff..I am also connected to net…But if u provide a way to monitor the signal it ll be very useful…i searched in net..but didnt get anything useful…..

  17. Sir I followed all the steps above mentioned properly even I have saved the file.
    But my system crashes after few minutes of connecting to the net. It connects though.
    I am using ubuntu 7.04 what should I do??

  18. hi i am new to linux i dont even know the basics of it but i followed as you said but i am getting a error messege as “/tty/USB0” file not found

  19. It’s /dev/ttyUSB0, not /tty/USB0 (in 7th step).. Maybe a typo. You could also try /dev/ttyUSB1 or 2 etc if 0 doesn’t work. Alternatively, you could plug it into a different USB port.

    Let me know if that worked..

  20. hi iam sunil iam using unbuntu 8.04 iam using bsnl cdma20000 ix EV-DO wireless data terminal .but iam not able to install gnome-pp
    after doing rest of steps i got
    hacker@hacker-laptop:/$ sudo wvdial
    –> 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
    –> Modem initialized.
    –> Sending: ATDT#777
    –> Waiting for carrier.
    ATDT#777
    CONNECT
    –> Carrier detected. Starting PPP immediately.
    –> Starting pppd at Sat Jan 3 23:02:55 2009
    –> Pid of pppd: 6958
    –> Using interface ppp0
    –> local IP address 10.2.0.15
    –> remote IP address 10.64.64.64
    –> primary DNS address 218.248.240.79
    –> secondary DNS address 218.248.240.135

    but still iam not connected please help me

  21. I tried the script. the connection log shows the following message and does not get connected can any one help.

    I am using xubuntu – hardy heron
    Krishnakant

    –> Ignoring malformed input line: “;Do NOT edit this file by hand!”
    –> WvDial: Internet dialer version 1.60
    –> Cannot get information for serial port.
    –> Initializing modem.
    –> Sending: ATX3
    ATX3
    OK
    –> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    OK
    –> Modem initialized.
    –> Configuration does not specify a valid phone number.

  22. HI,

    I have been facing problem in installing the BSNL USB 3G data card in ubuntu 9.10. I have gone for a prepaid connection and have no username and password provided to me.

    There are some Linux installation files provided but it doesnt support 9.10 version of ubuntu 😦

    kindly help….

  23. Hii,
    I am using ubuntu 9.10 and was able to connect to the net using bsnl wll phone [bsnl clarity] by the above described methods, but recently i got my phone replaced and the new phone is not getting detected even after issuing
    #modprobe usbserial vendor=0xAAAA product=0xBBBB
    command. [i have replaced the product id and vendor with new ones.] Is there any tweaks.

  24. Hi Saurav, I guess I’m a little late in submitting this comment, but I was wondering if you could help me out with configuring wvdial for the new bsnl 3G data card from qualcom model LW 272. I would be very grateful for any help.

    Regards,
    Rex Fernando.

  25. Sorry, I have downloaded Linux Mint 9 only yesterday, and have never worked in Linux before. Just thought you should know.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s