Saturday, July 14, 2007

Conncting to Grameen Phone EDGE/GPRS in ubuntu linux using Nokia 6300 USB modem

This is the first time I am using ubuntu linux. I am writing this post from the newly installed ubuntu in my home PC. So, this is how I have connected to Grameen Phone EDGE using my Nokia 6300 USB modem.

Check the vendor and product id of your phone, To do this simply connect your phone in Nokia mode through the USB cable.

$ lsusb
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 003: ID 0421:04f9 Nokia Mobile Phones
Bus 005 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Notice the ID 0421:04f9 Nokia Mobile Phones. Here 0421 is the vendor id and 04f9 is the product id.
$ sudo modprobe usbserial vendor=0x0421 product=0x04f9
$ wvdialconf create
Editing `create'.

Scanning your serial ports for a modem.

WvModem<*1>: Cannot set information for serial port.
ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
Modem Port Scan<*1>: S1 S2 S3
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 -- OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found an USB modem on /dev/ttyACM0.
create: Can't open 'create' for reading: No such file or directory
create: ...starting with blank configuration.
Modem configuration written to create.
ttyACM0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
This shows that a modem is connected at /dev/ttyACM0
$ sudo cat > /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyACM0
Baud = 460800
Init1 = AT&F
Init2 = AT E0 V1 &D2 &C1 &S0 S0=0 +dr=1
Init3 = AT+IFC=2,2;+CVHU=1
Init4 = ATS7=60+DS=3,0;&K3
Init5 = AT+CGDCONT=,,"gpinternet"
Init6 = ATS0=0
ISDN = 0
Modem Type = Nokia GSM Phone USB Modem
Phone = *99#
Username = any
Password = any
Stupid Mode = 1
Now just dial your connection.
$ sudo wvdial
--> WvDial: Internet dialer version 1.56
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT&F
OK
--> Sending: AT E0 V1 &D2 &C1 &S0 S0=0 +dr=1
AT E0 V1 &D2 &C1 &S0 S0=0 +dr=1
OK
--> Sending: AT+IFC=2,2;+CVHU=1
OK
--> Sending: ATS7=60+DS=3,0;&K3
OK
--> Sending: AT+CGDCONT=,,"gpinternet"
OK
--> Sending: ATS0=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat Jul 14 10:37:55 2007
--> Pid of pppd: 8383
--> Using interface ppp0
--> pppd: H[18]
--> [06][08][10][12][06][08]
--> pppd: H[18]
--> [06][08][10][12][06][08]
--> pppd: H[18]
--> [06][08][10][12][06][08]
--> pppd: H[18]
--> [06][08][10][12][06][08]
--> local IP address 10.130.9.55
--> pppd: H[18]
--> [06][08][10][12][06][08]
--> remote IP address 10.6.6.6
--> pppd: H[18]
--> [06][08][10][12][06][08]
--> primary DNS address 202.56.4.120
--> pppd: H[18]
--> [06][08][10][12][06][08]
--> secondary DNS address 202.56.4.121
--> pppd: H[18]
--> [06][08][10][12][06][08]
To disconnect press Ctrl+C.

Enjoy

References:
http://warofwords.wordpress.com/2007/05/27/using-gprs-with-ubuntu-without-bluetooth-ankur-shrivastava-linux-usb-nokia-modem-internet/
http://gentoo-wiki.com/Nokia_N60_series
http://www.marzocca.net/linux/ubuntux31.html#gprs

17 comments:

imyousuf said...

In my windows installation the additional argument for installation as follows

+cgdcont=1,"ip","gpinternet"

So I am not certain wth Init5 which is mentioned as follows:
Init5 = AT+CGDCONT=,,"gpinternet"

The problem I faced with the parameter is that I can connect but was able to send only and not receive anything from internet.

But it is a great post. I am using a dedicated EDGE Modem from Anik, lets hope I can install that on my Ubuntu.

Imran

Shihab said...

@Imran
I think you should use

Init5=AT+cgdcont=1,"ip","gpinternet"

Actually it depends on both operator and modem. I have copied it from my windows installation.

Rabiul said...

Dear brother Shihab,
Assalamualaikum. Thank you very much for the information. It works nice. I have tried it on fedora 7.
Take care and Khoda Hafez.

- Rabiul Hassan Khan.

Flyer ! said...

This is cool, you guys have tutorials on the web. Lets march fast, lets have our footprints on the web to show the world , we can do summing !!
I am also looking forward to use the mobile Internet but in Dilemma about which service to use, My pref is Teletalk, Warid, GP, Aktel is out of consideration considering their worst typa Mobile network.

Shihab said...

Lot of people is asking me, how to do it on windows? GP has already provided an instruction: http://www.grameenphone.com/assets/pdf/em_manual.pdf

Unknown said...

I need a different bit of help, not help but short of info. Can you please tell me the browsing and download speed of GP internet on a good Edge modem (not some branded one but made in china and available at IDB Bhaban, cost around 7500 taka). I heard that, actually one of my close friend is using, and says that he gets around 40 KBps (320 kbps) at night and 8-14 KBps (64-112 kbps) during peak hour. Is that true? if so, then I can buy a GP Edge service, bcoz my current net provider, who switched from Zip service to Bracnet Fiber Optic, is giving me very poor speed, all time 24/7 7 KBps (56 kbps).

Unknown said...

Hello,
thanks for this helpful post.
But i am having some problem connecting..I am using debian etch,Anik edge modem and using gp.
Though i have successfully created and configured wvdial.conf, when i write the command wvdial to start it shows me the following error messeges:

--> WvDial: Internet dialer version 1.56
--> Warning: section [Dialer create] does not exist in wvdial.conf.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.

So, can u help me?

Unknown said...

Thanks man you really helped me out!

rajan said...

shihab this is rajan, buet civil 00.
My problem is here

rajan@rajan-desktop:~$ sudo cat > /etc/wvdial.conf
bash: /etc/wvdial.conf: Permission denied
rajan@rajan-desktop:~$

What's the solution?

Shihab said...

@Rajan:
Check that the file is writable.
$sudo chmod +w /etc/wvdial.conf
Then try again:
$sudo cat > /etc/wvdial.conf

adnansanni said...

Shihab bhai I have the same problem as rajon bhai had. but your solution isn't work

Check that the file is writable.
$sudo chmod +w /etc/wvdial.conf
Then try again:
$sudo cat > /etc/wvdial.conf

still it is say, Permission denied.

any help?

Fun said...

i use nokia 3110 classic. will there be any specification?

Raghu said...

Adnan, you can try using gedit. It always works for me. You can type:
sudo gedit /etc/wvdial.conf

Hope that helps.

asad said...

hai,
i am using centos 5.2. I am able to connect gp edge internet but cant brouse internet.

how can i overcome this probem?

thanks
Shohel

mikygourab said...

How can i use my sony ericssonK810i
as usb modem in ubuntu "hardy haron"

Fun said...

It works with Ubuntu-10
Hope it will solve your problem too

At first connect the mobile and at the same time write the following command in the Terminal

$tail -f /var/log/messages

// some Hijibji will come

then open another terminal and
write
$sudo wvdialconf /etc/wvdial.conf

//again write //

$sudo gedit /etc/wvdial.conf

In the gedit screen edit the username and password field ...

/*for example
username = superman
password = superman
*/

then change the following

Phone= *99***1#
Init3=AT+CGD CONT =1,"IP","gpinternet"

save everything

now write

$sudo gedit /etc/resolv.conf

in the gedit window write

nameserver = 202.56.4.120
nameserver= 202.56.4.121

save it

You are done :D

Now connect by $sudo wvdial


Thanks
Nusrat :)

aeinosante said...

Linux..
That's great, you guys have so much time in your life. Nice work. By the way I just wonder why not just use the interface provided in the usb modem of grameen? By the way I have the settings in my blog at http://bit.ly/hnHUr9
Thanks, keep up the good work