/home/shakir

Huawei E220 in Gutsy Gibbon (Kubuntu)

Posted on 05 Dec, 2007, categorized under Information Insemination



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 :D 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





Looking for something else? Search Google.

26 Responses to "Huawei E220 in Gutsy Gibbon (Kubuntu)"

1 | fadli

December 5th, 2007 at 4:34 pm

Avatar

yeay… bila nak dapat e220 free ni.em alahaiiii

2 | fadli

December 9th, 2007 at 6:14 pm

Avatar

/home/shakir without shoutbox hmm……
sejak bila lak suka kat macos ni?

3 | shakir

December 10th, 2007 at 5:08 am

Avatar

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? :D

4 | Avinash Meetoo

December 16th, 2007 at 2:59 pm

Avatar

Hi Shakir, I’ve managed to get a Huawei E220 working thanks to you :-)

Keep on the good work!

5 | Zakaria

December 19th, 2007 at 11:13 pm

Avatar

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

6 | Zakaria

December 20th, 2007 at 7:31 am

Avatar

Sorry for my previous post.
It was my silly mistake .. I have not type Modem=/dev/ttyUSB0

Thanks

7 | shakir

December 21st, 2007 at 12:29 pm

Avatar

Avinash Meeto, Zakaria; Glad it works for you guys, and thanks Avinash for the backlinks on your website :D

8 | Jaycee

December 22nd, 2007 at 10:37 pm

Avatar

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

9 | CypherHackz

December 24th, 2007 at 8:04 am

Avatar

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.

10 | shakir

December 26th, 2007 at 10:10 am

Avatar

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.

11 | CypherHackz

December 27th, 2007 at 1:31 am

Avatar

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. :D

12 | scorn

January 8th, 2008 at 5:08 am

Avatar

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.

13 | shakir

January 8th, 2008 at 2:20 pm

Avatar

@scorn: you’re welcome :D

14 | Verona007

January 8th, 2008 at 7:10 pm

Avatar

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)

15 | Tajul

January 28th, 2008 at 3:15 pm

Avatar

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..

16 | ptra8

February 7th, 2008 at 12:55 pm

Avatar

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

17 | Leen Smit

March 11th, 2008 at 1:57 am

Avatar

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)

18 | Ceno

April 5th, 2008 at 5:26 am

Avatar

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

19 | Hantu

May 5th, 2008 at 2:17 pm

Avatar

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

20 | hann

July 31st, 2008 at 5:59 pm

Avatar

sy nak tanya pasal huawei e220 ni ok tak? blh tak sape2 yg tau ??

21 | hann

July 31st, 2008 at 6:00 pm

Avatar

tolong bg komen skit

22 | shakir

July 31st, 2008 at 6:35 pm

Avatar

NAk tanya pasal apa tu?

23 | hann

August 1st, 2008 at 12:13 pm

Avatar

en shakir…pasal broadband modem ape yang ok?

24 | John

August 9th, 2008 at 1:30 pm

Avatar

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?

25 | shakir

August 15th, 2008 at 10:26 am

Avatar

I’ve already updated the firmware, and I don’t keep copy of it. Sorry.

26 | tebu

September 3rd, 2008 at 11:34 pm

Avatar

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

Comment Form


  • si perda: wah.. boleh kasi need for speed test power skali... boleh layan network race ni...
  • Faiz: wah....harganya berapa?
  • shakir: Hmm, I have no lab and that actually was my living room :D Sure I'll move them to one of my available rooms at home and make it a lab, but that'll be
  • peja: whoaaa..at least u have ur own lab...look interesting!
  • Qing Ru: He looks really cute! Fatherhood must have been quite rewarding :)
  • shakir: Chris: Thanks, I've updated the post.
  • shakir: tak cukup banyak guinea pig yang dah try and comment on the wimax service, and so I'll just wait :D
  • shakir: Vadim: Yup, but I prefer to just install dosbox and play the game rather than re-installing my system with 32 bit Linux :D
  • Vadim: 2shakir: wine doesn't support 64-bit linux. You have to use 32-bit linux if you want to use wine.
  • kevler: yerp ...dalam 2 hari nih jer ..aku dah kesan 2 BMW X6 , kat puchong dan jalan ampang ..giler laa lawa



Disclaimer

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my own personal opinion. Inappropriate comments will be deleted at the authors discretion. All code samples (if any, ever) are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Personal (Blogs) - TOP.ORG