Bluetooth File Transfer With Linux

USB Bluetooth Dongle

This stuff was done using Mandriva 2007 and KDE 3. I have two very cheap bluetooth micro USB adapters, and both work perfectly with Linux. Any reasonably recent distro will already have the bluetooth kernel modules, so chances are, you won't need to bother messing about with the kernel.

As usual, I'm writing this so I can remember where to look in future when I've forgotten how to do this. (My memory is like a sieve). There are much more comprehensive tutorials elsewhere.

Firstly install packages bluez, bluez-utils.

I also installed packages kdebluetooth, obexftp.

Send a file to a bluetooth device via Konquerer KDE File Manager

Ensure package kdebluetooth is installed for this.

KDE Send With Bluetooth Right click the required file in Konqueror file manager, select "Actions", "Send Via Bluetooth". This will open the "Bluetooth OBEX Object Push Client" with the required file already selected in the right-hand pane. You can also run the command kbtobexclient to access this.
 
Bluetooth OBEX Push Client Wait for bluetooth device searching to complete, then when the correct bluetooth device appears in the left-hand pane, select it, then press "Send" on the bottom-right.

Manage Files With Konqueror

Browse for bluetooth devices in konqueror Open Konqueror file manager, and type bluetooth:/ in the "Location" toolbar. This will show the bluetooth devices in range. You can also do this by simply clicking the bluetooth icon in the sytem tray. Select OBEX file transfer Double-click "OBEX File Transfer". You should then see shared drives or available storage icons. I see C: and E: drives of my Nokia N95.

Scan for bluetooth devices in range from the command prompt

hcitool scan will show bluetooth devices in the area, along with their respective names.
[jack@jf ~]$ hcitool scan
Scanning ...
        00:1E:3A:2B:E5:8B       Driving God
        00:21:FE:BE:E3:38       Jordan not jodie
		

Send a file to a bluetooth device via the command prompt

Install package obexftp for this.

If the device is not yet paired with the linux box, you will be prompted for passwords during this process. It doesn't matter what you choose as long as you enter the same code on both the bluetooth device and the linux box. Subsequent transfers will work without prompting for the password.
[jack@jf ~]$ obexftp -b 00:1E:3A:2B:E5:8B -p test.jpg
Browsing 00:1E:3A:2B:E5:8B ...
Channel: 11
Connecting...done
Sending "test.jpg"...-done
Disconnecting...done
		

USB Bluetooth Dongle Not Working?

Bluetooth adapter found Have you got your bluetooth dongle plugged in, but it's not being recognised? When I plug in my bluetooth dongles, I get "Bluetooth adapter found" in the system tray. Try this. Type hciconfig with no parameters, and you will see basic information about all bluetooth devices found by the system. You need to be root to do this.
[root@jf ~]# hciconfig
hci0:   Type: USB
        BD Address: 00:13:67:D0:4E:FD ACL MTU: 1021:4 SCO MTU: 48:10
        DOWN
        RX bytes:514 acl:0 sco:0 events:29 errors:0
        TX bytes:345 acl:0 sco:0 commands:23 errors:0
		
This shows that the system has detected my bluetooth adapter as hci0, but the interface is down. Type hciconfig hci0 up to bring the interface up.
[root@jf ~]# hciconfig hci0 up
[root@jf ~]# hciconfig
hci0:   Type: USB
        BD Address: 00:13:67:D0:4E:FD ACL MTU: 1021:4 SCO MTU: 48:10
        UP RUNNING PSCAN
        RX bytes:922 acl:0 sco:0 events:48 errors:0
        TX bytes:669 acl:0 sco:0 commands:42 errors:0
		

Other Useful Commands To Play With

khciconfig: part of kdebluetooth.