Software needed:
- bluez-kernel-2.3.tar.gz # sources for kernel modules
- bluez-libs-2.4.tar.gz # libraries needed for bluez-utils
- bluez-utils-2.3.tar.gz # utilities needed to use your BT adapter
- bluez-sdp-1.1.tar.gz # tools to search for BT services in your neighborhood
- bluez-pan-1.1.tar.gz # tools to crate local BT services
- rfcomm-0.8.tar.gz # utilities to create connections to the services
These can be found on http://bluez.sourceforge.net/download/download.html.
Binary packages for your distribution can be found at:
- http://bluez.sourceforge.net/download/debian/
- http://bluez.sourceforge.net/download/redhat/
- http://bluez.sourceforge.net/download/zaurus/
Distribution’s kernel sources or vanilla sources are also needed tested on kernel 2.4.18 and above on SuSE Linux and Gentoo Linux SuSE only provides a custom 2.4.18 kernel so that is what we used, Gentoo comes with any kernel you like so we used the latest available stable kernel which is 2.4.20.
Configure your kernel
cd /usr/src/linux
make menuconfig
Now configure your kernel like you normally do, if you use a standard distribution kernel the best settings should have already been set.
More information about configuring your kernel can be found at:
Go to USB Support and make sure USB Bluetooth support is NOT enabled.
Exit the USB Support menu and enter the Bluetooth Support menu
Here simply activate everything by either saying ‘y’ if you want the support to be compiled into the kernel and ‘m’ if you want modular bluetooth support. We chose to work with modules for more flexibility.
Now compile your kernel with make bzImage
After that is done copy your kernel to /boot and configure your boot-loader to boot that kernel. Now compile the modules with ‘make modules’ and install them with make modules_install
.
Add the following lines to the file /etc/modules.conf
:
alias net-pf-31 bluez
alias bt-proto-0 l2cap
alias bt-proto-2 sco
alias bt-proto-3 rfcomm
alias bt-proto-4 bnep
This will make sure the right modules are inserted when needed.
Untar the file bluez-kernel-2.3.tar.gz
and cd into the newly created directory.
Configure the package by running:
./configure --with-kernel=/usr/src/linux
And compile and install everything with
make
make install
This will compile and install the modules needed for your bluetooth adapter.
Now insert the bluetooth adapter, reboot and boot into your new kernel.
After the reboot run:
lsmod
This should output something like the following:
hci_usb 6624 0 (unused)
bluez 25640 1 [hci_usb]
This means the bluetooth adapter has been recognised and initialized by your system. If you did not see these modules as loaded, you can load them yourself by:
modprobe bluez
modprobe hci_usb
Now run the command ‘dmesg’ and check if the end of the output contains any errors about the BlueZ modules that have just been loaded.
If no errors were returned, everything went successful, and the bluetooth adapter is working.
To be able to use your newly installed adapter you need to install some additional packages:
bluez-libs-2.4 bluez-utils-2.3 bluez-sdp-1.1 bluez-pan-1.1 rfcomm-0.8
All of the packages can be simply compiled by doing:
./configure
make
make install
in the directories of the untarred packages.
Now you should be able to issue the commands:
hcid
sdpd
these programs find your adapter and make sure other programs can interface with it.
activate your adapter by running:
hciconfig
this should then output something like:
hci0:
Type: USB BD Address: 00:10:60:29:2B:C7 ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX
bytes:99 acl:0 sco:0 events:13 errors:0 TX bytes:296 acl:0 sco:0 commands:12 errors:0
Then run:
hcitool dev
This will output the connected bluetooth devices on your system:
Devices: hci0 00:10:60:29:2B:C7
To scan your surroundings for any other working bluetooth devices run:
hcitool scan
If there are any devices near you the output will look like:
Scanning ... 00:60:57:21:B2:76 Nokia 6310i 00:01:E3:02:C7:C5 init1
You can test if you can reach the devices by using l2ping:
l2ping 00:60:57:21:B2:76
Ping: 00:60:57:21:B2:76 from 00:10:60:29:2B:C7 (data size 20) ...
0 bytes from 00:60:57:21:B2:76 id 200 time 32.78ms
0 bytes from 00:60:57:21:B2:76 id 201 time 71.72ms
0 bytes from 00:60:57:21:B2:76 id 202 time 45.56ms
0 bytes from 00:60:57:21:B2:76 id 203 time 51.28ms
Initializing this program might take a few seconds. After a few correct packets you can CTRL+C to quit this.
You can search your neighborhood for bluetooth services with:
sdptool search
or
sdptool browse (this will output a big load of text)
Congratulations you have a working Sitecom CN-500 Bluetooth device Additional linux & bluetooth links and info can be found on http://www.holtmann.org/linux/bluetooth.