MavEtJu's Distorted View of the World - Huawei E169

Huawei E169 on 7-STABLE
Huawei E169 statistics
FreeBSD and the Huawei E169 USB 3G Modem - Step two
FreeBSD and the Huawei E169 USB 3G Modem - Step one

Back to index

Huawei E169 on 7-STABLE

Posted on 2009-07-27 20:00:00
Tags: FreeBSD, Huawei E169

Two weeks ago I moved on my laptop from 7.2 BETA2 (SVN revision r191457) from 7-STABLE (SVN revision r195649). Why? Just because I thought I could...

it wasn't the worlds best upgrade I have had. Yes, everything still worked, like X, my network, the ports etc. Except that when using the Huawei E169 3G modem everything hang now and then. Not everything, just the keyboard (network and mouse still worked, so killing X and restarting it was possible if you could access it), but it was enough to have to make the laptop to shut down and to have do an fsck on it. And doing that on the train early in the morning is not my idea of a good time.

I remembered that Peter Jeremy had the same issue earlier after I wrote up the first stories about the E169 and his solution was to upgrade to CURRENT. Yech, that isn't something I want to do on my daily machine. So for two weeks I kind of worked without a network on the train until I finally had enough of it and installed CURRENT on the laptop. And it came up as 8.0 BETA2 (SVN revision 195900).

And I just my first trip on the train with a network again and without having to run fsck during the trip!


No comments | Share on Facebook | Share on Twitter

Huawei E169 statistics

Posted on 2009-06-04 08:00:00
Tags: FreeBSD, Huawei E169, 3G

As written earlier about, the Huawei E169 3G USB modem works like a charm on FreeBSD 7.2. On my trips with the train in the morning to work and in the afternoon from work I am able to do some work on catching up on email and keeping up with the news websites. Yay for a good technology.

The only thing I hadn't managed so far was to getting information from the device to about the amount of traffic uploaded and downloaded, the signal strength and the connection-type used (3G, 2G etc). I knew that the device had three modem ports, one used for the PPP connection but the other two were a mystery so far, until I heard one day that I should use cat(1) instead of tail(1) on them. And yes, that one gave me data!

There are five interesting pieces of text reported:

^BOOT - of which I have no idea what it is for. The values always seem the same, very boring. It is the only field which comes without a change of the data, the others only come when a piece of the data is changed.

^DSFLOWRPT - the most interesting part: It contains the uptime of the PPP connection (always a 2 second interval if there is a modem connection), the number of bytes received and sent out in the last interval, the number of bytes received and sent since the PPP connection got started and two numbers which I don't know what they are for.

^MODE - which tells me if the modem light is cyan, darblue, green or off.

^RSSI - Receiving signal strength, an indication if you are in a tunnel, in a hilly area or close by a basestation.

^SRVST - Not sure yet... It seems to have to be done with which provider you are linked up with and it seems to be toggling between 0 and 4.

So three days later on the train-trip I had mastered ncurses(3x) and created a nice overview of what the 3G modem thinks about my connection:

This screenshot was taken between Kirrawee station and Sutherland station, while checking the contents of the items in the ABC and BBC RSS feeds.

The stats at the top left are just the data as known at this moment. The -1 of the SRVST means we hadn't received that data yet. The table at the top right is the amount of downloaded data during those minute. And the graph at the bottom indicates the signal strength in the last N * 2 seconds.

If you have a Huawei E169 and interested in knowing what is happening, the FreeBSD port is available as net/e169-stats.


Show 6 comments | Share on Facebook | Share on Twitter


FreeBSD and the Huawei E169 USB 3G Modem - Step two

Posted on 2009-04-27 21:00:00
Tags: Huawei E169, FreeBSD, Networking, 3G

The story so far... An upgrade to FreeBSD 7.2, X not working, something goes wrong in the IPCP layer, a non-working MacOS/X upgrade and in need of a firmware upgrade.

When I put the E169 in the first Windows machine I found, it kind of died a horrible way: it kept telling me that it had found new hardware and when I was lucky enough, I managed to run it before it decided that it had found new hardware again. Flashing it to a new firmware version was a little bit optimistic for that machine!

Today I took it the E169 modem with me to work and during lunch I put it in a Windows machine there. It installed without an itch, it connected to the Virgin network and it downloaded at a wopping speed of 150 kbps. Now why did it work there and how did it achieve it?

I found a program called Advanced Serial Port Monitor which kind of puts itself between the Windows COM port drive and the Windows kernel and displays what is being said between the client and the hardware.

The client program said "AT+CGMM?" and the modem said "E169". The client program said "AT^CARDLOCK?" and the modem said "^CARDLOCK: 2,10,0" (any idea?). The client program said "AT+CIMI" and the modem said "5050299062636465". And the client program said "AT+COPS?" and the modem said "+COPS: 1,0,"YES OPTUS",2". And a lot of other AT commands were issued, but unfortunately the client program didn't want to dial out while the monitor was running...

Unfortunately, none of the AT commands helped me from getting a proper CONNECT string (CONNECT 7200000 was the one I was looking for) and getting the IPCP part of the PPP initialisation working.

None of this helped. I kept looking and looking and suddenly I saw this one being executed instead of the "YES OPTUS" one: "AT+COPS=1,2,"50502",2". It didn't make much sense, but never tried is always miss. And I ended up with a CONNECT 7200000 and a full PPP handshake session. Bingo!

So, at the end, we ended up with the following configuration on the modem (just in case it differs from yours and it doesn't work):

ati
Manufacturer: huawei
Model: E169
Revision: 11.314.17.00.261
IMEI: 351029385479124
+GCAP: +CGSM,+DS,+ES

at&v
&C: 2; &D: 2; &E: 0; &F: 0; &S: 0; &W: 0; E: 1; L: 0; M: 0; Q: 0; V: 1;
X: 0; Z: 0; \Q: 3; \S: 0; \V: 0; S0: 0; S2: 43; S3: 13; S4: 10; S5: 8;
S6: 2; S7: 50; S8: 2; S9: 6; S10: 14; S11: 95; S30: 0; S103: 1; S104: 1;
+FCLASS: 0; +ICF: 3,3; +IFC: 2,2; +IPR: 115200; +DR: 0; +DS: 0,0,2048,6;
+WS46: 12; +CBST: 0,0,1;
+CRLP: (61,61,48,6,0),(61,61,48,6,1),(240,240,52,6,2);
+CV120: 1,1,1,0,0,0; +CHSN: 0,0,0,0; +CSSN: 0,0; +CREG: 0; +CGREG: 0;
+CFUN:; +CSCS: "IRA"; +CSTA: 129; +CR: 0; +CRC: 0; +CMEE: 2; +CGDCONT: (1,"IP","VirginBroadband","0.0.0.0",0,0)
; +CGDSCONT: ; +CGTFT: ; +CGEQREQ: (1,2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(2,2,0,0,
0,0,2,0,"0E0","0E0",3,0,0),(3,2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(4,2,0,0,0,0,2,0,
"0E0","0E0",3,0,0),(5,2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(6,2,0,0,0,0,2,0,"0E0","0
E0",3,0,0),(7,2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(8,2,0,0,0,0,2,0,"0E0","0E0",3,0,
0),(9,2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(10,2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(11,
2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(12,2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(13,2,0,0,
0,0,2,0,"0E0","0E0",3,0,0),(14,2,0,0,0,0,2,0,"0E0","0E0",3,0,0),(15,2,0,0,0,0,2,
0,"0E0","0E0",3,0,0),(16,2,0,0,0,0,2,0,"0E0","0E0",3,0,0)
; +CGEQMIN: ; +CGQREQ: ; +CGQMIN: ; ; +CGEREP: 0,0; +CGCLASS: "B";
+CGSMS: 1; +CSMS: 0; +CMGF: 0; +CSAS: 0; +CRES: 0;
+CSCA: "+61411990010",145; +CSMP: ,,0,0; +CSDH: 0; +CSCB: 0,"","";
+FDD: 0; +FAR: 0; +FCL: 0; +FIT: 0,0; +ES: ,,; +ESA: 0,,,,0,0,255,;
+CMOD: 0; +CVHU: 1; ; +CPIN:         ,        ; +CMEC: 0,0,0; +CKPD: 1,1;
+CGATT: 1; +CGACT: 0; +CPBS: "SM";  +CPMS: "SM","SM","SM";
+CNMI: 0,0,0,0,0; +CMMS: 2; +FTS: 0; +FRS: 0; +FTH: 3; +FRH: 3; +FTM: 96;
+FRM: 96; +CCUG: 0,0,0; +COPS: 1,0,""; +CUSD: 0; +CAOC: 1; +CCWA: 0;
+CCLK: ""; +CLVL: 4; +CMUT: 0; +CPOL: 0,2,"",0,0,0; +CPLS: 0; +CTZR: 0;
+CTZU: 0; +CLIP: 0; +COLP: 0; +CDIP: 0; +CLIR: 0; ^PORTSEL: 0;
^CPIN:         ,        ; ^ATRECORD: 0; ^FREQLOCK: 12805096,13050984;
^CVOICE: 0; ^DDSETEX: 0
and the following ppp.conf:
virgin:
 set mru 1440
 set device /dev/cuaU0.0
 set speed 115200
 set phone *99\#
 set authname VirginBroadband
 set authkey VirginBroadband
 deny chap

 disable deflate
 disable pred1
 disable vjcomp
 disable mppe

 enable dns
 accept dns

 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
           \"\" AT OK-AT-OK ATE1Q0 OK \
	   AT+COPS=1,2,"50502",2 OK \
           AT+CGDCONT=1,\\\"IP\\\",\\\"VirginBroadband\\\" OK \
           \\dATDT\\T TIMEOUT 40 CONNECT"
 set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0

 add default HISADDR

This only brings up the issue with X: Starting X with the E169 modem plugged in did make it start the X graphical screen but it failed to start the window manager and the mouse was unresponsive. Taking out the modem resulted in going back to the console.
Starting X without the E169 modem plugged in started everything up but after plugging in the modem the whole system became unresponsive. Taking out the modem and everything worked again.

I got a hint from Callum on #bugs that I should try x11-servers/xorg-server without hald support. A recompile later and X and the mouse works with the modem plugged in, but the keyboard didn't work yet. Adding these four lines to my xorg.conf overcame the problem:

Section "ServerFlags"
        Option "AllowEmptyInput" "False"
        Option "AutoAddDevices" "False"
EndSection
The xorg-server now works with hald support compiled in, but it doesn't start the window manager yet when hald is running: It just hangs there. Pressing control-alt-backspace and taking the modem out brings you back the console. At this moment it is not really a problem yet, more something for the wizards who understand X.

Short version: The E169 modem works with FreeBSD 7.2 out of the box, Xorg 7.4 works with four extra lines in the config, the XFCE window manager works, everybody is happy!


Show 4 comments | Share on Facebook | Share on Twitter

FreeBSD and the Huawei E169 USB 3G Modem - Step one

Posted on 2009-04-25 19:00:00
Tags: Huawei E169, FreeBSD, Networking, 3G

Earlier this century I had a Huawei E220 USB 3G modem in my possession and believe it or not, after some fiddling and hacking I got it working under FreeBSD 6.x. (Un)fortunately I quit my job and had to give it back.

Overtime it got more and more difficult to find 3G provide who offered a E220 and I had given up on ever running 3G on my FreeBSD laptop again until I saw a commit of Poul-Henning Kamp which said "Make the ubsa(4) work with Huawei Exxx (tested with E169) 3G radio devices".

It took me still quiet a couple of months before I dared to go looking for a replacement and last week I found out that Virgin shop was the only 3G provider who could tell me from their head which brand and model USB modem they provided. And it was a Huawei E169! Life would be sweet again!

Luckily the commit by Poul wasn't too big and I was able to backport it to the 7.1 release running on my laptop and oh boy... It didn't really work yet. For some reason it did the same as my previous modem did before:

$ ppp virgin
ppp> dial
Ppp>
PPp>
It still didn't finish the IPCP layer! I checked the APN, which is VirginBroadband. And I remembered what I did last time: I had to put it in a Windows machien before it worked. I still don't understand this, but okay.

Stopping the PPP program caused a kernel panic. Rebooting the machine without stopping the PPP program caused a kernel panic. Starting X while the USB modem was in caused in a hanging X. Putting the USB modem in while X was running caused a hanging keyboard. Fsck was very upset with me, every time.

So, later I found a commit of Nick Hibma which said "Say hello to the u3g driver, implementing support for 3G modems." plus a bunch of follow-up commits with fixes. And, it was backported into RELENG_7! So I upgraded my laptop to 7.2 (RC1 or something) and rebooted.... It didn't recognize the USB modem at the first attempt, but when I loaded the u3g.ko kernel module it recognized both the modem and the disk part of it! No more patches, it is all vanilla 7.2.

But for some reason it did the same as my previous attempt did before:

$ ppp virgin
ppp> dial
Ppp>
PPp>
That kind of euhm... sucks bigtime.

I don't have a Windows machine, but I do have access a MacOSX machine which should be supported out of the box! The USB modem goes into the MacOSX machine, the software gets installed and I click on the "Connect" button. It says "Connecting" and it comes back with "Connection failed". Euhm...

Looking further, it seems that the program SetNetworkConfig gets called when you press the Connect button and it crashes. At least it gives me some kind of hint where to go next: I need to get newer software, either from Huawei E169 download page or from Virgin Broadband website. The installer of this puts the new software runs on the USB modem and for some reason it only works on a Windows machines.

So tomorrow I'm going to find me a Windows machine, put the USB modem in it, see if it works with Virgin 3G, then see if it then works on my FreeBSD machine, if not then upgrade the software first, see if it still works on the Windows machine and then see if it gets to work on the FreeBSD machine.

Lots of adventures are pending!


Show comment | Share on Facebook | Share on Twitter