Personal tools
You are here: Home Docs Help! How-tos How to get online with 3G Broadband

How to get online with 3G Broadband

4.0

This How-to applies to: Ubuntu
This How-to is intended for: Beginner, Desktop User

This used to be quite difficult, but not any more ...

Purpose

To connect a laptop (or desktop) computer to the Internet using a 3G broadband connection.

Prerequisities

A laptop computer installed with Ubuntu (Hardy) 8.04 or later and a budget of at least £10 per month.

Step by step

The first thing you will need is an account with a mobile phone company. Not all companies are equal and not all are going to provide the results you want, in this instance I've chosen "three" primarily because they are offering rates I can afford and also because they offer kit that does work with Linux. [albeit they don't advertise the fact]

Three

I'm using their "Mobile Broadband" product they call "Broadband Lite (1GB)" which currently retails for £10 per month (incl) and comes with a free USB 3G modem if you subscribe to an 18 month contract. As it turns out they're currently running a special offer for existing customers and as I already have a three phone, they're only actually billing me £5 per month (incl).

Given my previous connection (just canceled) was with Vodafone and really didn't work very well at all (for me) and was costing me £25 (+VAT) per month, this seemed like an extraordinary good deal, assuming it works.

You can find a link to their pricing page here.

The Modemmodem.gif

When you order, be sure to specify the larger white modem, which is actually a HUAWEI E220 HSDAP USB Modem which is well supported under Linux. I managed to find references to the black modem not working (at all) and no references at all to the thinner pen-drive like modem, so this may or may not work.

It's a fairly robust-looking compact device that comes with two custom USB cables, a nice short one and a long one .. fairly comprehensive in these days of "lets see how little we can fit into the box".

Performance

I've just switched across to my laptop to write the next section of this page, just to prove it works! I'm running "pppstatus" while working to get an idea of the real speed I'm seeing and it looks like my peak throughput when opening this page was about 28k bytes per sec, or 256k bits per sec in terms of ADSL speeds. Although this doesn't sound great there are a few things that we should bear in mind;

  • This speed is quite usable
  • The coverage for my house is not great, I can't even get a terrestrial TV signal (I can only want TV via Sky)
  • Vodafone coverage for this spot was intermittent, if I got online it was usually only for short periods, and thuput was far worse!

My experience with Vodafone was that speed and response times were heavily dependent on signal quality and at the end of the day, it's whether you can get connected when you really need to that makes the difference. So the fact that I get a constant connection from this spot is a major improvement on my previous connection, and speed isn't all that relevant to me.

Watching ping times, performance varies (sometimes wildly) but I'm guessing the torrential rain outside the window really doesn't help. Here's a quick ping test to give you an idea;

# ping -n -c10 linux.co.uk
PING linux.co.uk (87.102.101.168) 56(84) bytes of data.
64 bytes from 87.102.101.168: icmp_seq=1 ttl=49 time=453 ms
64 bytes from 87.102.101.168: icmp_seq=2 ttl=49 time=434 ms
64 bytes from 87.102.101.168: icmp_seq=3 ttl=49 time=135 ms
64 bytes from 87.102.101.168: icmp_seq=4 ttl=49 time=154 ms
64 bytes from 87.102.101.168: icmp_seq=5 ttl=49 time=453 ms
64 bytes from 87.102.101.168: icmp_seq=6 ttl=49 time=454 ms
64 bytes from 87.102.101.168: icmp_seq=7 ttl=49 time=144 ms
64 bytes from 87.102.101.168: icmp_seq=8 ttl=49 time=144 ms
64 bytes from 87.102.101.168: icmp_seq=9 ttl=49 time=144 ms
64 bytes from 87.102.101.168: icmp_seq=10 ttl=49 time=154 ms

--- linux.co.uk ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8998ms
rtt min/avg/max/mdev = 135.390/267.364/454.912/148.398 ms
screen1.png

Getting Configured

So, to get going here's what you need to do.

  • Left click on the network manager icon in the top right of the screen and select Manual Configuration, this should let you into the network configuration application. 
  • Next, click on the Unlock button and enter your password. This assumes that your user account has sufficient permissions to be able to configure the system, if it doesn't you will need to speak to whoever is responsible to making changes to your system who does have the required level of permissions.
  • You should have an entry entitles "Point to point connection", select this and click on the Properties button.
  • Fill in the details as follows:ppp.png
    Enable this connection
    Connection type: GPRS/UMTS
    Access point name: three.co.uk
    Username: three
    Password: three

  • Now click on the Modem Tab
  • Change the modem port to: /dev/ttyUSB0
  • Now click on the Options Tab
  • Make sure the "Set modem as default route to the Internet" and "Retry connection" options are selected.
  • The other option related to DNS servers, typically I don't tick this box and instead rely on a localy configured name server rather than those allocated by "three". For some reason it seems the DNS servers mobile operators offer seem not to work .. not sure as to why.

A Note on DNS Servers

If you don't already have a local DNS server setup, check the following before going any further. Implementing these steps if they've already been done isn't going to cause any problems.

  • Start a terminal session from Applications -> Accessories -> Terminal
  • Type; sudo apt-get install bind9
  • Enter your password

Now go back to the Network Manager screen by clicking on the icon in the top right of the screen (as detailed above) , select Manual configuration and click on the DNS tab. You should see one entry labeled "127.0.0.1", if you don't, click add, enter 127.0.0.1, hit Return, then click Close.

Making / Breaking the connection

This is where it starts to get a little easier, click on the network manager icon, select dial up connections, then you have Connect or Disconnect.

Watching the traffic

There are lots of tools that will provide you with statistics, pppstatus is a nice easy one. To install, start a terminal session and type;

apt-get install pppstatus
pppstatus

What if it all comes unstuck

Take a look in your system log for anything related to PPP .. then post your queries on the forums.

Further information

If you look under the hood, the Network Manager system actually creates "normal" ppp config files that you can examine and look at using a standard text editor. The relevant files are;

  • /etc/ppp/peers/ppp0
  • /etc/chatscripts/ppp0

If your connection fails to work first time, try looking at these files and modify them to match the following working templates;

# /etc/ppp/peers/ppp0

defaultroute
persist
/dev/ttyUSB0
user "three"
password "three"
connect "/usr/sbin/chat -v -f /etc/chatscripts/ppp0"
460800
# /etc/chatscripts/ppp0
ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'ERROR'
'' AT
OK ATZ
#OK AT+CPIN=**** # pin code for SIM card if applicable
OK AT+CGDCONT=1,"IP","three.co.uk"
OK ATDT*99***1#

For testing purposed I use a package called wvdial which has a nice auto-configuration program (wvdialconf) which will scan all available USB modem devices to see what's there, then generate some generic dial scripts. (running wvdial will then attempt a dialup connection).

Raw Debugging

One word "minicom".

minicom -s

Change the serial device to /dev/ttyUSB0 and try some of the following commands;

AT+COPS? # which network are we on
+COPS: 0,0,"3 UK",2
OK
AT+CSQ   # what's the signal strength
+CSQ: 4,99
OK

For more help / information, please see the Forums.

 

Check "/etc/chatscripts/ppp0" ...

Posted by Gareth Bult at Jul 10, 2008 04:03 PM
Strictly speaking you should select "serial modem" as the device type, rather than GPRS, although when you retun to the configuration, it will read GPRS regardless of whether you chose GRPS or serial when setting up.
(this would be a bug in "gnome-network-admin" ..)

When you add a serial modem, you will be prompted for a phone number, this should be; *99***1#

To be absolutely sure, check /etc/chatscripts/ppp0, the last line should read;
OK ATDT*99***1#
Data recovery service >
Low cost professional data recovery is available. See the specialists.
Ink Jet Cartridges
Here you can find inkjet cartridges for all major printers.
compatible ink
We provide ink from the top brands for great value. Or you can get our own fully guaranteed compatible ink cartridges for a great saving.
IT support London
Connect is a London based Personal Computing company. We can provide you with unlimited access to an IT helpdesk and on-site support.
Dedicated SERVERS
Before renewing your contract with the company hosting your current server check out this site.
BROADBAND PROVIDER
When you choose Virgin Media as your broadband provider, you also get enough web space to build your own site. If you want to.
Laptop
Visit CheckCost UK to compare, review and buy latest computers, laptops, scanners, printers, hard drives, LCD monitors and many more.
Software
Visit Ecost Software to find your favourite brands like Adobe, Apple, Microsoft, Autodesk, Codegear, Corel, Symantec and more.
Internet Services
Looking for web design, web hosting or online application development, try Encryptec!