While there are loads of software to pass the unlock code in to 3G dongles in Windows, there's no such software for linux. This doesnt mean it cant be done. Infact, there's no need for any special software for this even on windows.
There is a very easy way to do this on linux. I unlocked a Huawei E160G Dongle that was sim locked to the 3 network using the method given below.
first order of business, getting the unlock code for the 3G dongle.
For Huawei dongles, this is very easily obtained using this site : http://bb5.at
To do this, first get the IMEI code for your dongle and in a new browser window, enter the url as below :
replace xxxxxxxxxxxxxxxxx with your actual 15 digit IMEI code.
this will show a page giving the unlock code like the one below :
The unlock code is the 8 digit number in the line that says :
Tools you need :
minicom - a terminal software that can communicate with the serial ports. On windows, there is Hyper terminal. This is the Linux counterpart for that.
minicom is available in just about every linux distro there is.
On Debian based systems (ubuntu,mint,mepis,etc.) this can be installed with :
On Redhat based systems (CentOS, Fedora ):
On Suse :
now, we need to know on what port the dongle is connected on. to do this, open up a command terminal and login as root
and run for Debian based systems :
For Redhat/Suse based systems :
keep that terminal open and plugin the 3G dongle with the SIM removed from it.
THere'll me a lot of lines as the kernel detects the attached device. Among them will be lines similar to these :
It identified the device as a modem and attached it to the ports ttyUSB0 and ttyUSB1
The full paths are :
/dev/ttyUSB0 and /dev/ttyUSB1
These are the details we need.
we can get back to the interactive command line by pressing CTRL + C
now, we need to configure minicom so that it'll talk to the 3G dongle. in 99% of the cases, /dev/ttyUSB0 is the port we need to unlock the dongle.
So as root, run :
This opens up minicom in the configuration mode.
First thing to do is to set the Serial Port so select Serial Port Config from the list of options and press Enter.
First thing is to change the port to /dev/ttyUSB0. So press A and change the /dev/tty0 to /dev/ttyUSB0
And press Enter.
Next, we need to change the Baud Rate, paritiy and bits to 9600,N,8 (respectively). To do this, press E.
From the list of options C has 9600, so press C
Press Enter to confirm.
now it should look like this :
A - Serial Device : /dev/ttyUSB0
E - Bps/Par/Bits : 9600 8N1
Press Enter to complete the Serial port Setup.
Now select Exit to exit the configuration menu.
Note, this is Exit and NOT Exit from minicom option.
Now it'll initialize the modem:
And open up the terminal :
Now comes the actual command to unlock the dongle. The terminal you're in now is not a interactive shell like the usual command prompt. You cannot make any mistakes in typing commands here.
the AT command to unlock the dongle has to be entered in capital letters so its a good idea to press capslock.
the unlock command is :
replace xxxxxxx with the unlock code for your dongle the "" are compulsory!
and press enter.
Now, depending on the dongle model, you might get a reply like this :
or simply (this is what I got for the E160G) :
now just close the command line interface and pull out the dongle.
Put your own sim in and plug it in. It'll now work with your sim.
Big thanks goes to Sandeepa for his blog post for providing the AT command to unlock, the Baud rates, and an easy way to get the unlock codes. His blog post shows how to unlock 3G dongles in windows without using any 3rd part software.
Also credit is due to this blog post from linuxwave for giving a heads up on minicom.
There is a very easy way to do this on linux. I unlocked a Huawei E160G Dongle that was sim locked to the 3 network using the method given below.
first order of business, getting the unlock code for the 3G dongle.
For Huawei dongles, this is very easily obtained using this site : http://bb5.at
To do this, first get the IMEI code for your dongle and in a new browser window, enter the url as below :
Code:
http://bb5.at/huawei.php?imei=xxxxxxxxxxxxxxxxx
this will show a page giving the unlock code like the one below :
The unlock code is the 8 digit number in the line that says :
Code:
Entsperren / Unlock: 65031494
Tools you need :
minicom - a terminal software that can communicate with the serial ports. On windows, there is Hyper terminal. This is the Linux counterpart for that.
minicom is available in just about every linux distro there is.
On Debian based systems (ubuntu,mint,mepis,etc.) this can be installed with :
Code:
sudo apt-get install minicom
On Redhat based systems (CentOS, Fedora ):
Code:
sudo yum install minicom
On Suse :
Code:
sudo zypper install minicom
now, we need to know on what port the dongle is connected on. to do this, open up a command terminal and login as root
Code:
sudo su
and run for Debian based systems :
Code:
tail -f /var/log/syslog
For Redhat/Suse based systems :
Code:
tail -f /var/log/messages
keep that terminal open and plugin the 3G dongle with the SIM removed from it.
THere'll me a lot of lines as the kernel detects the attached device. Among them will be lines similar to these :
Code:
kernel: [122067.688806] usb 1-4: Product: HUAWEI Mobile
kernel: [122067.688821] usb 1-4: Manufacturer: HUAWEI Technology
kernel: [122067.689178] usb 1-4: configuration #1 chosen from 1 choice
kernel: [122067.708406] option 1-4:1.0: GSM modem (1-port) converter detected
kernel: [122067.708774] usb 1-4: [B]GSM modem (1-port) converter now attached to ttyUSB0[/B]
kernel: [122067.709341] option 1-4:1.1: GSM modem (1-port) converter detected
kernel: [122067.709721] usb 1-4: GSM modem [B](1-port) converter now attached to ttyUSB1[/B]
The full paths are :
/dev/ttyUSB0 and /dev/ttyUSB1
These are the details we need.
we can get back to the interactive command line by pressing CTRL + C
now, we need to configure minicom so that it'll talk to the 3G dongle. in 99% of the cases, /dev/ttyUSB0 is the port we need to unlock the dongle.
So as root, run :
Code:
minicom -s
This opens up minicom in the configuration mode.
First thing to do is to set the Serial Port so select Serial Port Config from the list of options and press Enter.
First thing is to change the port to /dev/ttyUSB0. So press A and change the /dev/tty0 to /dev/ttyUSB0
And press Enter.
Next, we need to change the Baud Rate, paritiy and bits to 9600,N,8 (respectively). To do this, press E.
From the list of options C has 9600, so press C
Press Enter to confirm.
now it should look like this :
A - Serial Device : /dev/ttyUSB0
E - Bps/Par/Bits : 9600 8N1
Press Enter to complete the Serial port Setup.
Now select Exit to exit the configuration menu.
Note, this is Exit and NOT Exit from minicom option.
Now it'll initialize the modem:
And open up the terminal :
Now comes the actual command to unlock the dongle. The terminal you're in now is not a interactive shell like the usual command prompt. You cannot make any mistakes in typing commands here.
the AT command to unlock the dongle has to be entered in capital letters so its a good idea to press capslock.
the unlock command is :
Code:
AT^CARDLOCK="xxxxxxx"
and press enter.
Now, depending on the dongle model, you might get a reply like this :
Code:
^CARDLOCK 2,10,0
Code:
OK
now just close the command line interface and pull out the dongle.
Put your own sim in and plug it in. It'll now work with your sim.
Big thanks goes to Sandeepa for his blog post for providing the AT command to unlock, the Baud rates, and an easy way to get the unlock codes. His blog post shows how to unlock 3G dongles in windows without using any 3rd part software.
Also credit is due to this blog post from linuxwave for giving a heads up on minicom.
Last edited:
Good for linux ppl 


