How to Set Up Bluetooth in Linux
How to Set Up Bluetooth in Linux
Adding Bluetooth consists of four steps:- enabling general Bluetooth support
- pairing the Bluetooth device with the computer
- configuring the computer to use the Bluetooth device
- automating the re-connection to the Bluetooth device when you login.
Getting Started
Install the required packages on your computer
If you’re on Ubuntu or an Ubuntu-based distro, run the following command:sudo apt install bluetooth bluez bluez-tools rfkill
- the bluez package provides the Bluetooth protocol stack.
- the bluez-utils package provides the bluetoothctl utility.
- The generic Bluetooth driver is the btusb kernel module.
sudo rfkill list 0: phy0: Wireless LAN Soft blocked: no Hard blocked: no 2: dell-bluetooth: Bluetooth Soft blocked: yes Hard blocked: noMy laptop showed there is a "Soft blocked".
I turned on "Settings->Bluetooth", then get the following:
0: phy0: Wireless LAN Soft blocked: no Hard blocked: no 2: dell-bluetooth: Bluetooth Soft blocked: no Hard blocked: no 3: hci0: Bluetooth Soft blocked: no Hard blocked: noYou can also unblock it using:
sudo rfkill unblock bluetoothFinally, make sure the Bluetooth service is active by running the following command,
systemctl status bluetoothIf it is not, then systemctl start Bluetooth will start it,
sudo service bluetooth start
Front-ends
Console
- bluetoothctl — Pairing a device from the shell is one of the simplest and most reliable options.
Graphical
- GNOME Bluetooth — GNOME's Bluetooth tool.
- Bluedevil — KDE's Bluetooth tool.
- Blueberry — Linux Mint's spin-off of GNOME Bluetooth, which works in all desktop environments.
- Blueman — A full featured Bluetooth manager. Install the blueman package which helps you pair and manage Bluetooth devices.
On Ubuntu use the following:
sudo apt-get install blueman
Scanning then Pairing and Connecting to Devices
Launch the Bluetooth Manager from your applications launcher: By default, your Bluetooth device is hidden. You need to make it visible so that it can be discovered by other devices.Go to “Adaptor -> Preferences” and make sure the setting to “Always visible” or “Temporarily visible,”.
Next, start scanning for Bluetooth devices by clicking “Search” and wait for a few moments for the scan to complete.
All visible and discoverable Bluetooth devices will be listed in the Bluetooth manager.
To pair the speaker with the computer -- in other words, to link them together.
- Right-click the relevant entry on the list and click “Pair.” This will initialise a pairing request which the other device will have to accept.
- Next, enter a PIN code in the dialog box and click OK.
- Finally, go to your device and enter the same PIN to confirm the pairing
Configuring the computer to use the Bluetooth device
Automating the re-connection to the Bluetooth device when you login
Re-connection is a matter of a few clicks, but you can automate with a two line Bash script to send instructions to bluetoothctl:#!/bin/bash #echo -e 'connect SPEAKER-ID' | bluetoothctlSet the script to autostart as you login to your desktop.
Logitech x300 Mobile Wireless Stereo Speaker
Technical Specifications- Bluetooth: A2DP, 30 ft wireless range
- Phone calls: Bluetooth-Hands-Free Profile (HFP1.6)
- Battery: 5-hour
- Dimensions: 5.9″ L x 2.8″ W x 2.7″ H
- Weight: 12.5 oz.
- the battery needed 4 hours to fully charge after being completely depleted
- As the speaker is charging (and powered off) the status light very slowly flashes red until it is completely charged at which time the light shuts off.
- it flashes red when charging
- it flashes blue when not charging and is ready to be paired
留言