3G Modem Installation on Ubuntu
Little note for the beginning. I bought the modem at Carphone Warehouse in Coventry. The seller told me — answering my question about operating system support — that the modem only works in Windows XP or Vista. No Mac support. No Linux (in fact has never heard the word ‘Linux’ in his life). Used to not trusting the sellers (the one in T-Mobile told me before that their modem works flawlessly in all operating systems, including Linux — even though he also heard this name for the first time from my mouth) I bought the modem and started testing (you have three days to give it back and claim your money back for no reason).
I was kindly surprised Ubuntu comes with the drivers to Huawei E220 modem. They’ve been bundled into the Linux kernel since version 2.6.20. Running the modem was then only a matter of installing a proper dial-in program (the default one could be used as well, but it sucks a big one) and configuring it, which proved to be effort-less as well. So here it goes.
Installing the software
I have decided to install wvdial, a PPP dial-in command line software, and a GNOME frontend to it — gnome-ppp:
sudo apt-get install wvdial gnome-pppThe latter is part of the universe repository so you need to have it enabled in order to install it. That’s it about the installation, believe it or not.
Setting up wvdial to support Three UK 3G modem
Wvdial is not just ta plain-stupid dialer. It has some built-in intelligence. It can autodetect modems of all kind and auto-configure them. That’s why there is really not so much configuration, either.
First run wvdialconf utility to detect and configure your modem. I did it as root. If you want to dial-in as user, you need proper permissions for this. Here is the output of the command:
# wvdialconf
Editing `/etc/wvdial.conf'.
Scanning your serial ports for a modem.
Modem Port Scan< *1>: S0 S1 S2 S3
ttyUSB0: Device or resource busy
Modem Port Scan< *1>: USB0
WvModem< *1>: Cannot get information for serial port.
ttyUSB1< *1>: ATQ0 V1 E1 — OK
ttyUSB1< *1>: ATQ0 V1 E1 Z — OK
ttyUSB1< *1>: ATQ0 V1 E1 S0=0 — OK
ttyUSB1< *1>: ATQ0 V1 E1 S0=0 &C1 — OK
ttyUSB1< *1>: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyUSB1< *1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
ttyUSB1< *1>: Modem Identifier: ATI — Manufacturer: huawei
ttyUSB1< *1>: Speed 9600: AT — OK
ttyUSB1< *1>: Max speed is 9600; that should be safe.
ttyUSB1< *1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
Found a modem on /dev/ttyUSB1.
Modem configuration written to /etc/wvdial.conf.
ttyUSB1 : Speed 9600; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0″ As you can see, it wrote the configuration to /etc/wvdial.conf file. We’ll need to fix it only a bit. Here is my conf after the fixes:
# cat /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *99#
Username = three
Password = three
Modem = /dev/ttyUSB1
Dial Command = ATDT
Baud = 9600
[Dialer three]
Init2 = ATZ
Init3 = ATE0 V1 &D2 &C1 S0=0 +IFC=2,2
Init5 = AT+CGDCONT=1,”IP”,”3internet”
ISDN = 0
Modem = /dev/ttyUSB0
Modem Type = Analog Modem
Baud = 460800Yes, you see it right. The only changes you need to make is the phone number (if not set correctly to this weird value), user name and password (which are simply “three”). That’s all, really. Now try dialing in:
# wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Tue Jun 10 08:26:25 2008
--> Pid of pppd: 25359
--> Using interface ppp0
--> pppd: ��[06][08]@�[06][08]
--> pppd: ��[06][08]@�[06][08]
--> pppd: ��[06][08]@�[06][08]
--> pppd: ��[06][08]@�[06][08]
--> pppd: ��[06][08]@�[06][08]
--> pppd: ��[06][08]@�[06][08]
--> local IP address 10.231.99.246
--> pppd: ��[06][08]@�[06][08]
--> remote IP address 10.64.64.64
--> pppd: ��[06][08]@�[06][08]
--> primary DNS address 172.31.76.69
--> pppd: ��[06][08]@�[06][08]
--> secondary DNS address 172.31.140.69
--> pppd: ��[06][08]@�[06][08]
--> pppd: ��[06][08]@�[06][08]
--> Connect time 0.6 minutes.Yuppi! We got connected! It really works! And it’s that simple. Amazing ![]()
Using gnome-ppp
If you are scared of the fact of connecting to network using the command line tools, gnome-ppp may be of some help. It’s a simple frontend to wvdial program, doing basically all the same, but with the ability to hide itself in the notification area.
Gnome-ppp uses the same configuration as wvdial. By default, it looks for the config file in ~/.wvdial.conf. I symlinked this file with the wvdial configuration, so that when I run wvdialconf it updates the gnome-ppp config as well:
# ln -s /etc/wvdial.conf ~/.wvdial.confNow you can simply run gnome-ppp. I do it as root. You can do it either as root or as user (with the proper permissions set).

Connecting, it takes some 10 second if the signal is fine

Waiting for prompt…

Finally connected!

Yes, it can automatically reconnect, as well.
So, as you can see, using the gnome-ppp app is fairly simple as well. I prefer wvdial anyway, since it seems more reliable. Gnome-ppp once in a while refused to connect even though the signal was good and wvdial didn’t protest. It may have been some specific issue though, your mileage may vary.

Gnome-ppp configuration dialog
Issues with 3G modem in Ubuntu Linux
The only issue I have noticed so far is that once every few times, the system refuses to detect the modem. It’s being noticed in dmesg like that:
[ 50.914987] airprime 3-1:1.0: GSM modem (1-port) converter detected
[ 50.915110] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 50.929802] usb-storage: probe of 3-1:1.1 failed with error -5
[ 50.929822] airprime 3-1:1.1: GSM modem (1-port) converter detected
[ 50.929937] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB1But it still fails to detect the modem when I run wvdial. Seems like an Ubuntu-specific issue. After reboot it always worked again. It’s one of the many reboot-and-work issues I have with Ubuntu 8.04, others being GTK-apps freezing, network freezing and so on. Anyway, it’s not the time to complain about Canonical, I did it in my Ubuntu 8.04 review anyway.
Huawei E220: Linux vs Windows support
Amazingly, I found the Linux support more reliable than the one in Windows. It does better in reconnecting automatically after losing the signal. In the default Windows app from Three, I had to manually close the connection and press “Connect” again, in order to reconnect. This is a very awkward solution, especially when I connect in trains when the network isn’t always perfect, to put it nicely.
The Windows client has a nice feature, however, of counting all the data we transferred using the 3G modem. This is especially handy in my case, since I went for the Pay-As-You-Go Three plan which gives me 1GB of transfer per month for 10 pounds.
Probably there is some way to achieve the same thing on Ubuntu, but I did not feel like searching, since this is not that important for me anyway. If you have a ready-to-use solution though, please share it in the comments section.
Pricing and availability
The modem costs currently 50 pounds in Pay-As-You-Go at Three. You can get either 1GB for 10 pounds or 3GB for 15 pounds. One pop-up works for a month only so if you don’t use your allowance, it is lost. There same modem is being currently sold by many other UK vendors like T-Mobile or Vodafone. They should work exactly the same, although the user details and password may differ.
Final conclusions
I use the Three 3G modem in Ubuntu on my every-day travels between Coventry and London Euston. It proves to work fine (although I expected the signal to be a bit better in Virgin Trains, but it’s another story). As I use the Internet during travel mostly to check e-mail, get some RSS feeds and post some news-stories or articles on one of the websites, the random signal is not a nightmare for me. For a person who would like to do some serious work it might be an issue, though. In all other places except for the trains, I was very satisfied with my 3G modem. It just works and the connection speed it pretty good for mobile access, so I cannot complain. It’s good to know that for the mobile Linux users, there is a quite cheap solution to get the Internet connection nearly everywhere.
Source : http://polishlinux.org/linux/ubuntu/three-uk-3g-modem-in-ubuntu-linux/


Setting up wvdial to support Three
Hello,
Can you please tell me how i would edit the information below? I want to change the phone, username and password on the dialer defaults..
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = ?????
Username = ?????
Password = ?????
Modem = /dev/ttyUSB1
Dial Command = ATDT
Baud = 9600
Ive been trying to connect to 3 broadband for over a week now and this post seems to be the most helpful!
Thanks, Fc
Re: Setting up wvdial to support Three
The information that u try to edit is wvdial.conf file. You can edit the file using this command in Terminal:
sudo vi /etc/wvdial.conf
OR
sudo gedit /etc/wvdial.conf
If you have any difficulties you may ask me again :)