Note:- Data cards are automatically detected in newer version of ubuntu. You just have to wait for detecting it and then you can configure it. Use this method only when your data card is not detected by default.
Plug in your modem. Let it be recognized as a flash drive. Once that is done do
1) Open terminal and type
lsusb.
The output will be something like this:
Bus 001 Device 001: ID 1d6b:0002
Bus 003 Device 001: ID 1d6b:0001
Bus 002 Device 002: ID 12d1:140b Huawei USB Device
Bus 002 Device 001: ID 1d6b:0001
If you have same ID 12d1:140b Hwawei USB Device> follow the same instruction below
Now the first number here is the vendor id (0x12d1) and the second one (0x0140b) is
product id. These numbers will differ depending on the make and model of your modem.
2) now type in terminal
modprobe usbserial vendor=0x12d1 product=0x140b
**optional:{ only if terminal asks for permission or are you root something..
then type
sudo modprobe usbserial vendor=0x12d1 product=0x140b
enter your password ...
}**
Now you need to install a packages and softwares below
(note: if this article is old ,download the latest packages from http://www.draisberghof.de/usb_modeswitch/ )
1) sudo apt-get install libusb-dev
For new versions of usb_modswitch, libusb-1.0 is needed. It can be installed with:
sudo apt-get install libusb-1.0.0-dev
2) Download latest usb_modeswitch & extract from:
http://www.draisberghof.de/usb_modeswitch/
Now to install usb_modeswitch:
cd usb-modeswitch-x.x.x
( enter into the usb-modeswitch directory)
sudo make install
3) Download & extract latest usb_modeswitch-data from:
http://www.draisberghof.de/usb_modeswitch/
cd into the extracted folder
cd usb-modeswitch-data-xxxxxxxx
sudo gedit Makefile
add the following two lines after RULESDIR = $(DESTDIR)/lib/udev/rules.d :
UDEVDIR= $(DESTDIR)/lib/udev
UDEVDIR= $(DESTDIR)/etc/udev
now Install usb_modeswitch-data:
sudo make files-install
Once installed:
4) type again in terminal
usb_modeswitch -v 0x12d1 -p 0x140b -H -W
note:-change 0x12d1 and 0x140b if you have different vendor id and product id
5) Now try an ls /dev/ttyU* and you should be able to see at least one device, or may be more
Type in terminal
ls /dev/ttyU*
6) Now its time to configure the settings.Type in terminal
wvdialconf
and a file would be generated(/etc/wvdial.conf)
sudo gedit /etc/wvdial.conf
Open it and modify the phone number (The default number,username and password is
number #777
username internet password internet)
but if you have changed your username and password ... then type that one.
7) now just type in terminal
wvdial
thats it go to network icon and click over it and select huwaie mobile network..and you will connected in seconds..
This process 100% work if you follow the instruction carefully.
IF you have a problem ..reply
After so much pain, the following post by Jaydeep worked.
http://ubuntuforums.org/showthread.php?t=1814583
Will still post the answer below.
Check the name of your USB device by running the following command on Terminal
lsusb
type the following to go to usb_modeswitch.d folder
cd /etc/usb_modeswitch.d
create a config file (.conf) using the following command.
sudo gedit
Copy and paste the following to the file and save.
DefaultVendor= 0x12d1
DefaultProduct=0x1505
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
Keep in mind that the12d1 and 1505 in DefaultProduct and DefaultVendor values are as per the output received in lsusb for your Huawei device.
Save the file as 12d1:1505. ( any other name should also work !!)
Run usb_modeswitch command as below.
sudo usb_modeswitch -I -W -c 12d1\:1505
Device should get detected, please add new connection and see if it is connected.
If not, please restart, run the same usb_modeswitch command again and see if it is working ! ( For me, it worked after restart )
Note, to make it work, you have to run the usb_modeswitch command every PC starts, to avoid it, a script may be used.
Best Answer
Probably you could have tried what i'm about to say.
The above commands will list the usb-devices plugged in to your machine.
However the following method works charm for me every time. Plug the usb device before you turn on your laptop.
After login, please enter the following commands in your terminal:
Please note down the prints that your modem is detected.
And get your device's vendor & product id.
Now you must see some changes in
dmesg
detecting your usb device as a modem. If not, afterdmesg -c
, trymodprobe -r usb_storage
which will remove the support for usb storage devices. Sometimes your modem gets detected as usb storage. After your modem is detected, you can re-enable usb storage bymodprobe option
.Hope this will help.