Wibbly Stuff

Make your 3G modem work in Linux

Making your new 3G modem work on Linux can be sometimes quite troublesome. All vendors provide software to make the modem work on Windows, but few support Linux. But you can make your modem work in Linux with few steps, though not as easy as in Windows, it is not that much difficult. I've tested this on Ubuntu 12.04 with a Micromax 3G modem.

First of all, connect the modem to your PC. You are lucky if it was detected automatically. But if not, open the Terminal and give the following command,
lsusb
It will show you a list of all USB devices attached to the computer with their IDs. In my case, the following was the result,
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 413c:8161 Dell Computer Corp. Integrated Keyboard
Bus 001 Device 004: ID 0c45:63ee Microdia
Bus 003 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 003 Device 004: ID 413c:8162 Dell Computer Corp. Integrated Touchpad [Synaptics]
Bus 003 Device 006: ID 413c:8160 Dell Computer Corp. Wireless 365 Bluetooth
Bus 006 Device 002: ID 15d9:0a4c Trust International B.V. USB+PS/2 Optical Mouse
Bus 002 Device 012: ID 0fce:e167 Sony Ericsson Mobile Communications AB
Bus 002 Device 011: ID 1c9e:9605 OMEGA TECHNOLOGY
Now you have to identify and note down the ID of the connected modem. In my case it is Bus 002 Device 011: ID 1c9e:9605 OMEGA TECHNOLOGY and therefore the ID is 1c9e:9605. Here the first part is vendor code and the second part is the product code. Then execute the following command replacing your respective vendor and product IDs.
sudo modprobe usbserial vendor=0x1c9e product=0x9605
Now wait a minute or two and your modem will appear in the network manager. You might want to note down the above command as you have to execute it every time you reboot your computer and connect the modem. It would be easier to make it a bash alias so that you don't have to remember it. To make it a bash alias execute the following command replacing your respective vendor and product IDs,
echo "alias connect-modem='sudo modprobe usbserial vendor=0x1c9e product=0x9605'" >> .bashrc
Now you can just give the command connect-modem in the Terminal instead of the sudo modprobe usbserial vendor=0x1c9e product=0x9605 command. If you know an easier method, then don't hesitate to share :)

Update: As pointed out by a reader, you can alternatively add the usbserial and option modules to the /etc/modules file to load them on boot. You can simply run the following commands in the Terminal,
sudo echo "usbserial" >> /etc/modules
sudo echo "option" >> /etc/modules
Then the modem is automatically detected by network manager after a couple of minutes after you connect the modem.