Saturday, February 27, 2010

Mobile internet with Huawei E220 and Ubuntu

So, you’ll need the following:
- ubuntu desktop 8.04 fully updated – including kernel > 2.6.20 (i think the latest is 2.6.24 on that distro)
- huawei E220 (currently on Orange Romania)
First of all, make sure you have kernel > 2.6.20 by typing:
uname -r
After that, make sure you have “wvdial” command available. If you not, just apt-get install it.
Then, insert the SIM card from the modem in a cell phone, and remove the pin protection.
Create a file called .wvdialrc in your home directory (ex. /home/user/.wvdialrc) and put the following lines in it:
[Dialer Defaults]
Phone = *99#
Username = orange
Password = orange
Stupid Mode = 1
Dial Command = ATDT
Init1 = AT
Init2 = ATE0V1&F&D2&C1S0=0
Init3 = AT
Init4 = ATS0=0
Init5 = ATE0V1&F&D2&C1S0=0
Init6 = AT+CPMS=”SM”
Init7 = AT+CMGF=1
# below, you can replace “2″ by “0″ to force EDGE connection
Init8 = AT+COPS=0,0,”RO ORANGE”,2
Modem = /dev/ttyUSB0
Baud = 460800
ISDN = 0
Modem Type = Analog Modem
# below, you can set APN name; maybe your provider gave you in order to get fixed IP – in this case, it’s called “internet”
#Init9 = AT+CGDCONT=1,”IP”,”internet”;
After saving the file, run as “user” the command wvdial. It should work perfectly. BTW, it will try to connect more than 1 time before succeeding. Did the same thing to me. If it doesn’t work, make sure your linux loads the correct driver to this USB modem.

/var/log/messages should look like this:

Oct  3 02:03:27 xxx kernel: [ 4072.581107] usb 1-1: new full speed USB device using uhci_hcd and address 2
Oct  3 02:03:27 xxx kernel: [ 4073.038320] usb 1-1: configuration #1 chosen from 1 choice
Oct  3 02:03:27 xxx kernel: [ 4073.319908] usb 1-2: new full speed USB device using uhci_hcd and address 3
Oct  3 02:03:28 xxx kernel: [ 4073.747801] usb 1-2: configuration #1 chosen from 1 choice
Oct  3 02:03:28 xxx kernel: [ 4073.756208] hub 1-2:1.0: USB hub found
Oct  3 02:03:28 xxx kernel: [ 4074.103785] hub 1-2:1.0: 7 ports detected
Oct  3 02:03:28 xxx kernel: [ 4074.240712] usbcore: registered new interface driver usbserial
Oct  3 02:03:28 xxx kernel: [ 4074.240926] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered
for generic
Oct  3 02:03:28 xxx kernel: [ 4074.241394] usbcore: registered new interface driver usbserial_generic
Oct  3 02:03:28 xxx kernel: [ 4074.241420] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial Driver core
Oct  3 02:03:28 xxx kernel: [ 4074.259436] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered
for airprime
Oct  3 02:03:28 xxx kernel: [ 4074.259720] airprime 1-1:1.0: airprime converter detected
Oct  3 02:03:28 xxx kernel: [ 4074.260264] usb 1-1: airprime converter now attached to ttyUSB0
Oct  3 02:03:28 xxx kernel: [ 4074.260347] usb 1-1: airprime converter now attached to ttyUSB1
Oct  3 02:03:28 xxx kernel: [ 4074.260403] usb 1-1: airprime converter now attached to ttyUSB2
Oct  3 02:03:28 xxx kernel: [ 4074.260431] usbcore: registered new interface driver airprime
Oct  3 02:03:28 xxx kernel: [ 4074.294027] usbcore: registered new interface driver libusual
 Hopefully, it will work as beautiful as it worked for me. If it doesn’t, just send a comment.

No comments:

Post a Comment