Wednesday, November 28, 2007

How to connect to the internet using T-Mobile and bluetooth

I have a laptop with Debian, cell phone (Nokia N70) with bluetooth and this howto describes how to connect to the internet.

Connect USB bluetooth dongle to the laptop and check it:

$ hciconfig
hci0: Type: USB
BD Address: 00:02:72:D2:23:12 ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:686 acl:0 sco:0 events:22 errors:0
TX bytes:337 acl:0 sco:0 commands:21 errors:0

Scan for the phone:

$ hcitool scan
Scanning ...
00:19:79:86:EB:BC Nokia N70

Create a serial device for communicating with the modem in the phone:

$ rfcomm connect /dev/rfcomm0 00:19:79:86:EB:BC 3
Connected /dev/rfcomm0 to 00:19:79:86:EB:BC on channel 3
Press CTRL-C for hangup

(A dialog will popup on the phone asking me to allow the laptop to connect.)

Connect using wvdial:

$ wvdial
--> 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***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Wed Nov 28 12:58:55 2007
--> Pid of pppd: 4378
--> Using interface ppp0
--> pppd: �[08][06][08]�[10][06][08]
--> pppd: �[08][06][08]�[10][06][08]
--> pppd: �[08][06][08]�[10][06][08]
--> pppd: �[08][06][08]�[10][06][08]
--> local IP address 172.24.171.97
--> pppd: �[08][06][08]�[10][06][08]
--> remote IP address 10.6.6.6
--> pppd: �[08][06][08]�[10][06][08]
--> primary DNS address 62.141.0.2
--> pppd: �[08][06][08]�[10][06][08]
--> secondary DNS address 213.162.65.1
--> pppd: �[08][06][08]�[10][06][08]

And that's it, I am connected.

Prerequisities

$ wajig install wvdial bluez-utils

And setup the /etc/wvdial.conf file:

$ cat /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/rfcomm0
ISDN = 0
Phone = *99***1#
Password = doesnt_matter
Username = doesnt_matter
Stupid Mode = 1
Post a Comment