I wanted to unlock my operator locked Huawei e1750 modem. After googling I found this page in swedish.
The unlock code can be calculated by using the IMEI number, the unlock code is sent by using AT commands.
I have succesfully tested this on e1750 and e1550.
I also tried it on e220 and it did not work.
1. Get the IMEI number
Normally this is printed on the device put the geek way of getting it is by asking the device:
peter@peter-laptop:~/huawei$ cat /dev/ttyUSB0 & [1] 9378 peter@peter-laptop:~/huawei$ echo -e "ATI\r" > /dev/ttyUSB0 peter@peter-laptop:~/huawei$ ATI Manufacturer: huawei Model: E1750 Revision: 11.126.07.04.00 IMEI: 123456789012347 +GCAP: +CGSM,+DS,+ES OK
So the IMEI number is: 123456789012347
2. Calculate the unlock code
The following python script will calculate the unlock code:
import hashlib
def getCode(imei, salt):
digest = hashlib.md5((imei+salt).lower()).digest()
code = 0
for i in range(0,4):
code += (ord(digest[i])^ord(digest[4+i])^ord(digest[8+i])^ord(digest[12+i])) << (3-i)*8
code &= 0x1ffffff
code |= 0x2000000
return code
# Your IMEI goes here:
imei = "123456789012347"
print "Unlock code: %s" % getCode(imei, "5e8dd316726b0335")
print "Flash code: %s" % getCode(imei, "97b7bc6be525ab44")
When run:
peter@peter-laptop:~/huawei$ python unlock_code.py Unlock code: 36963763 Flash code: 53969249
3. Use the unlock code
peter@peter-laptop:~/huawei$ echo -e 'AT^CARDLOCK="36963763"\r' > /dev/ttyUSB0 OK
Congratulations, now your modem is unlocked




May 16th, 2010 at 13:22
Try this online calculator, to calculate huawei codes.
http://www.wintechmobiles.com/unlocking/huawei-modem-unlock-by-code-do-it-yourself-free/
June 22nd, 2010 at 04:34
Hello!
I have a Huawei E169, what is recognized by Ubuntu Lucid as E220 .
I followed, your instructions and I have managed to unlock my card at the first try. I never thought that unlocking is so easy.
The last thing what I would have tried, to search the solutions on a swedish page.
So thank you!
July 15th, 2010 at 00:25
Hello again!
Now I have a Huawei E630 PCMCIA modem from Vodafone, and I have managed to unlock as well with this script.
July 15th, 2010 at 12:12
Great that you have had some use for my blog.
Interesting that you managed to unlock your E220 when I failed.
Best regards
Peter
August 7th, 2010 at 16:44
My card in fact was E169, but the Ubuntu recognised it as E220. Maybe on a real E220 it wouldn’t work for me as well.
August 7th, 2010 at 18:07
Sorry, I read it to fast. You clearly said it was not an e220.