This howto is intented to explain the users how to successfully install a host bluetooth device, configure the kernel properly, and finally explain all the possibilities that the host-to-host bluetooth interconnection offers.

Supported Devices

A list of the currently supported devices can be found at: http://www.holtmann.org/linux/bluetooth/features.html
Below is a list of the devices supported by following this method during the development of this document.
DISCLAIMER: These products might work even though some are not qualified bluetooth products. Gentoo does not support them in any way, they might just work.

As the latest linux stable kernel is 2.6.x, the configuration will be done for these series of the kernel. Most Bluetooth devices are connected to a USB port, so USB will be enabled too. If you want, you can use hotplugging in case you want to use modules instead of compiling support built into the kernel, refer to the last chapters of the Gentoo Installation Guide.

After that, we have to boot with our new kernel. If all the process went fine, we can run the command # cat /proc/bus/usb/devices | grep -e^[TPD] | grep -e Cls=e0 -B1 -A1 which should return something like the following:

Perhaps you might not see it up and running. We have to configure the bluetooth service before starting it. A sample file with an already configured device is below. For additional details: man hcid.conf.

After that, we have to check that the device is up and running. If it isn't, stop the bluetooth service, unplug the bluetooth device, plug it back and start the bluetooth service again. A successful initialization would show something like:

The first parameter after the connect command is the local device that will be used.
The second parameter is the MAC address of the remote device.
The third parameter is optional and specifies the channel to be used.

Please, not that in order to connect to a device, that device must be listening for incomming connections. In order to do that, we have to explicitly tell it to listen. We can cancel the communication at any moment by just hitting CTRL + C.

Code:

# rfcomm listen hci0 1
Waiting for connection on channel 1

In a similar way to the connect command, the listen command can receive two parameters. The first one explicits the local device that will be used to accept a connection, while the second is the channel that will be used.

Setting up a PAN (Personal Area Network)

First of all, we need the bnep module loaded. And probably we want it loaded each time the computer starts.

Code:

# modprobe bnep
# echo "bnep" >> /etc/modules.autoload.d/kernel-2.6

Setting up a NAP (Network Access Point)

We have to start the pand daemon in the host that will provide the NAP. We'll have to specify that we want to provide a NAP service and that this host will be the master, thus the other hosts that connect to it, the slaves. Another possible service is GN (Group ad-hoc Network).

Code:

# pand --listen --role NAP --master --autozap

After doing that, we have a host listening, so the rest of hosts just have to connect to that one.

Code:

# pand --connect 00:10:60:A3:CB:41 --service NAP --autozap

Now it's time to configure the IP addresses of our devices. Let's be sure they are there.

From now on, the configuration is the same as for any other network device. Enjoy!

Using a desktop application to control bluetooth

There are two main alternatives on this section: either we use gnome-bluetooth or kdebluetooth.
Unfortunately, at the moment of updating this document, kdebluetooth was masked, so we'll see how to
configure gnome-bluetooth for now.

Configuring gnome-bluetooth

NOTICE: If you are using an amd64 architecture, due to bug #82961, you'll have to do the following first:

Very good instructions. I have a D-link dongle and thus need the bluefw package as well.. .(along with bcm203x configured in the kernel)

/usr/bin/bluepin still quits with the error "ERR" (when running under su) Otherwise it still gives the "Unable to open display" error under normal user. I am using Xorg - which according to the bug is not patched for. So I guess the patch doesn't work for me.

I tried bluexmms to run the userspace utility to pass events to xmms... but I couldn't get it to run properly.... the ruby scripts quits with an error that it couldn't find xmms!_________________Cheers,
KB
<-----------
Yes - that's Herman Toothrot

yes, thanks for the how to but i have a question.... how the hell can i send a file to my motorola v525 phone ?????? or from my motorola v525 to my gentoo ??????????....

Look for obex object push on the forums. This really isn't in the scope of this thread. Gnome and KDE both have packages to do file transfer using Nautilus / own interface respectively. There is a thread in the forums for that._________________Cheers,
KB
<-----------
Yes - that's Herman Toothrot

If i plug an other noname dongle to my machine it is recognized. But then i have the problem, that the keyboard does not work in bios. Does the MS transceiver has special skills which enables keyboard in bios ??

Yes i know that. But the basics are the same. Without getting the device hci0 running i will never be able to connect to my devices like keyboard, mouse or mobile-phone.

Me problem ist that the MS keyboard and mouse is working under linux but only through the support in the bios i think. I get no response from the mouswheel or the the buttons 3-5. I tryed /dev/input/mice,event,mouse. I always only get the mouse movement and button 1-2. And because the hci0 is always down i'm not able to scan for my mobile phone.
If i plug an other noname dongle (hci1) i have a running device. But this dongle does not support my keybord in the bios or grub bootmanager which is not very nice.

I dont know if the MS dongle has special skill for working during boot where no drivers are available. Im a little confused about that.

I followed an other How-To where they adviced to emerge bluez-sdp. This caused some troubles because its a blocked ebuild and now I wanted to follow this How-To. I unmerged bluez-sdp but when emerging bluez-utils I get tons of errors. How can I solve this problem?

I have followed your instructions, along with a ton of other posts about the same thing, and everything works fine, until I try to use obexftp to connect to my phone and pull or push data (or even list). Here is what happens:

I am able to ping the device using l2ping, I have the two devices paired and they can both see each other when searing the bluetooth network, I just can't get obexftp to connect. I am running kernel 2.6.9, bluez-utils 2.12, bluez-lib 2.12, bluez-hcidump 1.16 and obexftp 0.10.7.