I received a package earlier today, and was very happy to find out that it’s the Huawei E220 that I ordered few days ago. This Huawei E220 is a 3G card that supports speed of up to 3.6 Mbps, using HSDPA technology, and it makes me can’t wait to have it work with Gutsy Gibbon. After struggling for quite some time, I found out that the answer to my problem was just these two lines of command:
sudo modprobe -r uhci_hcd sudo modprobe uhci_hcd
If that short version of my solution doesn’t help, please read ahead…
I’ve been trying to get this modem to work with Gutsy Gibbon, but the online howtos that I found on the net doesnt reliably work for me.
Weird enough for me initially as sometime I can just use wvdial (more on this afterward) and get connected, while most of the time I got various errors about the modem. With these non-reproducible errors and successes, I do some trial and error while looking at the kernel logs, and came up with this one final observation;
shakir@herugrim ~ $ uname -r # just to show the kernel I'm using, as your mileage may vary 2.6.22-14-generic
At one shell I run this to see kernel messages;
sudo tail -f /var/log/messages
and got this messages upon plugging in my Huawei E220 to the USB port;
usb 3-1: new full speed USB device using uhci_hcd and address 5 usb 3-1: configuration #1 chosen from 1 choice usbcore: registered new interface driver libusual usbcore: registered new interface driver usbserial /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: USB Serial support registered for generic usbcore: registered new interface driver usbserial_generic /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: USB Serial Driver core /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: USB Serial support registered for GSM modem (1-port) option 3-1:1.0: GSM modem (1-port) converter detected usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
Nice, it has detected my Huawei E220 as GSM modem, and attach it to /dev/ttyUSB0. Let’s create a wvdial configuration to connect to the telco (Celcom in my case). My /etc/wvdial.conf looks like this;
[Dialer Celcom3G] Phone = *99***1# Modem = /dev/ttyUSB0 Username = user Password = pass ISDN = 0 New PPPD = yes Baud = 1843200 Init2 = ATZ Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = Analog Modem
So let’s just connect;
shakir@herugrim ~ $ sudo wvdial Celcom3G WvDial<*1>: WvDial: Internet dialer version 1.56 WvModem<*1>: Cannot get information for serial port. WvDial<*1>: Initializing modem. WvDial<*1>: Sending: ATZ WvDial<*1>: Sending: ATQ0 WvDial<*1>: Re-Sending: ATZ WvDial: Modem not responding.
Ouch, an error. The modem has been detected, what could go wrong? After some time, and no success with the available tutorials, I finally got this working, as the problem was related to the USB drivers. What I did was to reload the uhci_hcd module
shakir@herugrim ~ $ sudo modprobe -r uhci_hcd
Lets take a look at what the kernel says about this;
[..snipped..] Dec 4 22:45:24 herugrim kernel: [ 1343.504000] usb 3-1: USB disconnect, address 6 Dec 4 22:45:24 herugrim kernel: [ 1343.504000] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0 Dec 4 22:45:24 herugrim kernel: [ 1343.504000] option 3-1:1.0: device disconnected [..snipped..]
and then lets load the module back again
shakir@herugrim ~ $ sudo modprobe uhci_hcd
and see what happens;
USB Universal Host Controller Interface driver v3.0 ACPI: PCI Interrupt 0000:00:1a.0[A uhci_hcd 0000:00:1a.0: UHCI Host Controller [..snipped..] usb 3-1: new full speed USB device using uhci_hcd and address 2 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 option 3-1:1.2: GSM modem (1-port) converter detected usb 3-1: GSM modem (1-port) converter now attached to ttyUSB2 [..snipped..]
Last time the GSM modem was attached to just /dev/ttyUSB0, but now it’s also attached to /dev/ttyUSB1 and /dev/ttyUSB2. And I guess it’s time to connect using wvdial;
WvDial<*1>: WvDial: Internet dialer version 1.56 WvModem<*1>: Cannot get information for serial port. WvDial<*1>: Initializing modem. WvDial<*1>: Sending: ATZ WvDial Modem<*1>: ATZ WvDial Modem<*1>: OK WvDial<*1>: Sending: ATZ WvDial Modem<*1>: ATZ WvDial Modem<*1>: OK WvDial<*1>: Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 WvDial Modem<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 WvDial Modem<*1>: OK WvDial<*1>: Modem initialized. WvDial<*1>: Sending: ATDT*99***1# WvDial<*1>: Waiting for carrier. WvDial Modem<*1>: ATDT*99***1# WvDial Modem<*1>: CONNECT WvDial<*1>: Carrier detected. Waiting for prompt. WvDial: Don't know what to do! Starting pppd and hoping for the best. WvDial : Starting pppd at Tue Dec 4 22:49:25 2007 WvDial : Pid of pppd: 6433 WvDial<*1>: Using interface ppp0 WvDial<*1>: local IP address 10.188.15.175 WvDial<*1>: remote IP address 10.64.64.64 WvDial<*1>: primary DNS address 202.188.0.133 WvDial<*1>: secondary DNS address 202.188.1.5
It works, yeay
As usual, lets create a script for this;
#!/bin/bash
sudo modprobe -r uhci_hcd
sudo modprobe uhci_hcd
echo "Waiting kernel to detect modem device"
# Wait till the kernel recognizes our E220
while true; do
# Read log
tail -n 20 /var/log/messages > access.history
sleep 1
tail -n 20 /var/log/messages > access.current
LOG=`diff access.history access.current | grep ">" | tr -d ">"`
# Check if it is detected
if [[ "$LOG" =~ "converter now attached to ttyUSB1" ]]; then
echo "Modem device detected, dialing..."
# If it is, get out of the loop immedietly
break
fi
done
rm access.history access.current
# Start dialing
sudo wvdial Celcom3G
p/s: The script is now maintained here. Please go there to see the latest updates and discussions









yeay… bila nak dapat e220 free ni.em alahaiiii
12.05.07 at 4:34 pm
/home/shakir without shoutbox hmm……
sejak bila lak suka kat macos ni?
12.09.07 at 6:14 pm
Aisey, someone is missing the shoutbox eh..
The shoutbox was at the sidebar 2-3 weeks ago, but at the far bottom of the sidebar, but no one seems to notice (as no one was using it), and so I just scrap it to save space. How do you like it on top of the sidebar now?
12.10.07 at 5:08 am
Hi Shakir, I’ve managed to get a Huawei E220 working thanks to you
Keep on the good work!
12.16.07 at 2:59 pm
I got this message when I typed : sudo wvdial Celcom3G
“Cannot open open /dev/modem: No such file or directory”
Can you help me.
Thanks
Zakaria
12.19.07 at 11:13 pm
Sorry for my previous post.
It was my silly mistake .. I have not type Modem=/dev/ttyUSB0
Thanks
12.20.07 at 7:31 am
Avinash Meeto, Zakaria; Glad it works for you guys, and thanks Avinash for the backlinks on your website
12.21.07 at 12:29 pm
Hi,
I’ve got à Globtrotter Icon7.2 and … Excatly the same problem!
The /dev/ttyUSB0 arrive but never got ttyUSB1 and ttyUSB2. Still by reloading uhci_hcd. I hav read that it could be a bug in uhci_hcd.
Any (other) idea ?
thanks
12.22.07 at 10:37 pm
Hi, I am so newb in Ubuntu. Want to install it but before doing that I must make sure that my Huawei E220 works in Ubuntu. Found your post from Ubuntuforums and have read your post here. Kinda understand what you are saying but how about the script? Is that mean we plug in our USB modem and run the script and then we are able to connect to the internet? How about with other settings? Thank you.
12.24.07 at 8:04 am
Jaycee: I have no experience with Globetrotter Icon, but people in the net seems to be able to have it to work with Ubuntu.
CypherHackz: Yup just plug in the modem and run the script. Make sure you already have your wvdial.conf configured though. Try using the sample wvdial.conf in the post and see if it works with your provider.
12.26.07 at 10:10 am
I am using your wvdial.conf file. Copy it into my /etc folder. Run the sudo wvdial celcom3g command, and it connects me to the internet without any problem. Thanks for this guide.
12.27.07 at 1:31 am
Shakir, a word of thanks, I have been struggling for a while to get the E220 modem going, so far I found your howto the best for my problem. I am using Gutsy, and I had exactly the same problems as you…Thanks man.
Cheers.
01.08.08 at 5:08 am
@scorn: you’re welcome
01.08.08 at 2:20 pm
Hy!
Yes, this is the hard method…But, if you have, you can use KPPP, and the modem works…We have a Huawei E220 too…I tried a lot of howtos, (your gide too), but I failed in the job, but then, for a last chance, I give a try for the KPPP (anyway, I’m on Kubuntu Feisty 32bit)…I set the call number to *99# (or #99*, it was two months ago, and I did it for a friend, so I forgot the details:)), a password and a login name, and in the modem section, set the location of the E220 (/dev/ttyUSB0) and if my memories are correct, that’s all. Then connect, and go on!
Some things was set up too, like PAP/CHAP mode, etc., but it is more easier, than the wvdial with hand config, and the others…So, if this tutorial is too hard for you at first look, then try the KPPP first. And if you dont know all of the data that you need, then install the modem on windows first, and save the profile data…It will be a good thing for looking the useful datas for the KPPP’s set up!
(So sorry for my english…I am a hungarian:D)
01.08.08 at 7:10 pm
Assalamualaikum.. sifoo.. lama x dengar berita.. saya ada masalah nak dial guna hp saya sebagai modem.. masa wat sdptool browse [mac address] tak kuar apa.. kecuali …… Ni membuatkan saya ada masalah nak jadikan hp saya sebagai modem. Saya guna Palm Treo 750v. Harap dapat membantu.. kalau emel tips pada saya pun ok.. saya pakai Linux CentOS 5.0.. harap dapat tolong..
01.28.08 at 3:15 pm
sy pakai ubuntu 7.10, first install.. connection ok.
skrang connection dapat. tp x der activity ( received & sent signal ) , jd nk surf internet x dpt..
cmner eehh?
harap bleh selesaikan…
tq
02.07.08 at 12:55 pm
Thanks!
I was trying to figure this out, and your guide was the bit I needed!
Gutsy recognized everything, just had to paste and edit your wvdail config.
Again: THANK YOU!
Gutsy 7.10
2.6.22-14-generic kernel
Vodafone Mobile Connect 3g/GPRS
(Option Wireless Technology Model GT 3G Quad)
03.11.08 at 1:57 am
Thank you so much for this script! I’ve trying to figure this problem out for AGES!!!
I am now using it in a modem dialing application I’m currently programming, thank you so much!
regards,
Ceno
04.05.08 at 5:26 am
Why make life so difficult???? just download the program and run it! easy and nice GUI
here is the link
https://forge.vodafonebetavine.net/frs/?group_id=12
05.05.08 at 2:17 pm
sy nak tanya pasal huawei e220 ni ok tak? blh tak sape2 yg tau ??
07.31.08 at 5:59 pm
tolong bg komen skit
07.31.08 at 6:00 pm
NAk tanya pasal apa tu?
07.31.08 at 6:35 pm
en shakir…pasal broadband modem ape yang ok?
08.01.08 at 12:13 pm
hey shakir is ur e220 firmware installed by celcom still intact? could you posibly compress it to a zip file and send it to me?
08.09.08 at 1:30 pm
I’ve already updated the firmware, and I don’t keep copy of it. Sorry.
08.15.08 at 10:26 am
nak tanya sikit, untuk maxis punya kenapa dia ada keluar error +CME ERROR: SIM PIN required.
user: maxis
pass: wap
betui ka..sim pin tu nak kena remove dulu ka
09.03.08 at 11:34 pm
I used the Vodafone software, and it broke my card. The light just stays red now. Do you know a fix for this?
Please help!
04.01.09 at 11:25 pm
Hi! good job! I’m using the huawei eg162 with china mobile and I had the same problem. If i boot with the modem plugged in it worked, but anytime i tried to hotplugged it It didn’t work. Turns out your solution works, just need to reload the uhci module! thanks, mate!
04.17.09 at 9:47 am