2.5 KiB
BlueZ
BlueZ is an implementation of the Bluetooth standard. This entry features the BlueZ package and all software that is based on it.
Setup
On most Linux distributions BlueZ can be installed with the bluez package.
Additionally, the bluez-utils package needs to be installed.
To load the kernel module modprobe btusb needs to be run.
Afterward, the
service can be
started and enabled by running the following commands.
systemctl start bluetooth.service
systemctl enable bluetooth.service
Usage
This section addresses the usage of Bluez.
Connecting and Pairing of Devices
The Bluetooth features can be managed by different types of front-ends.
bluetoothctlis a command-line interface included in thebluez-utilspackagebluetuithcan be used as a bluetooth manager with a terminal user interface. It is included in a package of the same name, that needs to be installed before usage. Usingbluetuiththe Bluetooth can be turned on (or off) by pressingo, devices can be searched for by pressings, a selected device can be paired by pressingpand finally connected by pressingcbeforebluetuithcan be left withQ.
Troubleshooting
This section will focus on errors and the fixing of errors of Bluez.
bluetuith: no adapter found or bluetoothctl: No default controller available
When this error occurs the adapter is not recognized by the software. This can be confirmed using the following command and looking for the bluetooth adapter.
lsusb
If it is indeed not found it may be blocked by rfkill.
To check this run the following command.
rfkill
This command will display something similar to the following.
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
If the command displays Soft blocked: yes or Hard blocked: yes beneath the Bluetooth device it
has to be unblocked to use it.
For this run the following command where <bluetooth-adapter> is the name of the Bluetooth adapter
(in this case it would be hci0).
rfkill unblock <bluetooth-adapter>
Afterward, the adapter will probably be recognized again but a restart of service
bluetooth.service eventually has to be restarted as described in the
systemd entry.