Bluetooth
From ArchWiki
Contents |
[edit] Bluetooth
[edit] Introduction
This article is about setting up and using Bluetooth with an USB Bluetooth dongle on Arch Linux.
[edit] Installation
First you have to install the bluez-utils utilities for the Linux Bluetooth protocol stack and start all needed daemons.
$> pacman -S bluez-utils
$> /etc/rc.d/bluetooth start
After that you should check if your Bluetooth dongle is recognized. You can do that by inspecting /var/log/messages.log when plugging in the USB dongle. It should look something like the following (look out for hci):
$> tail -f /var/log/messages.log May 2 23:36:40 tatooine usb 4-1: new full speed USB device using uhci_hcd and address 9 May 2 23:36:40 tatooine usb 4-1: configuration #1 chosen from 1 choice May 2 23:36:41 tatooine hcid[8109]: HCI dev 0 registered May 2 23:36:41 tatooine hcid[8109]: HCI dev 0 up May 2 23:36:41 tatooine hcid[8109]: Device hci0 has been added May 2 23:36:41 tatooine hcid[8109]: Starting security manager 0 May 2 23:36:41 tatooine hcid[8109]: Device hci0 has been activated
For a list of supported hardware please refer to the resources section on this page.
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.
$> hciconfig -a hci0
hci0: Type: USB
BD Address: 00:1B:DC:0F:DB:40 ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:1226 acl:0 sco:0 events:27 errors:0
TX bytes:351 acl:0 sco:0 commands:26 errors:0
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'BlueZ (0)'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c
Manufacturer: Cambridge Silicon Radio (10)
[edit] Configuration
The bluez-utils configuration files are located in /etc/bluetooth.
$> ls -1 /etc/bluetooth audio.conf hcid.conf network.conf frcomm.conf
The default configuration file of the hcid daemon should fit most purposes. However, you probably have to change the passkey option to the one of your phone (most mobile phones use either 1234 or 0000).
# HCId options
options {
...
# Default PIN code for incoming connections
passkey "0000";
}
For some mobile phones you maybe also have to change the device class in the device section (I haven't found a comprehensive list of device classes yet, in my case the default setting worked).
# Default settings for HCI devices
device {
...
# Local device class
class 0x000100;
...
}