|
14 years ago 5 |
With multiple Mobile broadand services being offered now a days, lot of people are starting to use them for accessing internet. They are very convenient, portable and wireless. But it is unfortunate that most of the broadband vendors are providing support and drivers only for Windows platform. However, there are certain ways in which we can make these broadband devices work in Linux as well. The primary problem in linux with these devices is that they are USB based and are identified as mass storage devices. We have to make them to switch between mass storage device and serial network access device. For this, we need to install the software 'usb-modeswitch'. Also, wvdial is used in this tutorial for accessing the broadband modem device.
This tutorial is an attempt to make a typical mobile broadband device work in Linux when it is not detected and working with regular approaches (through Network Manager, kppp etc.). This tutorial has focused on the device Huawei EC 1262, but the commands and approach can be used to troubleshoot any similar device.
Linux distributions tested:
Linux Mint 7, Linux Mint 9, Ubuntu 9.10
If 'wvdial' is not already installed, then install it by issuing the following command (you have to download it by accessing internet from other way of accessing internet!)
#sudo apt-get install wvdial
For Linux Mint 9, usb_modeswich is available through it's own software manager. For Linux Mint 7 and other variants, the following installation process can be used.
I would suggest Debian packages as they provide one click installation: Make sure that you install the data package first and then main package:
Data Package:
http://packages.debian.org/squeeze/all/usb-modeswitch-data/download
Main Package:
http://packages.debian.org/squeeze/i386/usb-modeswitch/download
Tar Packages:
http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-data-20100623.tar.bz2
http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-1.1.3.tar.bz2
I haven't tested using Tar packages but they can be used on Linux distributions where debian packages cannot be installed.
Check that usb modeswitch is working by issuing the following command:
#usb_modeswitch
It should show an error message saying that it cannot find usb_modeswitch.setup file in /etc folder.
Now, open the following file and edit the contents as follows:
/etc/usb_modeswitch.conf
# Configuration for the usb-modeswitch package, a mode switching tool for
# USB devices providing multiple states or modes
#
# This file is evaluated by the wrapper script "usb_modeswitch" in /lib/udev
# To enable an option, set it to "1", "yes" or "true" (case doesn't matter)
# Everything else counts as "disable"
# Disable automatic mode switching globally (e.g. to access the original
# install storage)
DisableSwitching=0
# Enable logging (results in a extensive report file in /var/log, named
# "usb_modeswitch_
EnableLogging=1
# Huawei, newer modems
DefaultVendor= 0x12d1
DefaultProduct=0x1446
TargetVendor= 0x12d1
TargetProduct=140b
CheckSuccess=5
The text highlighted in above listing shows the broadband device specific information. This information should match the information returned by the following command:
naveen-laptop ~ # lsusb
Bus 004 Device 002: ID 0a5c:2101 Broadcom Corp. A-Link BlueUsbA2 Bluetooth
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 005: ID 0b05:420f ASUSTek Computer, Inc.
Bus 003 Device 004: ID 12d1:140b Huawei Technologies Co., Ltd.
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 064e:a101 Suyin Corp. Acer CrystalEye Webcam
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Now, open the file /etc/wvdial.conf and edit as follows:
[Dialer netconnect]
New PPPD = yes
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Username = 93********
Password = 93*********
Phone = #777
Stupid Mode = 1
Auto DNS = 1
Check Def Route = 1
Now remove the the broadband device Huawei EC 1262 if it is already plugged in. Then enter the following commands:
#modprobe -r usb_storage
#modprobe -r usbserial
#modprobe -v usbserial vendor=0x12d1 product=0x140b
Note for Linux Mint7 (Gloria) having kernel 2.6.28: the third command does not work (reports module 'usbserial' not found), so this needs to be added in boot loader (GRUB is shown here) as a kernel parameter as shown below:
usbserial.vendor=0x12d1 usbserial.product=0x140b
Plugin the device and see if there is a device node 'ttyUSB0'created in /dev folder. If it is successfully created, then it means it is recognized and can be used by the wvdial script.
Run the following command to dial the broadband modem device:
#wvdial netconnect
This tutorial is outdated!. I screwed up my usb ports following the steps here. It no longer works with new version.[Warning]
Thank you remoulder for your comments, actually I started it with an objective of generic tutorial but seems that more information has been plugged into it which is my system specific. However my opinion is that this guide still provides an insight into the various tools and commands that might help an entry/average Linux enthusiast as a start.
usb-modeswitch is available in the ubuntu repos and should be installed from there via the software manager not from debian. Tutorial's should be more general imo, this is simply an account of your setup.