Monday, March 31, 2008

How to use your phone as a GPRS modem in ubuntu ! (Vodafone Egypt settings)

I finally needed it:), a GPRS modem on my beautiful Gutsy ;)

I just wanted to use my Nokia N73 as a modem to get internet while on the go or in a place without a hotspot !, how ? read on !

First of all, I'm running on Ubuntu Gutsy.

secondly , I'm using a Nokia N73. Not all phones work same !

Third, My provider is Vodafone Egypt, Not all countries/providers work the same!

  1. I started by connecting my phone to the USB cable into my box.
  2. Check if you have a wvdial.conf file "/etc/wvdial.conf" you might want to backup ! "cp /etc/wvdial.conf /etc/wvdial.conf.bak"
  3. Configure wvdial , type "sudo wvdialconf"
  4. You will see some information text scrolling, wait till it's finished.
  5. After wvdialconf has finished it's work, It dumps all it's settings into a new "/etc/wvdial.conf" file !
  6. head over /etc and open it, type "sudo gedit /etc/wvdial.conf" I prefer vim, but you choose your favourite editor.
  7. read out the settings for your phone device in my case: "/dev/ttyACM0" , yours can be "/dev/ttyUSB0" or something similar depending on your phone and USB ports !
  8. To make it work in Egypt, I had to tweak the settings and find Init strings to make it work !, Finally , I have found the right settings and it works, Make sure your wvdial.conf file looks like mine : REMEMBER (Vodafone, Egypt, NokiaN73): http://www.mostafaberg.com/share/wvdial.conf
  9. Now you are all set !, If you are in a different country, check this link out: it's a great place to find wvdial.conf files http://ubuntuforums.org/showthread.php?t=633981
  10. Now you're ready to connect !
  11. Open up a new terminal window, connect using "sudo wvdial" command, watch what happens, if it works, you should get something like this output:
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Sending: ATE0V1&D2&C1S0=0+IFC=2,2
WvDial Modem<*1>: ATE0V1&D2&C1S0=0+IFC=2,2
WvDial Modem<*1>: OK
WvDial<*1>: Sending: AT+CGDCONT=1,"IP","internet.vodafone.net";
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT*99***1#
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: CONNECT
WvDial Modem<*1>: ~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
WvDial<*1>: Carrier detected. Starting PPP immediately.
WvDial: Starting pppd at Tue Apr 1 01:59:32 2008
WvDial: Pid of pppd: 14872
WvDial<*1>: Using interface ppp0
WvDial<*1>: local IP address xx.xxx.xx.2xx
WvDial<*1>: remote IP address 1x.xx.xx.xx
WvDial<*1>: primary DNS address 1xx.1x1.1xx.1xx
WvDial<*1>: secondary DNS address 1xx.1x1.xxx.1xx

You are now officially online :)

Hope you like this mini tutorial :)

have fun !