Navigate/Search

Huawei e169 on linux. It can be done!

After much buggering about, I finally got this *&#$# Huawei e169 working. This method requires no mucking around in the kernel, just the usb_modeswitch utility and wvdial. For reference, this was a unit supplied from Optus in Australia for their Optus Wireless Broadband service. It’s set up on an old laptop running Ubuntu 8.04, Hardy Heron. There’s no good guide out there for the e169 at the time of writing.

First, grab usb_modeswitch from http://www.draisberghof.de/usb_modeswitch/

There’s nothing to install, you just need the compiled executable. There’s a config file, but I found it far simpler to just use command line arguments. The commands for the e169 need to be executed in order, and they’re as follows:

./usb_modeswitch -v 0×12d1 -p 0×1001 -d 1

./usb_modeswitch -v 0×12d1 -p 0×1001 -H 1

Once that’s done, the device should be recognised and /dev/ttyUSB0 should be created. Yay!

Now, you need to spend a second setting up /etc/wvdial.conf The below should be pretty universal:

[Dialer Defaults]
Phone = *99#
Username = *
Password = *
New PPPD = yes

wvdial looks for a device at /dev/modem, but ours is at /dev/ttyUSB0. My somewhat hacky solution was

sudo ln /dev/ttyUSB0 /dev/modem

Jerome in the comments has suggested adding this section to the conf file instead of creating a link as above. It’s untested by me, but looks like it should work fine. It’s a much cleaner solution than the crossed out one above, too. Add it right at the beginning of the file.

[Modem0]
Modem = /dev/ttyUSB0

If you use this solution (which you should) remove the “sudo ln…” lines from connect.sh.

Now, just executing wvdial in a terminal should get you connected. It takes a little while, about 30 seconds I guess, but the important thing is that it works, and it’s pretty simple.

Since this connection is on a laptop intended for my grandfather, who is a fairly new computer user, I wanted to make the connection automatic in order to simplify things. I put this script in /etc/init.d/ which worked a treat. http://dbe.cc/pub/connect.sh

Don’t forget to run sudo update-rc.d connect.sh defaults

The script will need to be tweaked to include the location of the usb_modeswitch executable on your system. Unless your username happens to be brian and it’s in a directory called .huawei under your home folder. That’d be a pretty crazy coincidence though. If people are actually finding this post and using the script I’ll update it to be more user friendly. Naturally, if you don’t want it executing on boot, you can just save the script as an executable and run it (as root) when you please.

Also:

Because this connection doesn’t run through network-manager, it confuses firefox a little. All it means is that firefox starts itself in offline mode. You can just untick “Work offline” in the File menu. I solved it more permanently with instructions from here: http://ubuntuforums.org/showthread.php?t=767045

It’s late, so if there’s anything I’ve missed or anything that’s unclear, please let me know in the comments. I’ll do my best to help out.

45 Responses to “Huawei e169 on linux. It can be done!”

  1. jerome colombie Says:

    thank you for this great manual.

    instead of the link ’sudo ln /dev/ttyUSB0 /dev/modem’ you can add the following line to the config file ‘/etc/wvdial.conf’ at the beginning:
    [Modem0]
    Modem = /dev/rfcomm0
    [Dialer Defaults]
    Phone = *99#
    Username = *
    Password = *
    New PPPD = yes
    Inherits = Modem0

    thanks again

  2. jerome colombie Says:

    Sorry

    The line
    Modem = /dev/rfcomm0
    should be
    Modem = /dev/ttyUSB0
    of course

  3. admin Says:

    Thanks for the tip, Jerome. I felt guilty about my horribly hacky linking of files, but by the time I got it working I couldn’t face the idea of looking for a cleaner way to do it. I’ve updated the instructions per your advice.

  4. JohnC Says:

    Hi,
    Thanks for the manual. It works for me up to creating /dev/ttyUSB0. But then running wvdial (as root) gives me this:

    #usr/bin/wvdial
    –> WvDial: Internet dialer version 1.54.0
    –> Cannot get information for serial port.
    –> Initializing modem.
    –> Sending: ATZ
    ATZ
    OK
    –> Modem initialized.
    –> Sending: ATDT*99#
    –> Waiting for carrier.
    ATDT*99#
    CONNECT
    –> Carrier detected. Waiting for prompt.
    –> Don’t know what to do! Starting pppd and hoping for the best.
    –> Starting pppd at Thu Aug 21 11:27:12 2008
    –> pid of pppd: 3517
    –> Using interface ppp0
    –> local IP address 58.111.7.xxx
    –> remote IP address 10.64.64.xx
    –> primary DNS address 61.88.88.88
    –> secondary DNS address 61.88.88.88

    … and here we stay until I kill the process. I can ping my local IP, but nothing else. Running ps ax gives me:

    3776 pts/2 S 0:00 /usr/sbin/pppd 57600 modem crtscts defaultroute usehostname -detach user * noipdefault call wvdial usepeerdns idle 0 logfd 6 remotename *

    I also notice that the connection’s at 57600. But it’s rather a long time since I used pppd and that’s probably the result of misconfiguration (or Optus not delivering their broadband speed in my street).

    Any thoughts on where I’ve gone wrong? Did you go down this path before you got it working? Any suggestions gratefully received.

    JohnC

  5. Babau Says:

    That’s pretty much what happens to me, too. But at that point I have an internet connection. It’s assigned you an ip, everything should work.

    Only difference is, I don’t run wvdial as root. It’s possible that that’s your issue, the connection is only usable by root since it was started by root. Try just running plain ‘ol wvdial.

    I know the script probably runs it as root and works, but I’m out of ideas. Let me know how you go.

  6. Babau Says:

    A further thought occurs. You’re using the new method where wvdial addresses /dev/ttyusb0 directly without the ln to /dev/modem right? What are the permissions set to on that file?

  7. JohnC Says:

    Hi,
    I finally managed to get it working! The problem was the ethernet card in the machine. Just deactivating it didn’t work - I had to disappear it altogether. Strangely enough, wvdial still likes to be run as root. Will have to investigate further. But at least it works. Thanks for the help. One question though: What baud rate do you set in wvdial.conf, or do you let it run at whatever the default might be? And what sort to speed/data transfer do you manage?

    John

  8. can you post ppd options Says:

    my aa1 not configured for pppd

  9. Stu Edgar Says:

    Sorry, a bit more on above. By using above method I get modem recognized but when running wvdial I get a connect from Optus, however pppd exits almost immediately with error 2. I dont have anything in /etc/ppp/hosts, and imagine that is the problem.
    My Aspire 1 running Linpus is pretty light on that sort of stuff.
    Any help appreciated.
    Stu

  10. admin Says:

    JohnC - I didn’t specify a baud rate and didn’t run any speed tests I’m afraid, I’ll try and remember to have a look next time I’m at my grandfather’s. It felt like a 3G connection on the default baud rate, though. Snappy enough, about the same as using a 3G handset tethered.

    Stu - I’ve got no experience at all with Linpus, I’m afraid. The Ubuntu machine I’m on doesn’t have anything in /etc/ppp/hosts either (the file doesn’t actually exist) so it’s either a different issue or Fedora and Debian go about it in different ways.

  11. JohnC Says:

    Edgar:

    man pppd lists the error messages:
    .
    .
    2 An error was detected in processing the options given, such as two mutually exclusive options being used.
    .
    .
    I would try to find out what arguments pppd is using, maybe by quickly doing a ps ax (or whatever) before it dies. Then you might be able to figure which options are incorrect. Also, did you run wvdialconf (as root) and let it create the modem’s config file - which you’ll have to then edit. It may turn up something.
    I have discovered that I need to always run wvdial as root - because of the permissions on the pap-secrets & chap-secrets files. I suppose I might be able to change that, but as I start usb_modeswitch and wvdial at boot time, it doesn’t really matter.

    I also do not have a /etc/pppd/hosts file.

    Good Luck.

  12. Stu Edgar Says:

    Thanks John C - I havent run wvdialconf yet but have hand edited - will do so
    Does wvdial conf change anythgi in etc/ppp/ ?
    Thanks heaps
    Stu

  13. JohnC Says:

    Stu-

    No, I don’t think so. But something (pppd or wvdial ?) accesses the *secrets files and (creates?) the copy of resolv.conf there everytime I connect to Optus. On my Fedora box, everthing in /etc/ppp is owned by root, and the *secrets files are rw for root only.

  14. Stu Edgar Says:

    Still wrestling with ppp
    see below
    John C what is your options file?
    Ta
    Stu

    –> Sending: ATZ
    ATZ
    OK
    –> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    OK
    –> Sending: AT+CGDCONT=1,”IP”,”internet”
    AT+CGDCONT=1,”IP”,”internet”
    OK
    –> Modem initialized.
    –> Sending: ATDT*99#
    –> Waiting for carrier.
    ATDT*99#
    CONNECT
    –> Carrier detected. Waiting for prompt.
    –> Don’t know what to do! Starting pppd and hoping for the best.
    –> Starting pppd at Tue Sep 2 07:03:22 2008
    –> Pid of pppd: 20351
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> Using interface ppp0
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> Authentication (CHAP) started
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> Authentication (CHAP) started
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> Authentication (CHAP) successful
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> pppd: ��[06][08]��[06][08]��[06][08]
    –> Disconnecting at Tue Sep 2 07:03:27 2008
    –> The PPP daemon has died: A modem hung up the phone (exit code = 16)

  15. JohnC Says:

    Stu-

    My /etc/ppp/options file currently contains only the word “lock”. The man file for pppd says:


    Options can be taken from files as well as the command line. Pppd reads options
    from the files /etc/ppp/options, ~/.ppprc and /etc/ppp/options.ttyname (in that
    order) before processing the options on the command line. (In fact, the command-
    line options are scanned to find the terminal name before the options.ttyname file
    is read.) In forming the name of the options.ttyname file, the initial /dev/ is
    removed from the terminal name, and any remaining / characters are replaced with
    dots.

    An options file is parsed into a series of words, delimited by whitespace.
    Whitespace can be included in a word by enclosing the word in double-quotes (”).
    A backslash (\) quotes the following character. A hash (#) starts a comment,
    which continues until the end of the line. There is no restriction on using the
    file or call options within an options file.


    ——-

    The contents of my /etc/ppp directory:

    -rw——- 1 root root 240 Sep 5 08:11 chap-secrets
    -rw-r–r– 1 root root 1042 Jul 13 2006 firewall-masq
    -rw-r–r– 1 root root 913 Jul 13 2006 firewall-standalone
    -rw-r–r– 1 root root 0 Jul 20 2006 ioptions
    -rwxr-xr-x 1 root root 386 Jul 11 2006 ip-down
    -rwxr-xr-x 1 root root 3485 Sep 12 2006 ip-down.ipv6to4
    -rwxr-xr-x 1 root root 430 Mar 20 2006 ip-up
    -rwxr-xr-x 1 root root 6687 Sep 12 2006 ip-up.ipv6to4
    -rwxr-xr-x 1 root root 1916 Sep 12 2006 ipv6-down
    -rwxr-xr-x 1 root root 3369 Sep 12 2006 ipv6-up
    -rw-r–r– 1 root root 5 Jul 25 2006 options
    -rw——- 1 root root 239 Sep 5 08:11 pap-secrets
    drwxr-xr-x 3 root root 4096 Aug 21 14:47 peers
    -rw-r–r– 1 root root 104 Jul 13 2006 pppoe-server-options
    -rw-r–r– 1 root root 46 Sep 5 08:11 resolv.conf

    —————-

    my /etc/wvdial.conf looks like this:

    [Dialer Defaults]
    Modem = /dev/ttyUSB0
    Baud = 460800
    Init1 = ATZ
    Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    ISDN = 0
    Phone = *99#
    Username = *
    Password = *
    New PPPD = yes
    Stupid Mode = 1

    ——————-
    Thiis file (wvdial.conf), oddly, gets trashed at times, which of course messes up the operations of wvdial. So I keep a replacement ready.

    My /etc/usb_modeswitch.conf has eveything commented out except:

    ########################################################
    # Huawei E169
    #
    # Contributor: Dale Lane

    DefaultVendor= 0×12d1;
    DefaultProduct= 0×1001

    # choose one of these:
    ;DetachStorageOnly=1
    HuaweiMode=1

    ########################################################

    ————-
    ps ax tells me how /usr/sbin/pppd is called:

    2303 ? S 0:00 /usr/sbin/pppd 460800 modem crtscts defaultroute usehostname -detach user * noipdefault call wvdial usepeerdns idle 0 logfd 6 remotename *

    ————

    Have you checked the permissions of the files in /etc/ppp? Are you running usb_modeswitch and wvdial as root? I must do “sudo usb_modeswitch” and “sudo wvdial” to get them running.

    Have you examined your /etc/ppp/chap-secrets and /etc/ppp/chap-secrets files? The command “man pppd” will give you the info about these.

    Another thought. Have you a firewall running? Maybe you could disable it while you set up the connection, just to remove another factor from the equation.

    John

  16. Stu Edgar Says:

    John C,
    tried all of that but doesnt seem to be getting IP adfdresses from optus server
    No firewall.
    will try on my ubuntu system to see if modem ok
    Stu

  17. Mazzle Says:

    Hey. There’s no binary at http://www.draisberghof.de/usb_modeswitch/

    No precompiled binary I say.

  18. JohnC Says:

    Yes there is. It’s included with the source - you can use it, or compile your own.

    http://www.draisberghof.de/usb_modeswitch/

    Download usb_modeswitch-0.9.4.tar.bz2, dated from 2008-06-09

  19. JohnC Says:

    Stu-

    I’m running out of ideas, I suppose you could use pppd directly and not bother with wvdial. But then you’d need to get the “expect-send” pairs of strings for your chat script correct. And Optus aren’t very forthcoming with the sort information you’d require. They seems to think that if a person doesn’t use Windoze, or a Mac, he’s not worth worrying about.

    BTW, you do have a wvdial file in /etc/ppp/peers?
    Mine is a text file containing simply:

    noauth
    name wvdial
    usepeerdns

    John

  20. Stu Edgar Says:

    John,
    Thanks for all your help mate.
    It has me stumped!
    Yes I checked and the text file is there in /peers like yours.
    I have done some surfing in whirlpool max os x posts where they are having some auth problems too.
    It may be because of my Aspire 1 laptop - apparently they are releasing a HSDPA driver/module so that may help.
    Thanks
    Stu

  21. SteveM Says:

    many thanks for your post here as I followed your instructions and got my Optus 3G service going with a Huawei E169 usb stick on my newly acquired Acer AspireOne (Linpus). I had an additional step to do around resolving names but you got my link
    up initially & I’m most grateful (and relieved) for your advice.

    Thanks!

  22. admin Says:

    You’re most welcome, Steve. Thanks for coming by.

  23. Stu Edgar Says:

    SteveM, I have an Aspire 1 and am failing to get it logged on. Can you post your config files so I can copy please?
    Also, what was the name resolving step?
    Thanks
    Stu

  24. Stu Edgar Says:

    Hi Admin,
    Can you email my post my post above to Steve m?
    Stu

  25. Babau Says:

    Hi Stu,

    I’ve just emailed him now. Hopefully he gave an address he actually checks.

  26. Stu Edgar Says:

    Thanks heaps.
    Great blog!

  27. Babau Says:

    SteveM’s gotten in touch with me, just sorting out actually getting the files online. Shouldn’t be long.

  28. Babau Says:

    Steve is having trouble posting, this is direct from him. Hope it helps:

    ———————-

    I followed the instructions as per this site with great success on my Acer Aspire One (Linpus) and my (Optus) Huawei e169 device but requiring one additional step for my situation.

    Some notes from my efforts:

    i) Setting up the 3G link was one of the first things I did with my Acer.

    ii) But I first got my 3G service going on my Dell Vostro laptop (under Vista) to provide me with some confidence that my E169 & 3G service was working.

    iii) My ‘wvdial.conf’ file looks like this:

    [Dialer Defaults]

    Phone = *99#

    Username = username

    Password = password

    Modem = /dev/ttyUSB0

    New PPPD = yes

    iv) Using my root account, the steps on this page got my 3G link established but I still had a problem. It wasn’t the Firefox offline problem - my problem was that although I could ping a number IP address, but I couldn’t reach a named URL (for instance www.google.com).

    My Linpus config seemed unable to resolve the URL. I did some further looking and this is what worked for me. Someone more technical might explain why it worked.

    v) My /etc/resolv.conf had only this comment in it (nothing else):

    “# generated by NetworkManager, do not edit!”

    My /etc/ppp/resolv.conf had this in it:

    nameserver 61.88.88.88

    nameserver 61.88.88.88

    So although there was a warning message in /etc/resolv.conf, I still copied the /etc/ppp/resolv.conf to /etc/resolv.conf, restarted the 3G link & I was away. Yeh!

    I then put the steps into a shell script & I run this script (using sudo)each time I want to start my 3G link. It works reliably and I wanted to share my success with others that might have an Aspire One.

    cheers-Steve

  29. Stu Edgar Says:

    Hi Guys,
    Just an update if anyone has followed above and is having problems with Optus prepaid wireless.
    There are problems at Optus end, which they are STILL trying to resolves. See this forum on Whirlpool for more info:
    http://forums.whirlpool.net.au/forum-replies-archive.cfm/1057521.html
    Cheers
    Stu

  30. Ken Ward Says:

    Thanks for the info., I’d been struggling to get my E169 working on my new Asus eee PC (18 years of DOS / Windows experience don’t count for much when you’re a Linux newbie!) but this has really helped me.

    Typing the USB_MODESWITCH commands in manually has solved my problems with my E169.

    Cheers!

    Ken.

  31. GrahamL Says:

    You might consider using wvdial’s option
    STUPID MODE = yes
    which eliminates the delay in making the connection.

  32. Philip Rhoades Says:

    People,

    I am still struggling with this gadget - I have tried all the stuff above but still get pppd errors:

    15 The link was terminated because the peer is not responding to echo requests.

    or

    16 The link was terminated by the modem hanging up.

    but then I noticed there is no “Dark Blue: Blinking Once” for the LED on:

    http://virginbroadband.custhelp.com/app/answers/detail/a_id/45/related/1

    - anyone know what that means?

    Thanks,

    Phil.

  33. Chris Fry Says:

    Hi Guys,

    I’ve followed the instructions to get my e169 working under Fedora Core 4 - usb_modeswitch appears to work - I can see the modem in proc/scsi/scsi but I don’t get ttyUSBn created - any suggestions?

    Thanks

    Chris

  34. 2009 Says:

    2009

  35. Alexseys Says:

    technology

  36. Gravicapa Says:

    renault

  37. Grisha Says:

    Nissan primera p

  38. woyatsukokuto Says:

    2009

  39. jimetsushio Says:

  40. nuikaiji Says:

  41. EdenMar Says:

    To anyone coming across this on a search, while trying to get this modem to work on Jaunty, at of the date of this post (likely a bit before, as well) — if the OS won’t recognize your Huawei e169, just run the OS update.

    Then, plug it in and wait until the blue light pulses steadily. Open the Network Manager Applet and your Huawei e169 is there, waiting to be selected. Don’t worry that you’ll see a different Huawei model-number listed on an earlier screen, just disregard this, it’s a ‘bug’.

  42. Vladislav24 Says:

    Потрясающе! Вот не ожидал…)

  43. Mandy Wimax Says:

    It’s the coolest site, continue to keep the good work!

  44. Reed Clester Says:

    Hi , I have found a excellent way to make tons of money online blogging. I presume this is mainly for the website admin but there are probably alot more bloggers reading this. I have already made thousands using the techniques detailed in the product and it’s only been two months. Free Money Making Blog By Blogging To The Bank

  45. Luciano Vallely Says:

    Honestly, I cannot forsee anyone doing this for anything other than malicious reasons, but for knowledge’s sake, look up Windows RAS. Very easy to setup.

Leave a Reply