Wednesday, March 13, 2013

TataPhoton USB modem Configuration in RHEL5


Tata Photon Data card never get detected by RHEL-5 automatically. By default the device is available as "USB-storage (Mass Storage / SD Storage)”.  In RHEL5 even the device never initialized itself. In a dual booting system first we need to initialize the card in Windows and then restart the system (without power off) in Linux.Off course this is not the way of handling a device in RHEL, there must be some proper way, but at this moment I am unaware about that.

To get vendor ID and product ID use "lsusb" as a super user if data card is not detected by default.

#lsusb
Bus 003 Device 003: ID 12d1:140b
Bus 003 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000

For more details information use following command 
#lsusb -v | grep -B4 HUAWEI

Here the first number is vendor id (0x12d1) and the second one (0x0140b) is product id. These numbers may differ depending on the make and model of the device.

To get generic USB serial driver bind to the device, USB vendor and product IDs need to be specified as a parameter when the module “usbserial” is loaded. For example, to bind the previously described device with a vendor ID of 0x12d1 and product ID of 0x140b, execute following command as a super user

#modprobe usbserial vendor=0x12d1 product=0x140b

Now we need usb_modeswitch. If it is not installed yet, please install latest available package. usb_modeswitch can send bulk messages (most likely a mass storage command) to the device which is known to initiate the mode switching. 
#usb_modeswitch -v 0x12d1 -p 0x140b -H -W

Next we need to run WvDial command-line pppd driver. Wvdialconf generates  configuration file containing information of your modem and ISP details. To avoid changing configuration file parameters, let’s create a master copy of wvdial.conf file.

#cat wvdial.conf-master
[Modem0]
Modem = /dev/ttyUSB2
Baud = 115200
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
Init3 = ATM0
FlowControl = CRTSCTS
[Dialer tataphoton]
Username = internet
Password = internet
Phone = #777
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Inherits = Modem0

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

Now execute following command to connect internet through the device.

#wvdialconf /etc/wvdial.conf
#wvdial

It’s better to bring all command together in a script and run the script to connect internet through Tata-Photon USB modem.

#!/bin/bash
modprobe usbserial vendor=0x12d1 product=0x140b
usb_modeswitch -v 0x12d1 -p 0x140b -d 1
usb_modeswitch -v 0x12d1 -p 0x140b -H 1
cp /etc/wvdial.conf-master /etc/wvdial.conf
wvdialconf /etc/wvdial.conf
wvdial

No comments:

Post a Comment