Short HowTo - Bluetooth file transfer between KDE 3.2 in Slackware Linux 9.1 and SonyEricsson P900



By Martin Zidek zidek@westmaster.com

2004-04-24 v0.01
2004-04-28 v0.02

NOTE: I have little experience with bluetooth, but this worked for me and maybe will be usefull for others, it may work with other mobile phones, please let me know.

I bought cheap USB Dongle produced by MSI named MSI BToes USB dongle (MS-6970), which is supported by BlueZ linux kernel stack. If you are living in Czech Republic, you can buy some from eg. Levi Int.

1/ Bluetooth BlueZ Kernel support

I assume that you have USB system healthy and running, as it should be after SLW9.1 installation. You must have bluetooth stack in your kernel, if you are running 2.4 series you should upgrade to the latest kernel from www.kernel.org with BlueZ kernel patches aplied. Don't forget to include bluetooth stack in your kernel configuration. I'm using stock unpatched 2.6.5 with bluetooth stack enabled and everything is working fine for me. Here's snip from my kernel .config file
<SNIP>
#
# Bluetooth support
#
CONFIG_BT=m
CONFIG_BT_L2CAP=m
CONFIG_BT_SCO=m
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
#
# Bluetooth device drivers
#
CONFIG_BT_HCIUSB=m
CONFIG_BT_HCIUSB_SCO=y
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_BCSP_TXCRC=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBFUSB=m
CONFIG_BT_HCIDTL1=m
CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
<SNIP>
2/ Usermode BlueZ utilities

You also must have userspace utilities for BlueZ stack. Download and install at least
from BlueZ download area and install them from source using standard sequence
./configure --prefix=/usr --sysconfdir=/etc
make
make install
3/ Bonding

After you insert BT dongle into USB you should try this command (for security reasons I will use 11:11:11:11:11:11 as PC Bluetooth address and 22:22:22:22:22:22 as phone address).
root@devnull:~# hciconfig
hci0:   Type: USB
        BD Address: 11:11:11:11:11:11 ACL MTU: 192:8  SCO MTU: 64:8
        DOWN
        RX bytes:7912 acl:232 sco:0 events:454 errors:0
        TX bytes:33132 acl:306 sco:0 commands:104 errors:0
root@devnull:~#
as you see, BT inteface hci0 is down, you must put it up
root@devnull:~# hciconfig hci0 up
root@devnull:~# hciconfig hci0
hci0:   Type: USB
        BD Address: 11:11:11:11:11:11 ACL MTU: 192:8  SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:71 acl:0 sco:0 events:8 errors:0
        TX bytes:31 acl:0 sco:0 commands:8 errors:0
root@devnull:~#
You will also have to run 2 deamons, hcid and sdpd, which are part of blues-utils package you have already installed. Their configuration files are located in "/etc/bluetooth" directory. You must change "/etc/bluetooth/pin" PIN file. Change default "BlueZ" to random 4 (!) digits, which you will enter on P900 during bonding process. If you don't use 4 digits, bonding process will fail. After PIN change start deamons
root@devnull:~# /usr/sbin/hcid
root@devnull:~# /usr/sbin/sdpd
Now go to Control Panel application on P900 phone and in Connection tab choose Bluetooth, check "Visible to other devices" and select "Done". After this you should see your phone from linux thru bluetooth.
root@devnull:~# hcitool scan
Scanning ...
        22:22:22:22:22:22       P900
root@devnull:~#
Please remeber your P900 hardware address which is diplayed before P900 name. You will need it to transfer files later.
Now you can bond your linux box to P900. Go to "Control Panel" application on P900 phone and in "Connection" tab choose "Bluetooth". Select "Devices" tab and click "Add". Blinking "Searching" should appear on screen. After search end you should see "BlueZ(0)" with computer icon in device list. This is your linux box with default name for hcid and can be changed in file /etc/bluetooth/hcid.conf. Click on "BlueZ(0)" line. Blinking "Bonding in progress" will apear on the screen and you will be asked for PIN. Enter exactly same 4 digits you have in /etc/bluetooth/pin file. "Bonding complete" will appear on screen and "Bluez (0)" device will be added into your "Devices" tab. Now click on "BlueZ(0)" line and check "Allowed to connect without confirmation" in dialog box to stop requests during file transfer startup.

4/ Auto startup

I simply added
/usr/sbin/hcid
/usr/sbin/sdpd
to my /etc/rc.d/rc.local file.

5/ kde-bluetooth setup

You will need kde-bluetooth package, I dot kdeextragear-3-040427.tar.bz2 source snapshot from KDE source snapshot directory. I installed it from source on KDE 3.2. First run ./configure script in the kdeextragear-*
./configure --disable-sdptest -prefix=/opt/kde
directory and then go to kdebluetooth/ directory and compile it and install
cd kdebluetooth
make
make install
you need root privileges for installation as in steps before. After this step, reboot your KDE session, you must have hcid running. I rebooted whoule com puter, so I'm sure everything is OK after reboot. During your new login to KDE you will be informed that "Bluetooth adapter was found" in little window. You will also be asked to replace bluetooth pin helper program in /etc/bluetooth/hcid.conf file. Select some file in Konqueror and in context menu (rigth button) you will find "Actions -> Send with Bluetooth...".

Konqueror context menu

Select this menu item and Bluetooth OBEX Object push client should appear. Select "P900 OBEX Object Push" in Device Selector and click "Send".

OBEX push client

File will be recieved to P900. You can also send files from P900 from FileManager (select Send -> Bluetooth in menu and select BlueZ(0) computer) to your PC, information window will apear asking you to confirm file recieve in KDE notification area.

bluetooth KDE file recieve bluetooth KDE file recieve



6/ Links

If you want additional information, please read
Back...

Valid HTML 4.01!