i don't
quite know

.com

Macs, Movies, Games, Books, etc. The Rants of a Mad Man.

My first Cocoa adventure: The Huawei E169 Monitor

December 20th, 2009 by Raj

E169Monitor

Having moved in to a new place a few months ago I was once again greeted with the issue of not having an internet connection until the powers that be connected the relevant wires and flicked their respective switches. This; an all far too familiar occurrence I’ve had dealt with in a timely fashion in times gone by (it helped when you worked for a telco) would this time blow out to well over a month to which point relying on my iPhone would not cut it. Coming to my rescue a good friend (thank you Gavlar) bestowed upon me a USB wireless internet dongle that would suffice my addiction until normality was restored with some ADSL.

Armed with an Optus flashed Huawei E169 I was quick to find that at the time there was no software around that was compatible with the relevantly new Mac OS X – Snow Leopard (10.6.x). The solution was to set up the device as you would any other modem and install some lovely modem scripts and what not from Huawei’s website, this got you online but I then found my next problem, reception! It seemed that the Optus network had a little difficulty in particular areas of my CBD apartment and not having an real software to report things like signal strength and data network I spent a good amount of time walking around my place laptop in hands “guessing” that the reception was actually best 1m to the left of my kitchen stove at ground level laying on the floor.

As you can imagine I quickly got sick of that game and thusly decided I’d take a look at just how complicated it was to find out the signal strength was directly from the device. A few googles later and I’d opened a connection directly to the serial device through the terminal and was now actively seeing what I was after albeit in a rather nerdy fashion. Coincidently at the same time as this I was ploughing through Aaron Hillegass’ 3rd edition of “Cocoa Programming for Mac OS X” and thought to myself “Hey, why not create a program to scrape this nerdy jargon and present it visually.” and that’s exactly what I did.

So here you’ll find a little program I like to call the E169 Monitor, because that’s pretty much what it does, monitor your E169’s data connection reporting back on things like signal strength and network connection type (WCDMA, HSDPA, etc) as well as giving you a couple of buttons to connect and disconnect.

Credit where credit is due; a lot of the code in here would not have been possible had it not been for the wonderful AMSerialPort project that makes connecting and reading from serial (USB) connections so much easier than the standard Cocoa libraries and to make the whole connect/disconnect functionality work (and I’m still not sure I understand) I’ve borrowed heavily from the source of the now defunct CheetahWatch, a program which essentially did everything I’ve done and more back in the days of the E220 and OS X 10.4. I really wish this project was picked up again and nurtured because it is a really fantastic effort, if I actually owned one of these wireless cards I think I’d even try an revive it myself, even with my rather fledgling cocoa skills.

Rambling and thanks aside a link to my Xcode project is available here & below. Do with it as you will but please be aware that I’m offering no support, this is all just a learning experience for me that I thought others may find useful. I’ve only tested this code on my own machine, an Intel based MBP running 10.6.2. I hope you can get some use out of it, I had fun doing it and throwing back to the days I used to have to manually enter AT commands to dial the local BBS.

Download my E169 Monitor Xcode Project files. (3.1MB)

Useful Resources: AMSerialPort Project, CheetahWatch application

Filed under Mac having 1 Comment »