3G Mobile Broadband with Ubuntu-eee

It took me a while to figure out how to get a dial-out connection using a Huawei E220 USB mobile broadband dongle.  Mine was supplied by Three in the UK so this is specific to them, but if you’re not on three this should give you a starting point…

Edit or create the file /etc/wvdial.conf with the following content:

[Dialer defaults]
Modem = /dev/ttyUSB1

[Dialer three]
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *99\#
Modem = /dev/ttyUSB0
username = username
Password = password
Dial Command = ATDT
Baud =466600
Init4 = AT+CGDCONT=1,"IP","three.co.uk"

You can then dial out by issuing the command “sudo wvdial three”

Note that Firefox assumes that if you aren’t connected via Network Manager, then you’re not online and starts up in offline mode.  Uncheck the option on the file menu and you should be OK.

Note also there seems to be some bug in Three’s DHCP stuff… if you see that on connection you are set up with a DNS server of 10.11.12.13 then it’s wrong… drop the connection and reconnect (or edit your /etc/resolv.conf file manually)

18 Replies to “3G Mobile Broadband with Ubuntu-eee”

  1. Also, if you use this method to connect under Linux, you may find (if you have no other network connections active) that when Firefox starts up, it does so in “offline mode”. This is because it queries the Network Manager application, and if *that* has no active connections, Firefox assumes it’s off-line.

    You can simply uncheck the “work offline” option in Firefox’s File menu, but you have to do that each time, which starts to get a bit tedious.

    I’ve just discovered an “about:config” setting which prevents Firefox from querying Network Manager, and keeps it in online mode all the time. Simply set

    toolkit.networkmanager.disable

    to true and the job’s done.

  2. Excellent post, worked first time. Thanks very much.

    I have seen the DNS problem of getting 10.11.12.13 as the server IP. When it connects properly it shows the servers as:-

    primary DNS address 172.31.76.69
    secondary DNS address 172.31.140.69

    What I have done is taken a copy of resolv.conf once I have a valid connection and just copy that back over whenever I get a bad IP.

    So do the following the first time you get a proper connection:-

    sudo cp /etc/resolv.conf /etc/resolv.conf.three

    Then whenever you get a bad DNS server of 10.11.12.13 just do:-

    sudo cp /etc/resolv.conf.three /etc/resolv.conf

  3. Yup, that’s what I do too, I should have listed that as well. Thanks!

  4. Or, you can just use “sudo chattr +i /etc/resolv.conf” when you have the correct IP addresses; that stops the dialer from overwriting it.

  5. This Actually works with other Hueawei Dongles as well. In my computer I managed to make work the E156G modem under ubuntu linux

  6. Please help! I am new to Linux and love it however I have read the above threads but am totally lost. Can anyone simplify with real step by step instructions e.g. go to and click on etc.

  7. This has worked great for me although being new to linux still I was wondering what the correct protocol would be for stopping the wvdial service…..or is it to just pull the plug on the dongle?

    I too am on the 3 network….when I first connect the device and it dials up it’s reporting I’ve got full 3G (fastest) connection but just as soon as I try to retrieve a web page or email this drops off to the next lower speed. Any thoughts?

    Thanks for the post,

    Steve

  8. Hi Steve,

    The cleanest way to stop the wvdial is to press Ctrl-C in the terminal in which it is running. It will catch that and shutdown the connection.

    With regard to the step-down, I see mine changing quite a bit, up and down. I guess (but don’t know) that it steps down when it thinks it doesn’t need to be at full speed.

  9. Hi Martyn

    Thanks for the swift response. Will give Ctrl-C a go and see how it performs.

    With regards to the step-down in speed I need to test it further. From my inital use it seemed that when idle (i.e. not downloading any data) the flashing light indicated it was at full speed. Whenever I called it into action the step-down occurred….and it was dog slow!! And this I tested over a number of websites.

    The USB device definitely works okay as I’ve already tested on another machine.

    Not sure if this matters but I’m using the Dell Mini 9 with their flavour of Ubuntu 8.04.

    Thanks again,

    Steve

  10. I am just about to do the jump from windows to linux ubuntu to see what it is like, i too have a 3 dongle could some one please simplify the above.
    can do anythin in windows but linux is a new ball game many thanks.

  11. Just tried this on my new Aspire One, and discovered that Linpus Linux Lite doesn’t let you write to /etc. Even if you’re logged in as root.

    Anyone got another idea?

  12. Hi everyone,

    I have tried the above, but when the ‘wvdial thre’e command is entered, the terminal returns: ‘Cannot open /dev/ttyUSB0: No such file or directory’

    Does anyone have any ideas why this is happening and what ttyUSB0 is?

    Cheers!

  13. Hi Martyn,

    Thanks for the your blog post.

    I tried what you instructed, but got to “sudo wvdial three” just as Rich posted above and got the message saying ‘Cannot open /dev/ttyUSB0: No such file or directory’.

  14. hi
    thanks, worked using old linux fedora 7
    using HuaWei Broadband E156G
    toshiba satellite

  15. Hi everybody,
    If you get the message : ‘Cannot open /dev/ttyUSB0: No such file or directory’.
    You just need to change ‘ttyUSB0’ in ‘/etc/wvdial.conf’ to your usb port where you have the modem ,to find it use this command ‘wvdialconf’ , it will show you a message like :
    ‘Found a modem on /dev/ttyUSB1.’
    so all you have to do is change ttyUSB0 to ttyUSB1 (in this exemple) in ‘/etc/wvdial.conf’.

  16. Im just getting “bad init string” or “unknown dial command” :\

  17. my ubuntu 10.04 is requesting for a password whenever i connect my huawei e156g mobile broadband to access the internet.

  18. Hello guys,

    Iam planning to use 3(operator) Mobile broadband in Sweden.
    I just installed Ubuntu 11.04 in my HP-Pavilion-dv2700-Notebook-PC.
    Iam not able to configure this mobile broadband(3 operator).

    Earlier i was using Telia mobile broadband in Ubuntu 10.04 it was working fine. Now i have moved to operator 3 and also i installed Ubuntu 11.04.
    I added the profile Network->edit Connections-> Mobile Broadband (tab)i have given all right parameters. Still i didnt manage to connect.
    I feel like lost connection with the World without the internet.

    I just noticed my Wireless is also not enalbed. Strange it says wireless is disable by hardware switch. But it is Switched on , i tried by restarting also. Its really wierd.

    Can some help in this regard.

    BR
    Satheesh M

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.