Howto: Debian Lenny & Huawei E160G
So, in my last post I described how it was using the E160G with Debian. All in all it’s very good and i’ve not experienced any major issues, bar a few minor apt-get and NetworkManager issues. So, heres a quick rundown of how to get it on your machine.
So first, you need to get the hardware to work correctly under Debian. Plug in your E160G and check dmesg to see if the device recognises correctly. If you see ttyUSB0/ttyUSB1 appear you can skip this step.
First, you need to download USB_Modeswitch:
# wget http://www.draisberghof.de/usb_modeswitch/usb_modeswitch-0.9.4.tar.bz2 # tar jxvf usb_modeswitch-0.9.4.tar.bz2 # cd usb_modeswitch-0.9.4/ # ./compile.sh
Now you have the usb_modeswitch program, as this will be executed by udev it needs to be in a sensible location, personally i’d copy it to /usr/local/sbin/
# cp usb_modeswitch /usr/local/sbin/
Also, you need to grab the latest config file from the usb_modeswitch website and put it into /etc
# wget http://www.draisberghof.de/usb_modeswitch/usb_modeswitch.conf # sudo mv usb_modeswitch.conf /etc/
Now, by default the config file comes with the section commented out, so edit the file and uncomment the section for the E220 (which is essentially the same device).
# sudo $EDITOR /etc/usb_modeswitch.conf
One last step, you need to add a small configuration file to udev to detect the E160G and run usb_modeswitch, put this file in you /etc/udev/rules.d/ folder:
SUBSYSTEM=="usb", SYSFS{idProduct}=="1003", SYSFS{idVendor}=="12d1",
RUN+="/usr/local/sbin/usb_modeswitch"
Restart udev, and plug in your E160G…
sudo /etc/init.d/udev restart
and you should see something similar to:
[ 16.085904] usb 5-3: GSM modem (1-port) converter now attached to ttyUSB0 [ 16.086033] usb 5-3: GSM modem (1-port) converter now attached to ttyUSB1
So, the device is detected and you have your USB ports, first a quick overview. The E160G shows two serial ports, one is a data port, the other is for control signals. NetworkManager only makes use of one of these ports but the Vodafone Connection Manager uses both. Now you have a choice, install Network Manager 0.7 to gain native GPRS/UMTS data support or use another package. I went for Network Manager, while it’s still in beta and i’ve had a few run-ins in the past with it I decided to give it a go.
So, it was a simple case of adding the 0.7 repositories to /etc/apt/sources.list, updating, then installing the needed packages.
# echo "deb http://debs.michaelbiebl.de/ unstable main" >> /etc/apt/sources.list # apt-get update # apt-get -t unstable install network-manager
You might need to remove any old Network Manager packages before you do this, as network-manager-openvpn collides with the new package.
Hopefully thats give you the overview you needed, and you should be up and running!

I’got same modem, and the only configuration I did was the wvdial and its config file. Connection never got lost and its quite stable. Its even easier then in windows to run that little baby:)
Regards
Banan
21 Aug 08 at 6:38 pm
hmm i cant get it working… ive tryed nearly every guide i can find on google, but it just dosent pop saying “hey there if found a dial modem” just pops up with the “storage disk” im going mentaly! :/
when i execute the usb_modemswitch it sys that it dosent detect any usb drive so no need to change mode. how can it say that?
im bran new at ubunto so pleace help Mr. noob!
Max Freeman
3 Sep 08 at 8:54 pm
Max: check your usb_modeswitch config to make sure you uncommented the lines for the E220 device, also you might need to use the -H1 command to use the Huwaei switch command. Check usb_modeswitch –help.
Andrew Williams
17 Sep 08 at 2:57 pm
Hi,
I have the same modem and NM 0.7. When I manage to connect the datarate is good and the browsing smooth. However 9 out of 10 attempts I have as primary dns: 4.2.2.4 or 10.11.12.13. Under these circumstances, although the connection is active I cannot browse. Could you please check your log or tell me if you have experienced similar problems?
Thanks
Emilio
Emilio
30 Sep 08 at 8:40 am
Yes, sounds familiar. I used to attribute this down to a dodgy connection (as usually i’m travelling on the train). Maybe you could override the DNS in the NM settings, as DNS isn’t firewalled on Three.
Personally I use my own DNS servers, as I like being able to use “hostname” instead of hostname.domain.com.
Andrew Williams
30 Sep 08 at 9:06 am
It seems that the last SVN update solved the problem. Now although the DNS is 4.2.2.4 the connection is working. I travel by train myself and for the first time I had a good connection for all the trip.
By the way, in my case the DNS override in NM is not working.
Emilio
30 Sep 08 at 6:35 pm
[...] In the process of configuring my machine again I’ve noticed that the older guide for the E160G using Network Manager is a little wrong, so I’ll have to update that sometime. For now I’ll be sticking on [...]
Experimentation Failure | tensixtyone
15 Oct 08 at 11:09 pm
I’ve been trying this on Ubuntu Hardy and I can’t get it to work.
I manage to get USB_modeswitch to work fine but only when udev is restarted. It will not recognise the device when I plug it in after udev starts. Is that normal? And if yes, how can I get USB_modeswitch to run whenever the device is plugged in?
The next problem is that a version of NetworkManager (v0.6.6) is installed by default on Ubuntu but it doesn’t see the USB TTY ports. Is this the same software as the NetworkManager 0.7 that you mention in the article and should I upgrade it? If yes, how do I do that without losing the network connection? And how do I configure NetworkManager in the first place?
Sorry if all this sounds like very basic questions but my knowledge of how Linux works under the covers is not good enough to allow me to understand what’s not working.
Bruno
21 Oct 08 at 8:29 pm
With newer kernels I dont think you need USB modeswitch anymore, as the “option” driver seems to pickup the USB tty ports quite easily on it’s own.
I’m not sure which packages to get for Hardy, probably better looking for a more Ubuntu biased guide. Alot of people have had success using wvdial and gnome-ppp, so if you don’t feel like upgrading to a development version of Network Manager their is another choice.
Andrew Williams
21 Oct 08 at 9:24 pm
I just got one for my ancient Dell laptop, with Ubuntu Intrepid Ibex; plugged the dongle in, after a few seconds a box came up – New modem detected, click the network icon to connect…. More or less out of the box.
Mark Williams
3 Nov 08 at 8:30 pm
Yes, Intrepid includes Network Manager 0.7, it’s good news for ease of use! I’ve tried a Live CD of Intrepid recently but didn’t really use it for a prolonged period; the improvements seem to be worth the upgrade but for me, Debian is still my main workhorse.
Andrew Williams
4 Nov 08 at 10:06 am
I have a friend who is lying strapped to a bed with a broken neck. In order to stave off death by boredom, he got his wife to buy an ASUS EEE PC4G(170) running linux, and a HUAWEI E160G with 3 branding. I have been given these items, with instructions to get them working. In this, I have singularly failed, and I am really so linux-ignorant that I have no idea where to start. I can report that when trying to compile the modeswitch utility, it dies because it can’t find gcc or strip.
Is there anybody who can offer really basic advice? I’m not even sure which linux I am using, but I think it is based on Debian.
I know the dongle works, because everything springs to life on my windows laptop.
Pete Revell
15 Nov 08 at 10:32 pm
I use debian 5.0.1 I used teh ubuntu guide and I’m stuck here, keep telling me this
portatile@PC-PORTATILE:~$ wvdial
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ0
ATZ0
OK
–> Sending: AT Q0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
AT Q0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
OK
–> Sending: AT+CGDCONT=1,”IP”,”web.omnitel.it”,”",0,0
ERROR
–> Bad init string.
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ0
OK
–> Sending: AT Q0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
AT Q0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
OK
–> Sending: AT+CGDCONT=1,”IP”,”web.omnitel.it”,”",0,0
ERROR
–> Bad init string.
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ0
OK
–> Sending: AT Q0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
AT Q0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
OK
–> Sending: AT+CGDCONT=1,”IP”,”web.omnitel.it”,”",0,0
ERROR
–> Bad init string.
have tried wirh *99# and *99***16# and *99***1# as telepohone number , Id had 3 different behaviours, seems like it can’t go further
Manny
10 Jun 09 at 5:53 pm
Here is the config I use, change as needed.
[Dialer 3]Phone = *99***1#
Username = username
Password = password
Stupid Mode = 1
Dial Command = ATDT
Carrier Check = No
Modem = /dev/ttyUSB0
[Dialer hsdpa]
Modem = /dev/ttyUSB0
Baud = 460800
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+CGDCONT=1,"IP","3"
ISDN = 0
Modem Type = Analog Modem
Andrew Williams
10 Jun 09 at 10:37 pm
Manny,Andrew
It seems, that Manny’s modem needs the PIN to go further. This line should be added to /etc/wvdial.conf when you run wvdial for the first time after you plug in your USB modem. Replace 0000 with your PIN.
AT+CPIN=0000
If you want to run wvdial again (you didn’t unplug your modem) you have to remove that line.
Next step would be to create a separate profile inside /etc/wvdial.conf (in order not to edit it each time you should/shouldn’t use PIN). Or you could disable asking for PIN.
usugrin
14 Jul 09 at 7:00 pm
Followed your process and achieved similar results until $ wvdial
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0
–> Resending: ATZ
–> Modem is not responding
I am using a Telstra NextG usb modem in Australia.
Any clues? Frank
Frank Cerutti
18 Jul 09 at 12:43 pm
this reply is months later, but it may be of help to some:
how to configure Telstra NextG USB modem Australia
http://opensuse.swerdna.org/susenextg.html
pdc_2
13 Sep 09 at 3:17 am
Hi I know this is old now but first of all thank you for posting this up but I’m having trouble getting the rule file to work, should it have a specific name/prefixed number, does it have to be chmodded at all
George
18 Sep 09 at 7:07 pm