It basically require few thing to be checked out in the box,which are mandatory for the USB modem to work..which are:
1) You need to figure out whether usbserial driver is loaded into the system or not.But how do you detect that?(kidding!! I know all of you know that). Still give away the steps to do that:
A) at the terminal,please type the following:
sudo /sbin/lsmod |grep usbserial
and you should get a response like below:
bhaskar@bhaskar-laptop_09:47:44_Sat Aug 20:~> sudo /bin/lsmod | grep usbserial
usbserial 26639 4
usbcore 119644 9 uas,ums_realtek,usb_storage,uvcvideo,btusb,usbserial,xhci_hcd,ehci_hcd
Now if you don't get a response from that command,that means kernel haven't load the driver to detect the USB thing.So you need to do the following:
sudo /sbin/modprobe usbserial
It basically get that driver initialize into the system to work with it.So the story is not end here..read on..
Step number 2:
It is essentially driven by the UDEV thing..so until you make the UDEV aware of it..it will still hinder you from using it.
So how do you do that?
Now you need to go to the directory called /etc/udev/rules.d..it should be there already and you need to add a udev rule file to in this dir like below:
ACTION!="add", GOTO="ZTE_End"
# Is this the ZeroCD device?
SUBSYSTEM=="usb", SYSFS{idProduct}=="2000",
SYSFS{idVendor}=="191g, GOTO="ZTE_ZeroCD"
# Is this the actual modem?
SUBSYSTEM=="usb", SYSFS{idProduct}=="0001",
SYSFS{idVendor}=="191g", GOTO="ZTE_Modem"
LABEL="ZTE_ZeroCD"
# This is the ZeroCD part of the card, remove
# the usb_storage kernel module so
# it does not get treated like a storage device
#RUN+="/sbin/rmmod usb_storage"
LABEL="ZTE_Modem"
# This is the Modem part of the card, let's
# load usbserial with the correct vendor
# and product ID's so we get our usb serial devices
RUN+="/sbin/modprobe usbserial vendor=0x191g product=0xffff",
# Make users belonging to the dialout group
# able to use the usb serial devices.
MODE="660", GROUP="dialout"
LABEL="ZTE_End"
I think the file is almost self explain itself.Now you need to restart the network one more time and put in your USB modem into the usb socket.
Then fire the command at the terminal..I am assuming you have wvdial installed in the system..
sudo wvdial providername
The USBmodem should able to ring back to the ISP; that you have already configured and provide you dynamic ip and dns names..voila!!!
You are connected to the internet through the wireless modem on GNU/Linux.To automate the thing in my laptop I have wrote a very very ordinary and mundane script to invoke from command line to get connected to the internet.The script look like below:
#!/bin/bash
if [[ "$UID" = "0" ]]
then
echo " You have the super power to invoke this sript"
else
echo "Sorry, you don't have the power to run this script"
fi
echo
echo
echo " Let's check whether the usb modem is connected to system or not"
echo
echo
/usr/sbin/lsusb | gawk -F: ' { print $2"===>"$3 }'
echo
echo
echo "probing the usb modem...loading driver too....."
/sbin/modprobe usbserial vendor=0x191g product=0xffff
echo
echo
echo "Connecting to ISP...."
echo
echo
/usr/bin/wvdial ProvidernameISP &>/var/log/wvdial&
echo
echo
sleep 5
echo "PID of of the WvDial..."
ps -ef | grep wvdial
echo
echo
sleep 3
echo
echo
echo "Checking the connection...."
/bin/ping -c 3 google.com
echo
echo
echo " Looking for live stat....."
echo
echo
/usr/bin/vnstat -i ppp0 -l
O yeah, I have written some information about vnstat in some other blog.It is a nice utility to measure net bandwidth.
Hope this will help.
Cheers!
Bhaskar
No comments:
Post a Comment