Internet in Linux via Mobile GPRS thru Bluetooth

Status
Not open for further replies.

Pathik

Google Bot
[HOWTO] Internet in Linux via Mobile GPRS (Data Cable/Bluetooth))

Internet via Mobile GPRS & Bluetooth in Opensuse 10.2 (KDE)

1.Connect ur mobile to ur PC with kbluetoothd (BT obex server) using and pair it...
2.open KONSOLE and login as root (su)
3.Type
Code:
# sdptool search DUN
if it detects any DUN services than it means that ur fone is enabled to be connected thru BT DUN..
4.Type
Code:
# hcitool scan
This ll give u the device id of ur fone...
5.now bind the Device ID of ur fone wit the rfcomm device using
Code:
# rfcomm bind 0 <Device id of ur fone> 1
6.If u get any error in the above command or u dont hav a device rfcomm0 then u need to create one by
Code:
#mknod /dev/rfcomm0 c 216 0
7.next u need to edit ur /etc/wvdial.conf file to enter ur BT modem settings
Code:
# nano -w  /etc/wvdial.conf
Edit ur Wvdial and copy the following in it...
Code:
[Modem0]
Modem = /dev/rfcomm0
Baud = 230400
SetVolume = 0
DialCommand = ATDT
FlowControl = Hardware(CRTSCTS)

[Dialer GPRS]
Username = 1
Password = 1
Phone = *99***1#
Mode = 1
Inherits = Modem0

[Dialer Defaults]
Modem = /dev/rfcomm0
Baud = 230400
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
Phone = *99***1#
Username = a
Password = b
8.Now run the command
Code:
# wvdial GPRS
instead of GPRS u can enter whatever dialer name u hav entered...
You should get connected.

Method 2: For Newer distros like Ubuntu 7.10 using Bluetooth

1> Insert your bluetooth dongle and activate bluetooth service in your mobile. And open terminal/console

2> Discover your phone issuing following command to get your phone's MAC address
Code:
$ hcitool scan

3> Discover the channel alloted for DUN via
Code:
$ sdptool browse <mac add.>

4> Edit your /etc/bluetooth/rfcomm.conf file
Code:
$ sudo gedit /etc/bluetooth/rfcomm.conf

and paste this substituting <value> with appropriate value
Code:
rfcomm0
{
bind yes;
device <mac add.>;
channel <DUN channel>;
comment "My Phone";
}

5> Create your modem device
Code:
$ sudo rfcomm bind 0 <mac add.> <channel>

6> Now when everything is done you need a dialer to activate Internet, we will be using wvdial
Edit your /etc/wvdial.conf via
Code:
$ sudo gedit /etc/wvdial.conf
Paste this :
Code:
[Modem0]
Modem = /dev/rfcomm0
Baud = 115200
SetVolume = 3
Dial Command = ATDT
Init1 = ATZ
Init3 = ATM1L3
FlowControl = CRTSCTS

[Dialer BT]
Username = aa
Password = aa
Phone = *99***1#
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Inherits = Modem0
NOTE: Change Phone, Username, Password according to requirement. If you don't have username and password then keep it like only

7> Activate :
Code:
$ sudo wvdial BT
For deactivating press Ctrl+C

Thanx to Anantkhaitan for posting this


Internet via Mobile GPRS & USB Cable in Ubuntu 7.04 (GNOME) and Fedora 7(GNOME/ KDE)
Code:
# sudo wvdialconf /etc/wvdial.conf
You shd get some output like
Output:
Scanning your serial ports for a modem.

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.
ttyS1<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS1<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS1<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
ttyS2<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS2<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS2<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
ttyS3<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS3<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS3<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
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.
Modem configuration written to /etc/wvdial.conf.
ttyACM0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

This means that it has found a MODEM.. and the basic wvdial.conf has been written..
Now to edit wvdial.conf
Code:
sudo gedit /etc/wvdial.conf

Enter the Dialling number, Username , Passwd etc

My wvdial.conf :


[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
ISDN = 0
New PPPD = yes
Phone = *99#
Modem = /dev/ttyACM0
Username = b
Password = a
Baud = 460800

Now to connect

Code:
sudo wvdial
If all has gone right it shd show something like

--> WvDial: Internet dialer version 1.56
--> 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
--> 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 Apr 27 16:34:47 2007
--> Pid of pppd: 8094
--> Using interface ppp0
--> pppd: p[08][06][08][08]
--> [06][08]
--> pppd: p[08][06][08][08]
--> [06][08]
--> pppd: p[08][06][08][08]
--> [06][08]
--> pppd: p[08][06][08][08]
--> [06][08]
--> local IP address 10.190.237.191
--> pppd: p[08][06][08][08]
--> [06][08]
--> remote IP address 10.6.6.6
--> pppd: p[08][06][08][08]
--> [06][08]
--> primary DNS address 202.56.230.5
--> pppd: p[08][06][08][08]
--> [06][08]
--> secondary DNS address 202.56.240.5
--> pppd: p[08][06][08][08]
--> [06][08]

This means that ur connection is complete... keep that terminal window open and surf..

Credits: Google and Mehul
 
Last edited:

kaustav_geek

1337 |)00|) \m/
Well... I tried it in Ubuntu 6.10. I've created the rfcomm0 device as mentioned and also bound it to my phone's MAC address as specified.. The wvdial.conf was also setup as directed but when I use wvdial GPRS to connect, it says that it can't connect to the /dev/rfcomm0

Wonder what's wrong. The phone was dicovered in the DUN search too.
HAs any one setup Bluetooth in UBUNTU 6.10??? I guess its a lot more tougher nut to crack...
cheers..
 
OP
Pathik

Pathik

Google Bot
r u using bluez??? and one more thing u need to be logged in as root wen u connect to the net...
 

kaustav_geek

1337 |)00|) \m/
Hmmm.. Wel I do use bluez.. And I do log into root while connecting... I came across in some forum that edgy has some issues with DUN using bluetooth. All the tutorials regarding gprs using bluetooth in ubuntu have been written for dapper and not edgy. Well, I've asked it before and ask it yet again. Has anybody configured this thing succesfuly in ubuntu 6.10 ?
 

mehulved

18 Till I Die............
kaustav_geek said:
Hmmm.. Wel I do use bluez.. And I do log into root while connecting... I came across in some forum that edgy has some issues with DUN using bluetooth. All the tutorials regarding gprs using bluetooth in ubuntu have been written for dapper and not edgy. Well, I've asked it before and ask it yet again. Has anybody configured this thing succesfuly in ubuntu 6.10 ?
I have used bluetooth in edgy without problems but not gprs.
 

kaustav_geek

1337 |)00|) \m/
Yeah I mentioned dun using bluetooth haven't I ? I haven't tried it in dapper but as i get from some forums, gprs can be succesfuly configured in it. However, since i don't have a copy of dapper, i'm switching over to open suse 10.2. I'm sure i'l get dun via bluetooth to work with it.
Wish me luck friends.
 

kaustav_geek

1337 |)00|) \m/
A great news!!!!!!!!
I've configured GPRS in UBUNTU 6.10 !!!!!! hip-hip hurray!!!!!!!!!!!!!!
Thanks a lot for your support guys!!!!! please check this thread!!!

I'm soooo Happy!!!!!
 

anantkhaitan

Burning Bright
I have proceeded exactly as instructed but the problem i m facing is my terminal is not echoing any window to verify the pass code i have provided in my mobile.

whenever i trigger this : wvdial GPRS

i get a notification of 'add my computer as a device' i simply did yes and provided a passcode : 1234
but there was no place on the computer's screen where i could verify this passcode

Is there any way to set a default passcode

I m using Ubuntu 6.10 and Sony Ericsson k700i phone
 

anantkhaitan

Burning Bright
Sir there is no such pin file in my computer..
Can you give me he syntax of writing in that file

I mean what should be the content of the file
 

mehulved

18 Till I Die............
There's nothing else in the file except the pin number. No syntax, no additional words.
Which distro are you using and what bluetooth framework have you installed? It has to be there.
 

anantkhaitan

Burning Bright
Thank U guys
Finally its working on my Red Hat....
And Guys one more thing I changed that 'Baud' value to 115200 perhaps this was creating the problem
 

anantkhaitan

Burning Bright
Friends i wanna share a graphical way for this.. i discovered few days back..

1>
# hcitool scan
U will get ur Phone's mac address which u will need to substitute in the following steps

2>
# nano /etc/bluetooth/rfcomm.conf

Paste this substituting ur mac add.
rfcomm0 {
# Automatically bind the device at startup
bind no;

# Bluetooth address of the device
device <mac address>;

# RFCOMM channel for the connection
channel 1;

# Description of the connection
comment "Hello";
}

3>
# rfcomm bind 0 <mac address> 1
Close terminal

4>open system-config-network
System>Administration>Network

5>Click 'New'>Modem Connection
There replace "Modem Device" box with
/dev/rfcomm0
and click 'Forward'

6>Specify ur provider information like phone no, Provider name, username, password etc
and keep on clicking 'Forward' button until u click 'Apply'

7>Highlight ur provider by a click and then click on the 'Activate' Button

Thats all
 

mehulved

18 Till I Die............
anantkhaitan said:
4>open system-config-network
System>Administration>Network

5>Click 'New'>Modem Connection
There replace "Modem Device" box with

and click 'Forward'

6>Specify ur provider information like phone no, Provider name, username, password etc
and keep on clicking 'Forward' button until u click 'Apply'

7>Highlight ur provider by a click and then click on the 'Activate' Button

Thats all
This part is distro specific, it will work only on red hat and fedora not on all distros that's why I told them not to use such tools in this tutorial which can make things distro specific. Those can become confusing for newbies. Anyways it is great, as those using fedora can gain from this. For your first few steps where you used CLI, I believe there's a GUI way too.

BTW, I also saw this nice tutorial on how to sync your phone - *gentoo-wiki.com/HOWTO_sync_mobile_phone_with_Gentoo
Well it is gentoo specific but with a bit of work arounds, can be used in other distros too. I am still trying to get it work under gentoo. Let's see how it goes.
 

anantkhaitan

Burning Bright
^^^
Man tell me is there any problem with debian based distro.. bcoz I was able to access Internet via bluetooth in every other distros I tried except Ubuntu & Dreamlinux.. if there is plz tell how to solve it.. I m able to pair up my mobile
------------------

One more thing i want to transfer file to my phone and retrieve files from there..how can i do that..Perhaps it can be done by 'gnome-bluetooth-manager' but i m not finding it in my menu..Tell me how to open it via terminal.

I m using Fedora Core 6
 
Status
Not open for further replies.
Top Bottom