Reaching out to others! Free & Open Source Software, Kannada, L10n, L18n Data Science, Cloud Computing & more…

Hacking BSNL EvDO on Linux

Hacking, linux, Technical | 0 comments

Evolution-Data Optimized or EvDO yet another wireless telecommunications technology to offer you better internet connectivity on the Go! It offers more mobility and advantages over your WiFi. Learn more about EvDO here.


I always wanted wireless connectivity which is cheap, affordable and reliable. Reliance and TATA Indicom did come out with various solutions with their CDMA products like PCMCIA card for laptop and then USB modules which can be plugged into any computer to gain access to internet. Now almost every one provides one or the other solutions for internet. I always enjoyed the internet on my laptop via reliance CDMA connection on my Nokia cell phones (6255 and 2112) and they were ok and better than the dial-up connections which I used to use at home. It was easy for me to configure the cell phones to work on Linux. Still it was very costly.

I found BSNL EvDO solution much affordable and I could make it work on my Dell M1210 which runs on Ubuntu 7.10 (Gutsy Gibbon). It will just cost you 500 + tax every month and you have to give 1000 Rs as initial payment for the device. Once you have the device in your hand, you have unlimited access to internet 24×7. Depending on proximity and the line of sight to the tower EvDO device would give 2.4 MBPS connections. At present in Bangalore average connection speed is 144 kbps. 1X CDMA network towers are still evolving in various parts of the city. In near future we can expect a better connectivity and high bandwidth via these cute little devices which would match broadband speed.

bsnl-evdopreview.jpg

Image by hpn :)

Lets see how I started using this device on my Linux distribution (You can follow the same steps to configure this device on any Linux distribution) :

Device : ZTE EV-DO AC8700 800M

Product Vendor : Qualcomm, Inc.

1) Insert the EvDO device into USB port

2) Check whether the device is getting detected on your system or not. You can issue the following command in console :

#sudo tail -f /var/log/messages

This will result in following messages if the device is detected

Mar 4 09:27:42 techfiz kernel: [ 8251.024000] usb 4-1: configuration #1 chosen from 1 choice
Mar 4 09:27:42 techfiz kernel: [ 8251.028000] usbserial_generic 4-1:1.0: generic converter detected
Mar 4 09:27:42 techfiz kernel: [ 8251.028000] usb 4-1: generic converter now attached to ttyUSB0

In the above lines ttyUSB0 is the device file for your modem. This file gets created automatically if the required modules are available. Else you will see some error messages.

Note :You might face an issue while activating this device on Ubuntu 7.04 and 7.10 as there have made some modifications to the USB serial device mappings. To resolve this issue, edit the file /etc/init.d/mountdevsubfs.sh.

Find the function do_start () and ensure that you have all the following lines.

#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb

The complete function looks like this

do_start () {
#
# Mount a tmpfs on /dev/shm
#
SHM_OPT=
[ "${SHM_SIZE:=$TMPFS_SIZE}" ] && SHM_OPT=”-osize=$SHM_SIZE”
domount tmpfs shmfs /dev/shm $SHM_OPT

#
# Mount /dev/pts. Create master ptmx node if needed.
#
domount devpts “” /dev/pts -ogid=$TTYGRP,mode=$TTYMODE

#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs “” /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount –rbind /dev/bus/usb /proc/bus/usb
}

The above change creates a file called /proc/bus/usb/.usbfs/devices which is missing in the new Ubuntu releases.

After making these changes run /etc/init.d/mountdevsubfs.sh restart at consoel or restart system before continuing with the other steps.

4) Now, your system can easily identify the new USB device which you have inserted into your PC. You can confirm this by running lsusb command.

# lsusb
Bus 005 Device 004: ID 046d:08c6 Logitech, Inc.
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 027: ID 05c6:6000 Qualcomm, Inc.
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 003: ID 413c:8126 Dell Computer Corp.
Bus 002 Device 004: ID 0a5c:4502 Broadcom Corp.
Bus 002 Device 005: ID 0a5c:4503 Broadcom Corp.
Bus 002 Device 002: ID 0a5c:4500 Broadcom Corp.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 004: ID 046d:c50e Logitech, Inc. MX-1000 Cordless Mouse Receiver
Bus 001 Device 001: ID 0000:0000

Here Bus 004 Device 027: ID 05c6:6000 Qualcomm, Inc. is the new device which started showing up for me on my laptop.

5) Your Linux kernel need to know which company’s driver need to be used with device. Most of the new kernels comes with the Qualcomm drivers inbuilt. Else you need to insert the driver module into your kernel.

Run this at the console to activate the module based on the vendor id and product id (You can find them in the previous step ID 05c6:6000. As we need to pass these numbers in hex format, I’m adding 0x).


# modprobe usbserial vendor=0x05c6 product=0x6000

(Goto step 2 and check if your USB device gets detected or not. You can even try replugging your USB device)

PS : You can permanently add this line to ensure that the module gets loaded to your kernel each time you restart your system by adding the following line into /etc/modules

usbserial vendor=0×05c6 product=0×6000

Finally you must get the following output, showing the Vendor name, ID, Device id , Device Bus used by your kernel to interact with the device.

#lsusb -v | grep Qualcomm
Bus 004 Device 022: ID 05c6:6000 Qualcomm, Inc.
idVendor 0×05c6 Qualcomm, Inc.

Now, your Linux PC is capable of creating the device files /dev/ttyUSB0 automatically without any issues.

6) Now its time for us to create the dialup profile. Its so simple with “wvdialconf” command.

#wvdialconf /etc/wvdial.conf

This creates a file called /etc/wvdial.conf with following output :

# wvdialconf /etc/wvdial.conf
Writing `/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 — Manufacturer: QUALCOMM INCORPORATED
ttyUSB0<*1>: Speed 4800: AT — OK
ttyUSB0<*1>: Speed 9600: AT — OK
ttyUSB0<*1>: Speed 19200: AT — OK
ttyUSB0<*1>: Speed 38400: AT — OK
ttyUSB0<*1>: Speed 57600: AT — OK
ttyUSB0<*1>: Speed 115200: AT — OK
ttyUSB0<*1>: Speed 230400: AT — OK
ttyUSB0<*1>: Speed 460800: AT — OK
ttyUSB0<*1>: Max speed is 460800; 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 — failed with 2400 baud, next try: 9600 baud
ttyUSB1<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
ttyUSB1<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up.
WvModem<*1>: Cannot get information for serial port.
ttyUSB2<*1>: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
ttyUSB2<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
ttyUSB2<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up.

Found a modem on /dev/ttyUSB0.
/etc/wvdial.conf: Can’t open ‘/etc/wvdial.conf’ for reading: No such file or directory
/etc/wvdial.conf: …starting with blank configuration.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 460800; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0″

Your /etc/wvdial.conf will have the following entries.

# cat /etc/wvdial.conf

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
; Phone =
ISDN = 0
; Username =
Init1 = ATZ
; Password =
Modem = /dev/ttyUSB0
Baud = 460800

Change the target phone no. to #777 and Username and password need to be set to the EVDO number provided by BSNL.

And you require an another magical line added to this file. i.e.

Stupid Mode = 1

More about Stupid Mode (from man pages):

When wvdial is in Stupid Mode, it does not attempt to interpret any prompts from the terminal server. It starts pppd immediately after the modem connects. Apparently there are ISP’s that actually give you a login prompt, but work only if you start PPP, rather than logging in. Go figure. Stupid Mode is (naturally) disabled by default.

Your /etc/wvdial.conf should look like this :

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

22222222 is just an example id, replace this with your EvDO number.

7) You’re all set to get connected now. just execute the following command again at the console

# wvdial

output :

# wvdial
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
WvDial Modem<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT#777
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: ATDT#777
WvDial Modem<*1>: CONNECT
WvDial<*1>: Carrier detected. Starting PPP immediately.
WvDial: Starting pppd at Tue Mar 4 16:26:53 2008
WvDial: Pid of pppd: 14536
WvDial<*1>: Using interface ppp0
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: local IP address 10.1.0.169
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: remote IP address 10.64.64.64
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: primary DNS address 218.248.240.23
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: secondary DNS address 218.248.240.135
WvDial<*1>: pppd: ��[06][08]��[06][08]

There should be a smile at your face after looking at it as you’re connected to internet. Start browsing unlimited.

7) To terminate the connection issue CTRL + C command and then remove EvDO device.

Note: If you still love windows, you have a bad news. BSNL does not provide you with the Windows Vista drivers for this device. I haven’t found one so far even for testing it.

You have just hacked into Linux to make a device work. Isn’t it fun.
If you have any questions, don’t hesitate to comment on it. I shall help you understand it better.

Related Articles

Related