Created onsdag 28 december 2016
Installation
# Install the following packages
$ pacman -S bluez bluez-utils bluez-libs
# Modprobe the bluetooth driver
$ modprobe btusb
# Then start the bluetooth service whenever needed
$ systemctl start bluetooth.service
Usage
# Open the bluetooth interactive shell
$ bluetoothctl
# You can always run help in this shell, to list all commands^
# Power on the controller (off by default)
$ power on
# If the device is NOT already on your list, begin a scan
$ scan on
# To get a list of all your registered devices
$ devices
# Once you've found your device, pair it (You can <tab> complete)
$ pair <MAC_ADDRESS>
# If using a device without a PIN, trust the device to be able to reconnect
$ trust <MAC_ADDRESS>
# Then connect to the device
$ connect <MAC_ADDRESS>
Troubleshoot
# I've encountered quite a few issues with Bluetooth. Here's the fixes I've come about.
Not being able to power on the bluetooth device, or device not found in bluetoothctl
# Failed to set power on: org.bluez.Error.Blocked (bluetoothctl)
# You can check and see, if the device is up/down
$ hciconfig
# And be able to turn the device on with
$ hciconfig hci0 up
# But you might get a 'Can't init device hci0: Operation not possible due to RF-kill (132)'
# This means some software is blocking the device.. Great
# We're be able to check further with rfkill
# rfkill is a package that can manage wireless devices
$ pacman -S rfkill
# Running rfkill might give you an output like this
Hard blocked: no
# Unblock it
# Note the index no. above, in this example it's 0 (zero)
$ rfkill unblock 0