Scan for nearby devices

Before connecting to any device, we need to scan for all nearby available devices using the command below.
scan on command will actively scan all discoverable Bluetooth devices around the user.

[bluetooth]# scan on

The output will be similar to the image below

 

Connecting To Bluetooth Devices Via CLI

The Bluetooth wireless technology is a worldwide specification for a small-form-factor, low-cost radio solution that provides links between mobile computers, mobile phones, and other portable handheld devices. You’ll find Bluetooth connectivity in smartphones, smartwatches, wireless earphones, etc. 
In this article, we’ll be learning how to connect to a Bluetooth Device via CLI on Linux. 

Similar Reads

What Is BlueZ?

BlueZ is the official Bluetooth protocol stack for Linux distributed under GNU General Public License (GPL) that provides support for the core Bluetooth layers and protocols. It is flexible, efficient, and uses a modular implementation. It has many interesting features:...

BlueZ Installation

Depending on your distro type, run one of the below commands to install BlueZ and other related tools....

Adding User to Required Group

By default, the Bluetooth daemon will only give out Bluetooth devices to users that are a member of the lp group. We need to make sure to add our current user to the lp group to connect to a Bluetooth tether....

Enabling Bluetooth Service

To enable any service at start-up, we execute the systemctl enable command....

Triggering the utility tool

We will be using a utility tool called bluetoothctl that allows various tasks like pairing and connecting a Bluetooth device. To start this utility, just type bluetoothctl in CLI....

Scan for nearby devices

Before connecting to any device, we need to scan for all nearby available devices using the command below.scan on command will actively scan all discoverable Bluetooth devices around the user....

Pairing a device

In order to form a connection, a Bluetooth device needs to be paired with another Bluetooth device. Enter pair [ID] where [ID]  is the unique Bluetooth device identifier shown in the above command....

Contact Us