Unlocking the Huawei E172… on LinuxPosted: July 9, 2011
Update: commenter Neil McPhail posted a Python-based solution to this. The script is here – save that somewhere (say, on your desktop), mark it as executable and run it. I haven’t tried it, so make sure to take a look at it before executing.
Note: you may find the guide here friendlier. It describes essentially the same procedure, but it tells you how to use minicom to do it.
My apologies (again) for the lack of new content on this marvelous weblog. I’m in a rural area now, and the Internet connection sucks around here. And my HTC Diamond, which I used as a wireless router, only manages to make that sucky connection even suckier. So, what do I do?
I grab my aunt’s E172. The modem, while awesome because it doesn’t overheat itself to death (unlike my Diamond), was unfortunately tied to Vodafone’s service, which is a) paid and b) slower than the free service I have from RDS. The logical solution: unlock the thing!
So here’s a tutorial, the kind I usually post when I find out how to do something. Note that this tutorial should work for all Huawei dongles, but I make no promises.
Step one: get your (free, of course) unlock code. For that, you’ll need your modem’s 15-digit IMEI, which, on the E172, is engraved into its back side. Make a note of it.
Now, open your browser and type this in your address bar:
http://www.bb5.at/huawei.php?imei=123456789098765 (replacing 123456789098765 with your own IMEI, of course). You need the number that will be displayed after “Entsperren/Unlock:”; with the example IMEI, that would be 47412550.
Step two: insert the code. This is the step that gave me headaches, mainly because I’m on Linux and I don’t get prompted for a code.
First, you’ll need to know what “control channel” your dongle uses; for that, open a terminal, become superuser (
sudo -i on Ubuntu,
su on most other distros) and type
cat /dev/ttyUSB1 and so on, until you get a continuous output resembling this: (for me, /dev/ttyUSB1 was the control channel)
Note that the DSFLOWRPT messages will only appear when the dongle is actually connected. If it isn’t connected, you’ll probably get BOOT messages instead. Oh, and hit Control-C to get your prompt back if you get no output.
If you do get output, don’t hit Control-C or close the terminal; open another terminal window and copy-paste this command, replacing 47412550 with the unlock code you got in the previous step and /dev/ttyUSB1 with the control channel you found out earlier:
chat TIMEOUT 1 '' 'AT^CARDLOCK="47412550"' 'OK' > /dev/ttyUSB1
There you go. If you watched the other terminal window, you should see
OK; I also saw
+CME error: operation not allowed. That message shouldn’t be a problem; if you got something like
+CME error 3, though, that means that you’re probably doing something wrong.
Disclaimer: I did this and everything worked just okay. Your mileage may vary. I give you no warranty that these instructions are correct, just my testimony.
Please leave a comment if this worked… or didn’t. I’m open to criticism.