shailendra
March 9th, 2009, 09:26 AM
Below are the steps to use any USB data card on Ubuntu 8.04 Hardy Heron. I have tried these steps with my Reliance NetConnect ZTE MG880 USB modem. But I think this will work on all the USB modems.
1) Mount the USB modem. In most cases we need to manually mount the device.
COMMAND: "sudo mount -t usbfs usbdevfs /proc/bus/usb"
Note: we can also use "None" option instead of "usbdevfs"
2) Check whether the card is recognized by the kernel
COMMAND: "sudo cat /proc/bus/usb/devices"
You will see bunch of messages. But we need only the data at the end. It looks something like this.
[...]
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 19 Spd=12 MxCh= 0
D: Ver= 1.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs= 1
P: Vendor=19d2 ProdID=fffd Rev= 0.00
S: Manufacturer=ZTE, Incorporated
S: Product=ZTE CDMA Tech
[...]
Pen down the "Vendor" and "ProdID"
3) Now modprobe the driver
COMMAND: "sudo modprobe usbserial vendor=0xXXXX product=0xXXXX"
Values of "Vendor" and "Product" can be obtained from the response for the command in step 2. For ZTE MG880 "vendor= 0x19D2" and "product = 0xFFD".
4) Give the command "dmesg"
COMMAND: "sudo dmesg"
The response will look something like this;
[38360.764000] usbcore: registered new interface driver usbserial
[38360.764000] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[38360.940000] usbserial_generic 2-1:1.0: generic converter detected
[38360.940000] usb 2-1: generic converter now attached to ttyUSB0
[38360.940000] usbserial_generic 2-1:1.1: generic converter detected
[38360.940000] usb 2-1: generic converter now attached to ttyUSB1
[38360.940000] usbserial_generic 2-1:1.2: generic converter detected
[38360.940000] usb 2-1: generic converter now attached to ttyUSB2
[38360.940000] usbcore: registered new interface driver usbserial_generic
[38360.940000] drivers/usb/serial/usb-serial.c: USB Serial Driver core
5) Now edit the wvdial.conf file
COMMAND: "sudo vi /etc/wvdial.conf"
[Dialer zte]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Phone = #777
Username = Your phone number
Password = Your phone number or password if any
ISDN = 0
SetVolume = 0
FlowControl = Hardware (CRTSCTS)
Modem = /dev/ttyUSB0
Dial Command = ATDT
Baud = 460800
Stupid Mode = 1
Note: You need to enter all the data as described above.
6) Run the "wvdial"
COMMAND: "sudo wvdial Zte"
--> WvDial: Internet dialer version 1.56
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT 230400
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat Mar 3 22:55:20 2007
--> Pid of pppd: 24314
--> Using interface ppp0
--> local IP address 220.226.50.126
--> remote IP address 97.239.2.10
--> primary DNS address 202.138.103.100
--> secondary DNS address 202.138.96.2
Now you are connected to internet.
7) To disconnect just press "Ctrl+c" key.
NOTE: Once you are connected to the internet and if you launch Firefox, it may give offline error message. So, go to "File" menu and uncheck the "Work Offline" option in Firefox. Refresh the page again and it should display the desired webpage.
Also, check the internet traffic. This can be done by "System->Administration->Networking". The ethernet interface must be in Roaming mode.
After you have successfully configured the USB modem through steps 1 to 7, next time to connect to the internet you will have to just follow the steps indicated below:
1) Mount the USB modem device.
2) Modprobe the driver
3) Run the "wvdial" to connect to internet
4) Press "Ctrl+c" key to disconnect.
To execute the above 3 instructions you can use the attached shell script file.
1) Mount the USB modem. In most cases we need to manually mount the device.
COMMAND: "sudo mount -t usbfs usbdevfs /proc/bus/usb"
Note: we can also use "None" option instead of "usbdevfs"
2) Check whether the card is recognized by the kernel
COMMAND: "sudo cat /proc/bus/usb/devices"
You will see bunch of messages. But we need only the data at the end. It looks something like this.
[...]
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 19 Spd=12 MxCh= 0
D: Ver= 1.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs= 1
P: Vendor=19d2 ProdID=fffd Rev= 0.00
S: Manufacturer=ZTE, Incorporated
S: Product=ZTE CDMA Tech
[...]
Pen down the "Vendor" and "ProdID"
3) Now modprobe the driver
COMMAND: "sudo modprobe usbserial vendor=0xXXXX product=0xXXXX"
Values of "Vendor" and "Product" can be obtained from the response for the command in step 2. For ZTE MG880 "vendor= 0x19D2" and "product = 0xFFD".
4) Give the command "dmesg"
COMMAND: "sudo dmesg"
The response will look something like this;
[38360.764000] usbcore: registered new interface driver usbserial
[38360.764000] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[38360.940000] usbserial_generic 2-1:1.0: generic converter detected
[38360.940000] usb 2-1: generic converter now attached to ttyUSB0
[38360.940000] usbserial_generic 2-1:1.1: generic converter detected
[38360.940000] usb 2-1: generic converter now attached to ttyUSB1
[38360.940000] usbserial_generic 2-1:1.2: generic converter detected
[38360.940000] usb 2-1: generic converter now attached to ttyUSB2
[38360.940000] usbcore: registered new interface driver usbserial_generic
[38360.940000] drivers/usb/serial/usb-serial.c: USB Serial Driver core
5) Now edit the wvdial.conf file
COMMAND: "sudo vi /etc/wvdial.conf"
[Dialer zte]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Phone = #777
Username = Your phone number
Password = Your phone number or password if any
ISDN = 0
SetVolume = 0
FlowControl = Hardware (CRTSCTS)
Modem = /dev/ttyUSB0
Dial Command = ATDT
Baud = 460800
Stupid Mode = 1
Note: You need to enter all the data as described above.
6) Run the "wvdial"
COMMAND: "sudo wvdial Zte"
--> WvDial: Internet dialer version 1.56
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT 230400
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat Mar 3 22:55:20 2007
--> Pid of pppd: 24314
--> Using interface ppp0
--> local IP address 220.226.50.126
--> remote IP address 97.239.2.10
--> primary DNS address 202.138.103.100
--> secondary DNS address 202.138.96.2
Now you are connected to internet.
7) To disconnect just press "Ctrl+c" key.
NOTE: Once you are connected to the internet and if you launch Firefox, it may give offline error message. So, go to "File" menu and uncheck the "Work Offline" option in Firefox. Refresh the page again and it should display the desired webpage.
Also, check the internet traffic. This can be done by "System->Administration->Networking". The ethernet interface must be in Roaming mode.
After you have successfully configured the USB modem through steps 1 to 7, next time to connect to the internet you will have to just follow the steps indicated below:
1) Mount the USB modem device.
2) Modprobe the driver
3) Run the "wvdial" to connect to internet
4) Press "Ctrl+c" key to disconnect.
To execute the above 3 instructions you can use the attached shell script file.