Home
Home Blogs k4tz's blog
    • Blog
    • Clinic
    • Contact
    • Download
    • Video
    • Login

Poll

Favourite console text editor in Ubuntu:

LXer -- Linux and Open Source News

  • Ubuntu 10.10 beta – an insider’s view
  • Equinox Introduces 2 Other Brilliant Themes, Installation Made Easy via PPA
  • First Alpha of uTorrent Server for Linux Released
  • A Linux Demo For Amnesia: The Dark Descent
  • Fedoraproject.org redesign looking really, really great
more

Linux Today

  • Editor's Note: Holiday Tech Fun
  • Mint 9: Minty fresh Linux
  • Amnesia: The Dark Descent Demo Released!
  • Android: the return of the Unix wars?
  • Songbird 1.8.0 adds support for more devices
more

Linux Insider

  • Tablet Skirmish Heats Up With Toshiba Entry
  • Samsung's Galaxy Whirls Into the Tablet Universe
  • Sony's Shocking 'Other OS' Win and Suspect Distro Popularity Trends
  • 2 Smart Backup Apps Show You the Way to Go Home
  • Cloud Computing Calms Open Source Warfare
more

3G Modem Installation on Ubuntu

Submitted by k4tz on Fri, 06/13/2008 - 10:43
  • Blog
  • Linux

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

three 3g modem

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

The 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 = 460800

Yes, 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.conf

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

gnome-ppp three 3g modem ubuntu
Connecting, it takes some 10 second if the signal is fine

gnome-ppp three 3g modem ubuntu
Waiting for prompt…

gnome-ppp three 3g modem ubuntu
Finally connected!

gnome-ppp three 3g modem ubuntu
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 three 3g modem ubuntu
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 ttyUSB1

But 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/

  • k4tz's blog
  • Add new comment
Visitor's picture

Setting up wvdial to support Three

Submitted by Visitor on Thu, 01/01/2009 - 10:56.

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

  • reply
k4tz's picture

Re: Setting up wvdial to support Three

Submitted by k4tz on Fri, 01/09/2009 - 14:36.

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

 

  • reply

Recent blog posts

  • How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx
  • Download Linux Mint 9 "Xfce"
  • ISO Booting with Grub 2 in Ubuntu
  • Howto Fix Rhythmbox Iphone + Ipod Sync Issues in Ubuntu
  • How to install Ubuntu 10.04 on Thinkpad x201
  • Fix for Audio Problem in Dell Studio 1450 in Ubuntu 10.04 (lucid lynx)
  • Howto optimize Flash in Firefox on Ubuntu
  • HP Laserjet P1006 Printer not Working on Ubuntu
  • How to get video recording working with Acer Crystal Eye Webcam on Ubuntu
  • Reset your Windows password and edit the Windows Registry from Ubuntu
more

Linux World

  • Net Neutrality: what does the Google Verizon proposal mean for GNU Linux?
  • Why can't free software lead to hardware innovation?
Archive Syndicate content

Recent comments

  • Re
    34 weeks 4 days ago
  • Re
    34 weeks 4 days ago
  • Re
    35 weeks 4 days ago
  • Re
    36 weeks 22 hours ago
  • Re
    36 weeks 5 days ago
  • Re
    36 weeks 5 days ago
  • Re
    37 weeks 2 hours ago
  • iwl3945
    38 weeks 4 days ago
  • HomeBank
    50 weeks 5 days ago
  • KMyMoney and direct connect to banks
    1 year 2 weeks ago
All contents copyright © 2008, Dhuha Net. All rights reserved
Ubuntudoctor® is a member of the Dhuha Network. Privacy Policy
RoopleTheme