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/modemJerome 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/ttyUSB0If 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.
Monday, August 4th, 2008 @ 6:56 am
August 12th, 2008 at 10:56 am
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
August 12th, 2008 at 11:37 am
Sorry
The line
Modem = /dev/rfcomm0
should be
Modem = /dev/ttyUSB0
of course
August 12th, 2008 at 6:46 pm
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.
August 20th, 2008 at 6:06 pm
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
August 20th, 2008 at 6:40 pm
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.
August 20th, 2008 at 6:44 pm
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?
August 21st, 2008 at 3:48 pm
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
August 23rd, 2008 at 7:01 pm
my aa1 not configured for pppd
August 24th, 2008 at 4:53 am
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
August 24th, 2008 at 5:00 am
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.
August 24th, 2008 at 3:15 pm
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.
August 25th, 2008 at 6:26 pm
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
August 30th, 2008 at 4:37 pm
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.
September 1st, 2008 at 3:13 pm
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)
September 4th, 2008 at 3:07 pm
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
September 5th, 2008 at 5:17 pm
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
September 6th, 2008 at 2:04 pm
Hey. There’s no binary at http://www.draisberghof.de/usb_modeswitch/
No precompiled binary I say.
September 6th, 2008 at 4:01 pm
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
September 6th, 2008 at 4:19 pm
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
September 7th, 2008 at 5:02 pm
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
September 11th, 2008 at 2:53 pm
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!
September 11th, 2008 at 4:21 pm
You’re most welcome, Steve. Thanks for coming by.
September 11th, 2008 at 6:33 pm
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
September 16th, 2008 at 5:48 am
Hi Admin,
Can you email my post my post above to Steve m?
Stu
September 16th, 2008 at 5:55 am
Hi Stu,
I’ve just emailed him now. Hopefully he gave an address he actually checks.
September 17th, 2008 at 6:55 pm
Thanks heaps.
Great blog!
September 17th, 2008 at 9:31 pm
SteveM’s gotten in touch with me, just sorting out actually getting the files online. Shouldn’t be long.
September 18th, 2008 at 5:16 pm
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
October 6th, 2008 at 5:14 pm
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
October 11th, 2008 at 1:05 am
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.
January 17th, 2009 at 6:41 pm
You might consider using wvdial’s option
STUPID MODE = yes
which eliminates the delay in making the connection.
January 19th, 2009 at 1:10 am
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.
April 27th, 2009 at 8:53 pm
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
September 19th, 2009 at 3:13 am
2009
September 26th, 2009 at 1:31 am
technology
September 29th, 2009 at 1:30 pm
renault
September 30th, 2009 at 9:30 am
Nissan primera p
October 10th, 2009 at 1:34 am
2009
October 12th, 2009 at 5:35 am
October 12th, 2009 at 7:52 pm
March 3rd, 2010 at 5:39 am
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’.
March 14th, 2010 at 3:22 am
Потрясающе! Вот не ожидал…)
March 14th, 2010 at 11:58 am
It’s the coolest site, continue to keep the good work!
August 10th, 2010 at 7:24 pm
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
August 27th, 2010 at 7:09 am
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.