Search This Blog

Sunday, September 17, 2006

Bluetooth File Transfers in Linux (to and from mobile)

I think i have solved the problem of file transfer between my Sony Ericsson T610 and Fedora Core 5 Linux PC
I will give the complete process as i had done. But, I cannot guarentee that it will surely work for u. It worked for me.
Thanks to all those guys @ linuxquestions.org who helped me out with suggestions. This will lwork with mostly all bluetooth mobiles. But b4 u begin, check if your bluetooth dongle or device on your systesm is detected/compatible with linux.

For this you will not need any extra software. everything is present in FC5 itself. u should have installed teh BlueZ packages. i think there are 4 packages.

First we need to start the Bluetooth Service
at the terminal type

/etc/init.d/bluetooth start

alternatively this can be done from menus by going to System --> Administration --> Services and starting the Bluetooth service.

then we need to start the hcid. at the terminal

hcid

Now we have started the device. now we need to get the addresses for the communication to take place. for that @ terminal type the command

hcitool dev
the output will be something like this. the 00:11:B1:xx:xx:xx is the address.

[root@mysty ~]# hcitool dev
Devices:
hci0 00:11:B1:07:A2:BD


now you will get your system´s address (if u use a dongle it is the dongle´s address). now to find the devices present in the range.

[root@mysty ~]# hcitool scan
Scanning ...
00:0F:DE:33:BC:F8 Aba's


now linux will scan and give you the addresses of all the devices present within range. the output will be something like above. it wil also give the name of the device if available

note down the address you will need it later.

now you need to create a node for this connection to occur properly. but b4 that check out weather the mobile and system can talk with each other by pinging.

l2ping it wiil be something like this.

[root@mysty ~]# l2ping 00:0F:DE:33:BC:F8
Ping: 00:0F:DE:33:BC:F8 from 00:11:B1:07:A2:BD (data size 44) ...
0 bytes from 00:0F:DE:33:BC:F8 id 0 time 52.07ms
0 bytes from 00:0F:DE:33:BC:F8 id 1 time 44.37ms
0 bytes from 00:0F:DE:33:BC:F8 id 2 time 43.09ms
0 bytes from 00:0F:DE:33:BC:F8 id 3 time 33.83ms
0 bytes from 00:0F:DE:33:BC:F8 id 4 time 40.24ms
0 bytes from 00:0F:DE:33:BC:F8 id 5 time 37.62ms
6 sent, 6 received, 0% loss


ok now to create a node for the device. at the terminal

mknod /dev/rfcomm0 c 216 0

now we have to bind the mobile device to this node.

rfcomm bind /dev/rfcomm0 00:0F:DE:33:BC:F8 1

that number 1 @ the end is the channel which we will be using for the communication. use your phone´s address.

you can use the rfcomm show command to see all the rfcomm devices bound to your system.

now you can start sharing files between your system and mobile.

use gnome-obex-send to send a file to your mobile.

to send from your mobile to pc first you will have to start the Obex server.
if you are unable to start the server check for a bluetooth icon near the time in the panel. if it is there close it and then start the server. to start the server

[root@mysty ~]# gnome-obex-server

now you can send files from mobile to pc by choosing send --> via bluetooth option.

may be now i have to search for a decent GUI for doing this, so that i can recommend this to some of my friends.

if any thing goes wrong, please leave me a comment here. also try the various forums. the more places u seek, the more quicker u´ll get a solution

No comments:

Post a Comment