How to install Huawei E220 USB Modem on Fedora 12

You have Fedora 12 installed on your laptop/PC and wanna use Huawei E220 USB Modem to access internet? On the previous posts, I had created tutorials of installing Huawei E220 on Slackware 12.2 and Centos 5.4. They should be in the related posts list of this tutorial.

Here are the step-by-step to configure and setting the device on Fedora 12 (mine is x86_64 platform).

1. Plug the device in to a USB port.
If you plug the device in to the USB port, you will get some kernel messages like below:

usb 3-1: reset full speed USB device using uhci_hcd and address 5
usb 3-1: device descriptor read/64, error -71
usb 3-1: USB disconnect, address 5
usb 3-1: new full speed USB device using uhci_hcd and address 6
usb 3-1: New USB device found, idVendor=12d1, idProduct=1003
usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 3-1: Product: HUAWEI Mobile
usb 3-1: Manufacturer: HUAWEI Technologies
usb 3-1: configuration #1 chosen from 1 choice
option 3-1:1.0: GSM modem (1-port) converter detected
usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
option 3-1:1.1: GSM modem (1-port) converter detected
usb 3-1: GSM modem (1-port) converter now attached to ttyUSB1
scsi20 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 6
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete

From the above messages, you can see that the modem is attached to ttyUSB0 (/dev/ttyUSB0). We will use the attached device as modem in the configuration (/etc/wvdial.conf).
[ad#Chitika468x180]
2. Install wvdial tool and its generate configuration file.
We will use this tool to dial the modem to your internet provider. Install wvdial using yum.

[fuad@fedora ~]$ sudo yum install wvdial

After the installation of wvdial succeeded, then run ‘wvdialconf’ tool to generate the ‘/etc/wvdial.conf’ configuration file.

[fuad@fedora ~]$ sudo wvdialconf /etc/wvdial.conf 
Editing `/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: huawei
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Max speed is 9600; 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 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB1<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB1<*1>: Speed 9600: AT -- OK
ttyUSB1<*1>: Max speed is 9600; that should be safe.
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
ttyUSB1: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

The ‘/etc/wvdial.conf’ file should be generated by the above command. You can see that file using ‘cat’ command.

[fuad@fedora ~]$ 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 = 9600

3. Edit the /etc/wvdial.conf file
You have to edit the wvdial.conf file to suit your need. The values you have to edit are ‘Phone, Username, and Password’.
Here is my configuration just for example:

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Phone = *99# 
ISDN = 0
Username = fuad.nahdi 
Init1 = ATZ
Password = secretdonk 
Modem = /dev/ttyUSB0
Baud = 9600

4. Dial the modem using wvdial
Now it is the time to dial the modem using ‘wvdial’.

[fuad@fedora ~]$ 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*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected.  Waiting for prompt.
--> Don\'t know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Wed Dec 16 11:56:33 2009
--> pid of pppd: 4206
--> Using interface ppp0
--> local  IP address 114.59.187.129
--> remote IP address 10.64.64.64
--> primary   DNS address 202.155.0.10
--> secondary DNS address 202.155.0.15

You have to manually write the DNS IP addresses to /etc/resolv.conf file because the wvdial command will not write it automatically for you.