Reason: Several generations of various deprecated tools are mentioned. bluez4 and bluez are confused. This article needs cleanup from someone who knows what commands belong in which packages. (Discuss in Talk:Bluetooth#)

Bluetooth is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is BlueZ.

Installation

To use Bluetooth, installbluez, available in the Official Repositories. The dbus daemon(start automatically by systemd) is used to read settings and for PIN pairing, while the bluetooth daemon is required for the Bluetooth protocol.

Start the bluetooth service:

# systemctl start bluetooth.service

Enable the bluetooth service at system boot up:

# systemctl enable bluetooth.service

Graphical front-ends

The following packages allow for a graphical interface to customize Bluetooth.

Be sure that bluetooth daemon is running as described above, and the local bluetooth device is availabe by running hcitool dev. If only Devices: is dumped, the local bluetooth device is unavailable. You may run systemctl restart bluetooth.service or toggle the wifi/bluetooth switch of your laptop Ex. Fn+F3 in Acer Aspire or reboot to activat the local bluetooth device. If you run blueman-applet without available local bluetooth device, the Blueman tray icon won't appear.

Then execute blueman-applet, and the Blueman tray icon will show up. /etc/xdg/autostart/blueman.desktop may have been created to autostart Blueman when loggin into X in a system-wide manner. If not, to make the applet run after login into a graphical environment automatically, add blueman-applet either under System -> Preferences -> Startup Applications (GNOME) or Xfce Menu -> Settings -> Session and Startup (Xfce). Various ways to autosrtart a program are listed in Autostarting.

In order for a user to add and manage Bluetooth devices using Blueman, the user must be added to the 'lp' group. See /etc/dbus-1/system.d/bluetooth.conf for the section that enables users of the 'lp' group to communicate with the Bluetooth daemon.

Note: If you are running Blueman outside GNOME/GDM (e.g., in Xfce using the startx command) you should add . /etc/X11/xinit/xinitrc.d/* on top of your ~/.xinitrc to make Nautilus capable to browse your devices.

To receive files don't forget to right click on the Blueman tray icon -> Local Services -> Transfer -> File Receiving" and tick the square box next to "Enabled".

Script for Thunar

If you are not using Nautilus (for example Thunar) you may find the following script useful:

Now you will need to move the script to an appropriate location (e.g., /usr/bin). After that, mark it as executable:

chmod +x /usr/bin/obex_thunar.sh

The last step is to change the line in Blueman tray icon -> Local Services -> Transfer -> Advanced to obex_thunar.sh %d.

GNOME Bluetooth

GNOME Bluetooth is a fork of the old bluez-gnome and is focused on integration with the GNOME desktop environment. GNOME Bluetooth is required by gnome-shell, so you should already have it installed if you are running GNOME 3. Otherwise, it can be installed with the package gnome-bluetooth.

Run bluetooth-applet for a nice Bluetooth applet. You should now be able to setup devices and send files by right-clicking the Bluetooth icon. To make the applet run on login, add it to System -> Preferences -> Startup Applications.

To add a Bluetooth entry to the SendTo menu in Thunar's file properties menu, see instructions here.

BlueDevil

Make sure bluetooth daemon is running, as described above. You should get a Bluetooth icon both in Dolphin and in the system tray, from which you can configure BlueDevil and detect Bluetooth devices by clicking the icon. You can also configure BlueDevil from the KDE System Settings

Fluxbox, Openbox, other WM

Of course you can still use the preceding applications even if GNOME, Xfce or KDE are not your desktop manager. This list should help you figuring out which application does what:

Bluez Utils

The package bluez-utils contains various commands,
which are useful to configure and troubleshoot Bluetooth
from the command line.

hciconfig

Prints name and basic information about all the Bluetooth devices installed in the system.

To activate a device, use:

# hciconfig <device-name> up

hcitool

To scan for remote devices:

$ hcitool scan

Pairing

This article or section is out of date.

Reason: bluez-simple-agent is not part of the current bluez (5.7) but the deprecated bluez4 (Discuss in Talk:Bluetooth#)

Many bluetooth devices require pairing.
The exact procedure depends on the devices involved and their input functionality.

with the current bluez (bluez5)

Start the bluetoothctl interactive command. There you can input help to get a list of available commands.

Enter devices to get the MAC Address of the device with which you want to pair.

Enter pair <MAC Address> to do the pairing.

Finally, use connect <MAC Address> to establish a connection.

with bluez4

The procedure on a mobile may be as follows:

The computer sends a connect request to the mobile.

A pin, determined by the computer, is prompted for at the mobile

The same key must be re-entered at the computer.

To pair with a device without using the gnome-bluez package, the bluez-simple-agent utility that comes with the bluez package can be used. This utility depends on three packages from [extra]:

# pacman -S python2-dbus python2-gobject dbus-glib

First, scan for external devices:

$ hcitool scan

Run the script as root:

# bluez-simple-agent

The message "Agent registered" should be returned, press control-c to quit.

Below is a basic example of pairing with a specific device. The script will ask for the passcode, enter the code and confirm with enter.

# bluez-simple-agent hci0 00:11:22:33:AA:BB

Note: bluez-simple-agent is only needed once for pairing a device, not every time you want to connect.

See the Examples section below for pairing examples with various devices.

Using Obex for sending and receiving files

Another option, rather than using KDE or Gnome Bluetooth packages, is Obexfs which allows you to mount your phone and treat it as part of your filesystem. Note that to use Obexfs, you need a device that provides an Obex FTP service.

Logitech Mouse MX Laser / M555b

To quickly test the connection:

$> hidd --connect XX:XX:XX:XX:XX:XX

For automated reconnection, use your desktop wizard to configure the bluetooth mouse.
If your desktop environment doesn't includes support for this task, see the Bluetooth mouse manual configuration guide.

Motorola V900

After installing blueman and running blueman-applet, click "find me" under connections -> bluetooth in motorla device. In blueman-applet, scan devices, find the motorola, click "add" in blueman-applet. Click "bond" in blueman-applet, enter some pin, enter the same pin in motorola when it asks. In terminal:

then you should consider downgrading to 4.94 (just grab the PKGBUILD/etc from arch and change version to 4.94 and correct the md5sum for bluez) or wait for an update of bluez. Here is a (arch) bug report about it.

passkey-agent

$> passkey-agent --default 1234
Can't register passkey agent
The name org.bluez was not provided by any .service files

You probably started /etc/rc.d/bluetooth before /etc/rc.d/dbus

$> hciconfig dev
# (no listing)

Try running hciconfig hc0 up

Blueman

If blueman-applet fails to start, try removing the entire /var/lib/bluetooth directory and restarting the machine (or just the hal, dbus, and bluetooth services).

# rm -rf /var/lib/bluetooth
# reboot

If you see a notification saying Incoming file over Bluetooth then this means that the device isn't marked as trusted. Mark it as trusted and try again (looking at the code, it looks like some buttons should be displayed in the notification, but I don't see them).

gnome-bluetooth

If you see this when trying to enable receiving files in bluetooth-properties:

Bluetooth USB Dongle

If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by inspecting /var/log/messages.log when plugging in the USB dongle (or running journalctl -f with systemd). It should look something like the following (look out for hci):

it could be due either to the rfkill utility, in which case it should be resolved with

# rfkill unblock all

or, it could simply be the hardware switch of the computer. The hardware bluetooth switch (at least sometimes) controls access to USB bluetooth dongles also. Flip/press this switch and try bringing the device up again.

To verify that the device was detected you can use hcitool which is part of the bluez-utils. You can get a list of available devices and their identifiers and their MAC address by issuing:

$ hcitool dev
Devices:
hci0 00:1B:DC:0F:DB:40

More detailed informations about the device can be retrieved by using hciconfig.

Logitech Bluetooth USB Dongle

There are Logitech dongles (ex. Logitech MX5000) that can work in two modes Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that your using a normal USB mouse/keyoard.

If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. Discussion

hcitool scan: Device not found

On some Dell laptops (e.g. Studio 15) you have to switch the Bluetooth mode from HID to HCI using

# hid2hci

Note: hid2hci is no longer in the $PATH, it is under /lib/udev/hid2hci, but udev should run it automatically for you.

If the device won't show up and you have a Windows operating system on your machine, try booting it and enable the bluetooth adapter from windows.

Nautilus cannot browse files

Bluetooth is disabled when starting GNOME

If you have dbus and bluetooth backgrounded (@) in your DAEMONS array in /etc/rc.conf, it might happen that bluetooth will be disabled when starting up GNOME. To solve this, make sure dbus is not backgrounded.

Sennheiser MM400 Headset connection problems

If your Sennheiser MM400 Headset immediately disconnects after connecting as Headset Service with Blueman, try to connect it as Audio Sink. Afterwards you can change the headset's Audio Profile to Telephony Duplex with a right click in Blueman.
With this option headset functionality will be available although the headset was only connected as Audio Sink in first place and no disconnection will happen (tested with bluez 4.96-3, pulseaudio 1.1-1 and blueman 1.23-2).

If after fixing this you still can't get sound, try using blueman (this is the only one that works for me), make sure that notify-osd is installed or it might show you weird error messages like this one: "Stream setup failed"