How can connect internet to linux through mobile - Tips4ever


Hi this is Mahesh, Tips4ever is my IT Journey to technology, computers, software, Internet and much more....

Jan 24, 2009

How can connect internet to linux through mobile

It is one of the big problem to the Linux user to connect internet to Linux though mobile. Before it take a look on the following. I am recently converted for Windows XP to Ubuntu 8.04 desktop edition because no long to use the priated OS and I am unable to purchased it. By the previews posting Request free Linux CD absolutely free of cost I got the free Ubuntu 8.04 Desktop edition CD absolutely free of cost to me. And I faced the problem to connect internet to linux with my mobile. I searched for this in many sites finally I got it on the Ubuntu support site There are explain easly step-by-step but I did some mistakes, anyway finally I connected internet to Linux through my mobile. It is better to see Ubuntu support site for better result anyway I want to share my experience with you what the mistakes I down when I try to connect. Lets start....
It is only for Ubuntu Linux or Debian based Linux users and I try to do for other Linux users. By my knowledge there are many flavors of Linux distributions are there like Ubuntu, Opensuse, Fedorla and more... Any Linux distribution can build there OS with Redhat Linux based(Redhat pack manager it is in format of .rpm) or in Debian Linux based(It is in the format of .deb). And my Linux is relateed to Debian based. Requirements I used:
  • I am used Linux Ubuntu 8.04 Desktop Edition (Debian based .deb).
  • I used Nokia GPRS supported mobile 3119ci or you can use any GPRS supported mobiles.
  • Check the softwares are installed in your system Wvdial and netenv. If there is not installed follow the command to install that. This two are dialup utility tools.
once again this is only for Ubuntu or Debian based Linux users: sudo apt-get install wvdial sudo apt-get install netenv
Other wise it is hard to install go to System--> Administration--> Synaptic package Manager it will shows the Synaptic package Manager and search the softwares by clicking search button on the top-right of the window and install them. Connect your mobile to the system through the cable and conform phone or modem mode. In this step I failed to see the port where my mobile is connected in syslog file. We can do it by pressing Alt + F2 it will shows the Single Command Line window and type /var/log/syslog and it will shows the syslog file. On Ubuntu support site say that we can see the dirver port /dev/ttyACM0 on the syslog file. But I failed to see the port. Anyway I want to go next step as follows. The next step is I opened the Gnome-Terminal (It is like DOS on windows) by clicking Applications--> Accessories--> Terminal on the top-pannel of the desktop or by single command line press Alt + F2 and type Gnome-terminal you can see the terminal window and type the command as follows.
$ sudo wvdialconf /etc/wvdial.conf Password: Scanning your serial ports for a modem. Port Scan<*1>: S0 S1 S2 S3 S4 S5 S6 S7 Port Scan<*1>: S8 S9 S10 S11 S12 S13 S14 S15 Port Scan<*1>: S16 S17 S18 S19 S20 S21 S22 S23 Port Scan<*1>: S24 S25 S26 S27 S28 S29 S30 S31 Port Scan<*1>: S32 S33 S34 S35 S36 S37 S38 S39 Port Scan<*1>: S40 S41 S42 S43 S44 S45 S46 S47 Port Scan<*1>: S48 S49 S50 S51 S52 S53 WvModem<*1>: Cannot get information for serial port. ttyACM0<*1>: ATQ0 V1 E1 -- OK ttyACM0<*1>: ATQ0 V1 E1 Z -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK ttyACM0<*1>: Modem Identifier: ATI -- Nokia ttyACM0<*1>: Speed 4800: AT -- OK ttyACM0<*1>: Speed 9600: AT -- OK ttyACM0<*1>: Speed 19200: AT -- OK ttyACM0<*1>: Speed 38400: AT -- OK ttyACM0<*1>: Speed 57600: AT -- OK ttyACM0<*1>: Speed 115200: AT -- OK ttyACM0<*1>: Speed 230400: AT -- OK ttyACM0<*1>: Speed 460800: AT -- ttyACM0<*1>: Speed 460800: AT -- ttyACM0<*1>: Speed 460800: AT -- ttyACM0<*1>: Max speed is 230400; that should be safe. ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK Found an USB modem on /dev/ttyACM0. Modem configuration written to /etc/wvdial.conf. ttyACM0: Speed 230400; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
I got it, it will finds my mobile Nokia and successfully I taken next step. The next step is type sudo cat /etc/wvdial.conf command and changed the settings of the wvdial.conf file of as Phone=*99# and username=' ' (null if u have the username fill it), password=' ' (null if you have fill it) as follows and save it.
$ sudo cat /etc/wvdial.conf [Dialer Defaults] Modem = /dev/ttyACM0 Baud = 230400 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init3 = AT+CGDCONT=1,"IP","" ISDN = 0 Modem Type = USB Modem Phone = *99# Username = '' password = ''
NOTE: In case u can try nano or gedit in place of cat in above command. And in the same way we can modify the settings of /etc/network/interfaces and /etc/resolv.conf files as follows.
$ cat /etc/network/interfaces auto ppp0 iface ppp0 inet wvdial
$ cat /etc/resolv.conf nameserver nameserver
NOTE: It is not necessary to modify the settings of /etc/resolv.conf file without it I connected. Haaaaa it is time to connet to internet lets Go.......and enjoy by typing the command wvdial it will show as follows.
mahesh@mahesh-Ubuntu:~$ wvdial --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Sending: AT+CGDCONT=1,"IP","internet" AT+CGDCONT=1,"IP","internet" OK --> Modem initialized. --> Sending: ATDT*99# --> Waiting for carrier. ATDT*99# CONNECT ~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~ --> Carrier detected. Waiting for prompt. ~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~ --> PPP negotiation detected. --> Starting pppd at Fri Jan 23 22:02:51 2009 --> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied --> --> PAP (Password Authentication Protocol) may be flaky. --> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied --> --> CHAP (Challenge Handshake) may be flaky. --> Pid of pppd: 6318 --> Using interface ppp0 --> pppd: ��[06][08][10]�[06][08] �[06][08] --> pppd: ��[06][08][10]�[06][08] �[06][08] --> pppd: ��[06][08][10]�[06][08] �[06][08] --> pppd: ��[06][08][10]�[06][08] �[06][08] --> local IP address --> pppd: ��[06][08][10]�[06][08] �[06][08] --> remote IP address --> pppd: ��[06][08][10]�[06][08] �[06][08] --> primary DNS address --> pppd: ��[06][08][10]�[06][08] �[06][08] --> secondary DNS address --> pppd: ��[06][08][10]�[06][08] �[06][08]
And it stay as above and don't close it when u close it the net willl disconnect it is better to move the window to last workspace (desktop) I forgot it in linux you can maintan multible workspaces (Desktops). And open your browser (In my Ubuntu Linux pack give my loved bowser Mozilla Firefox 3.0 I opened it) and type the URL address which you want to test the connection. Note the browser defaultly in offline mode remove it by click File-menu-->Work offline. The above steps will works 100% before you go to another method or another way be shure you are install the software are not, check your mobile is correctly connect to PC, once again check al the settings of mobile and PC, Check your mobile, datacable, USB port and any other devices with other system. Otherwise it is better to see the link for better result or search on the site for Ubuntu or Debian based users. What the mistakes I done ?
  • First I try to connect my mobile through Bluethooth Device it will connect and disconnect automaticlly after this I checked my Bluethooth devices in my friend system it is not working properly.
  • I am not propely conformed the settings of /etc/network/interfaces and /etc/resolv.conf.
I will try to connect internet to linux through bluetooth . Upto you can enjoy with cable ok.....