HomeTechnologyNewsHow to configure Bluetooth in Linux

How to configure Bluetooth in Linux

- Advertisement -
- Advertisement -
- Advertisement -
- Advertisement -

[ad_1]

Sometimes your Linux distribution doesn’t detect your laptop’s Bluetooth hardware. Or maybe you want to add a USB Bluetooth dongle to a desktop computer. Either way, here’s how to get Bluetooth working.

The Bluetooth Saga

Bluetooth is named after a 10th century Danish king, Harald Bluetooth. He was known as the unifying king. By fostering communication between the many different factions, he consolidated the country under Christianity.

Ericsson released Bluetooth, the short-range wireless communication standard in 1998. The Linux kernel first supported Bluetooth functionality in 2001, with full support in 2005. Today, Bluetooth can be used to connect all kinds of devices. to your computer, including smartphones, headsets, speakers, keyboards, mice, and printers.

Even though Bluetooth is a mature and well-established standard, sometimes the Bluetooth hardware on your laptop is not recognized or detected during the installation of your preferred Linux distribution. That’s not a problem; you can add the software required for Bluetooth capability manually.

If your computer does not have built-in Bluetooth hardware, you will need to use an external USB adapter or dongleand install the necessary Bluetooth software stack. Finding one that other Linux users have commented on and given positive feedback, like the Panda Nano adapter, is a wise move.

The official Bluetooth software package for Linux is BlueZ, created and managed by the BlueZ Project. Blueman is a separate project to provide an interface for BlueZ.

Software Installation

We need to install BlueZ and its associated utilities. We also need to install Blueman, which is packaged separately.

We can install BlueZ on Ubuntu like this (note the asterisk “*“):

sudo apt install bluez*

Installing BlueZ on Ubuntu-1

To install Blueman, use this command:

sudo apt install blueman

Installing Blueman on Ubuntu

On Fedora, you should type:

sudo dnf install bluez bluez-tools

Installing BlueZ on Fedora

Install Blueman like this:

sudo dnf install blueman

Installing Blueman on Fedora

In Manjaro packages are called:

sudo pacman -S bluez bluez-utils

Installing BlueZ on Manjaro

This will install Blueman for you:

sudo pacman -S blueman

Blueman installation in Manjaro

Start the Bluetooth daemon

In order to have Bluetooth available every time you start your computer, we need to enable and start bluetooth.service, the demon that Bluetooth connectivity. We do this with systemctl.

Enabling the service means that it will start with every boot of your computer. Starting the service causes it to run immediately, so you can use Bluetooth without having to restart your computer.

sudo systemctl enable bluetooth.service

Enabling bluetooth service

sudo systemctl start bluetooth.service

Starting the bluetooth service

Status check

We can verify that Bluetooth is working using the rfkill domain. This scary-sounding command allows us to check the health and status of wireless communications, and Bluetooth falls into that category.

Wearing rfkill without any command line parameters it lists the wireless adapters and shows whether they are locked or unlocked.

rfkill

Wireless adapter status listing

We can see that Bluetooth is present, but blocked. We can solve that using rfkill with his unblock option. Of course, you may find that your adapter is unlocked, in which case you don’t need to perform the next step.

rfkill unblock bluetooth

Bluetooth adapter unlock

Now we can check the status one more time.

rfkill

Wireless adapter status listing

The Bluetooth adapter is now unlocked, so we can go ahead and start using Bluetooth.

Using Bluetooth in GNOME

In GNOME, Bluetooth functionality can be accessed from the system menu. When active Bluetooth hardware is detected, a new “Bluetooth” menu item appears.

System menu with extended Bluetooth menu option

Expanding the menu item reveals two options. You can turn Bluetooth on or off, and you can access Bluetooth settings. This opens the normal “Settings” app and takes you to the “Bluetooth” panel.

Bluetooth settings panel with a detected but not paired Bluetooth device listed

So that we would have something to connect to, we set up a Bluetooth headset to broadcast its availability for pairing. Our laptop found the device and listed it as a Bluetooth device near the laptop. It had been detected, but was not paired with the laptop. Its status was reported as “Not Configured”.

Clicking the “Not Configured” text started the connection process. In our case, the communicated and connected devices. Some devices send a code number to the computer, which GNOME displays. If that’s the case, you need to click the “OK” or “Connect” button on the notification that displays the code.

Bluetooth settings panel with a detected and paired Bluetooth device listed

In our case, there were a couple of beeps and the device was connected. Updated your status in the “Settings” app. Clicking anywhere on the gray shaded bar around the Bluetooth device opens an options window.

Bluetooth device options window

This gives you some information about the connected device. There is a slider button that allows you to turn the connection on or off, and a “Remove device” button that will remove the device from the Bluetooth settings entirely. Your computer will forget everything about the device. You will need to reconnect if you want to use it in the future.

If there are more settings available for your device, depending on the category of the device and the functionality that the device manufacturers have made available through its Bluetooth interface, there will be a button that allows you to access them.

Since our device was a headset, the setting controls the audio output of the device. Our button was labeled “Sound Settings.” Clicking the “Sound Settings” button opened a dialog with the audio settings.

Audio settings for Bluetooth headsets

Using Blueman

If you don’t use GNOME as your desktop environment, there is likely some integration of Bluetooth functionality in your preferred desktop. If there isn’t, you can use Blueman to manage your Bluetooth connections. Or maybe you manage a collection of Linux computers, with different desktop environments on them. Using Blueman allows you to have a consistent management experience across all of them.

Blueman is short for Bluetooth Manager. Start the Blueman application in GNOME by pressing the “Super” key, usually located between the left “Ctrl” and “Alt” keys, and typing “blue”.

The Blueman icon will appear. Click on it to launch the app. The Blueman app will appear.

The Blueman app with a Bluetooth device detected but not connected

We unplugged our Bluetooth headset and set it to “discoverable.” Clicking the “Search” button on the Blueman toolbar started a search for nearby Bluetooth devices.

Our headset was discovered and listed. Your device will be listed with a name or label telling you what it is. Clicking on its entry in the device list and then on the “Create pairing” key button will start the pairing and connection process.

You can do the same thing by right-clicking on the device list and selecting “Connect” from the context menu.

The option

When the device is connected, a very small key symbol is added to its icon in the Blueman device list, and a set of icons is added to the far right of the device entry, showing the different services the device can use. Bluetooth connection.

A connected device in the Blueman device list

If the device sends a pairing code to your computer, it will be displayed in a notification or small dialog. If this happens, click the button in the dialog labeled “OK”, “Pair”, “Connect” or similar.

Using more than one Bluetooth adapter

It is possible to use more than one Bluetooth adapter at the same time. There is Bluetooth hardware built into the laptop we used to research this article, but we thought we’d add another external USB adapter to see how it handles.

The built-in Bluetooth hardware was identified in the “Adapter” menu by the laptop’s name, “acheron”.

The menu

When the external Bluetooth adapter was plugged into a USB port, it was added to the “Adapter” menu as “acheron #2”.

The menu

This allows you to quickly jump between adapters. You can choose to have some devices connected to the internal Bluetooth adapter and some connected to the external adapter. When you select an adapter from the menu, you will only see the devices that are connected to that adapter.

Connect

Using Bluetooth on Linux is much easier than it used to be. It’s quick and easy to set up and easy to connect to devices. It’s good to connect, as King Harald once said.

RELATED: Solution: Why doesn’t Linux detect my Wi-Fi adapter?

[ad_2]

- Advertisement -
- Advertisement -
Must Read
- Advertisement -
Related News
- Advertisement -