How to 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

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.


No comments: