Connect to the Internet using Sony Ericsson K750i bluetooth modem in Ubuntu

In my earlier post related to this ( Connect to the Internet using mobile GPRS modem ), I’d shown you how to connect to the Internet using a K750i bluetooth modem in windows. In this post I’ll show you how to do the same in Ubuntu.

Now for the specs. First up, I’m using Ubuntu 9.04 (Jaunty Jackalope), and though it is buggy as I mentioned in my earlier posts, I’m able to manage with it by doing periodic fscks disk checks. So now it is running perfectly fine, and this being the only OS in my notebook that I can connect to net. Next, I currently use the Sony Ericsson K750i model, which has the feature of allowing a PC to connect to net using it’s modem. And that’s all you require, oh yeah of course, you need a computer with bluetooth adapter.

Now for the procedure.

First, pair the device using the bluetooth module in ubuntu, that is on the panel, a bluetooth icon is available, right click on it, click on “Set up new device”, then pair it. If that doesn’t work, maybe you can try sending a file, or browsing the files in a bluetooth device, and then pair. Even that doesn’t, try the other way round, that is make the computer discoverable, and then pair it using your phone. If that is not working, try doing it command line way (check the references below).
Next, open up the terminal, and type this ” hcitool scan “. With that you get the MAC address of your phone. Note it down and then type the next command ” sdptool browse X ” where the X is to be replaced with your MAC address. Note the MAC address will be of this type : 00:12:D2:FB:9B:AC…. This command will show you the list of devices or channels precisely that your phone has. It will look this…

$ sdptool browse 00:16:20:5A:9D:67
Browsing 00:16:20:5A:9D:67 …
Service Description: Sony Ericsson W800
Service RecHandle: 0x10000
Service Class ID List:
“PnP Information” (0x1200)

Service Name: Dial-up Networking
Service RecHandle: 0x10001
Service Class ID List:
“Dialup Networking” (0x1103)
“Generic Networking” (0x1201)
Protocol Descriptor List:
“L2CAP” (0x0100)
“RFCOMM” (0x0003)
Channel: 1
Profile Descriptor List:
“Dialup Networking” (0x1103)
Version: 0x0100

Service Name: Serial Port
Service RecHandle: 0x10002
Service Class ID List:
“Serial Port” (0x1101)
Protocol Descriptor List:
“L2CAP” (0x0100)
“RFCOMM” (0x0003)
Channel: 2

Service Name: HF Voice Gateway
Service RecHandle: 0x10003
Service Class ID List:
“Handsfree Audio Gateway” (0x111f)
“Generic Audio” (0x1203)
Protocol Descriptor List:
“L2CAP” (0x0100)
“RFCOMM” (0x0003)
Channel: 3
Profile Descriptor List:
“Handsfree” (0x111e)
Version: 0x0101

Service Name: HS Voice Gateway
Service RecHandle: 0x10004
Service Class ID List:
“Headset Audio Gateway” (0x1112)
“Generic Audio” (0x1203)
Protocol Descriptor List:
“L2CAP” (0x0100)
“RFCOMM” (0x0003)
Channel: 4
Profile Descriptor List:
“Headset” (0x1108)
Version: 0x0100

Service Name: OBEX Object Push
Service RecHandle: 0x10005
Service Class ID List:
“OBEX Object Push” (0x1105)
Protocol Descriptor List:
“L2CAP” (0x0100)
“RFCOMM” (0x0003)
Channel: 5
“OBEX” (0x0008)
Profile Descriptor List:
“OBEX Object Push” (0x1105)
Version: 0x0100

Service Name: OBEX File Transfer
Service RecHandle: 0x10006
Service Class ID List:
“OBEX File Transfer” (0x1106)
Protocol Descriptor List:
“L2CAP” (0x0100)
“RFCOMM” (0x0003)
Channel: 6
“OBEX” (0x0008)
Profile Descriptor List:
“OBEX File Transfer” (0x1106)
Version: 0x0100

Service Name: OBEX SyncML Client
Service RecHandle: 0x10007
Service Class ID List:
UUID 128: 00000002-0000-1000-8000-0002ee000002
Protocol Descriptor List:
“L2CAP” (0x0100)
“RFCOMM” (0x0003)
Channel: 7
“OBEX” (0x0008)

Service Name: OBEX IrMC Sync Server
Service RecHandle: 0x10008
Service Class ID List:
“IrMC Sync” (0x1104)
Protocol Descriptor List:
“L2CAP” (0x0100)
“RFCOMM” (0x0003)
Channel: 8
“OBEX” (0x0008)
Profile Descriptor List:
“IrMC Sync” (0x1104)
Version: 0x0100

Service Name: Mouse & Keyboard
Service Description: Remote Control
Service Provider: Sony Ericsson
Service RecHandle: 0x10009
Service Class ID List:
“Human Interface Device” (0x1124)
Protocol Descriptor List:
“L2CAP” (0x0100)
PSM: 17
“HIDP” (0x0011)
Language Base Attr List:
code_ISO639: 0x656e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
“Human Interface Device” (0x1124)
Version: 0x0100

Ok, so in this, your have to look for the Dial Up Network, and note the channel. Now you have to edit a the file rfcommf.conf. So in the terminal again, type ” sudo gedit /etc/bluetooth/rfcommf.conf “. In the empty text file, add this..

rfcomm0 {
  bind yes;
  device X;  <- Insert your phone's MAC address here
 channel x;  <- Insert the channel number you have noted down
  comment "P900 PPP connection";
}

Now restart the bluetooth by typing this command ” sudo /etc/init.d/bluetooth restart “.

After that, the next step is to configure the ppp. Type this command again ” sudo gedit /etc/ppp/peers/BluetoothDialup “. Now in the blank text file, add this…

debug
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/BluetoothDialup"
usepeerdns
/dev/rfcomm0 115200
defaultroute
crtscts
lcp-echo-failure 0

Save and close this file. Now again type this in terminal ” gksudo gedit /etc/chatscripts/BluetoothDialup “. Add this in the empty text file.

TIMEOUT 35
ECHO    ON
ABORT   '\nBUSY\r'
ABORT   '\nERROR\r'
ABORT   '\nNO ANSWER\r'
ABORT   '\nNO CARRIER\r'
ABORT   '\nNO DIALTONE\r'
ABORT   '\nRINGING\r\n\r\nRINGING\r'
''      \rAT
OK      'AT+CGDCONT=1,"IP","your-apn-here"'
OK      ATD*99***your-data-profile-number-here#
CONNECT ""

” AT+CGDCONT=1 ” is dependent on your network operator. I use BSNL, and so it appears to be the same. And also enter the apn number in the required place. And your data profile number can be any number from 1-9, or even no number. For me it was 8. Save this and close.

Finally, connecting to the Internet. The command used to connect is ” pon BluetoothDialup ” in the terminal, and to disconnect is ” poff BluetoothDialup “. It will take 10-30 seconds to connect to the net, dependant on your mobile.

Now here I’d a small problem. Here I stumbled upon an error telling option rfcomm0 not existent. If you do get this after doing all the following steps, do this ….

rfcomm bind 0 your-phone-mac-address your-phone-rfcomm-channel

If you have done with a wrong channel, then you can type this command and try again…

rfcomm release 0

It took me many many days to get this figured out. Thanks to the posts in the links below, I was finally able to connect the free Internet I’m getting in the BSNL Postpaid plan. And the speed seems quite ok for a gprs connection. This is not EDGE enabled phone, and BSNL does provide EDGE service, for in a Nokia phone, it gave me speed 10 times faster than the norm. Hope this tutorial helped you, and any doubts or clarification, leave a comment. So happy surfing!!!!

References :

Mobile Broadband Internet over Bluetooth

Ubuntu Linux – Bluetooth and GPRS dialup connection

BluetoothDialup

Advertisements

5 comments

  1. solved
    the rfcomm0 was not binding automaticaly so i had to bind it manually. and your tutorial didn’t work for my phone. I had to use another one, a little bit more complicated.

    • I had changed a bit regarding the rfcomm0 option… Hope this is the all complete tutorial for bluetooth connectivity.

    • well, i guess u r using a different phone, or maybe ur dial up networking is in the different channel. try putting rfcomm1 or something…

  2. when I use sdptool browse “dev addresss”, error stating “File descriptor not in good format occured. Plesae suggest way to get it done.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s