Huawei E220 HSPDA USB Modem On Ubuntu

I was going to be away from home a lot, so I signed up for a monthly flat-fee mobile internet connection from T-Mobile, and they sent me a USB modem the very next day.

I really wanted to be able to use it under Ubuntu, and happily it turned out to be relatively painless. The recipe is:

Plug the modem in. The modem doubles as a USB storage device (this is where the windows drivers are stored), but this confuses things, so disable recognition of USB storage devices:

 $ sudo rmmod usb-storage

This is admittedly a bit of an annoying necessity, but it can always be re-enabled later.

Next, check the device details:

 $ lsusb

You should see a line that looks something like this:
Bus 001 Device 004: ID 12d1:1003
Alternatively, the product ID might be 1001 not 1003 -- in that case, change the details below accordingly.

Now insert the relevant kernel module with the appropriate device details:

 $ sudo modprobe usbserial vendor=0x12d1 product=0x1003

Now remove the USB cable, wait a few seconds, and then plug it back in. Then check that

 $ ls -la /dev/ttyU*

lists three devices:
crw-rw---- 1 root dialout 188, 0 2007-04-24 16:22 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 2007-04-24 15:54 /dev/ttyUSB1
crw-rw---- 1 root dialout 188, 2 2007-04-24 15:53 /dev/ttyUSB2
If there's only one result, try unplugging and reconnecting again.

Next, edit /etc/wvdial.conf:

[Dialer Defaults]

Phone = *99***1#
Username = username
Password = password
Stupid Mode = 1
Dial Command = ATDT

[Dialer tmobile]

Modem = /dev/ttyUSB0
Baud = 460800
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem

username and password are not placeholders -- use those exact values. Actually, it probably doesn't matter, since there is no authentication.

Finally run

 $ sudo wvdial tmobile

And the connection should come up.

Ben Lund
Published on Tuesday April 24 2007 at 17:18