# How to manually pair with a Bluetooth device?

I am unable to pair a Bluetooth gadget with my Sony Xperia XA2 running SFOS 3.0.2. I will receive the message that the pairing failed due to a failed authentification because SFOS does not give me the option to type in the needed pin/password for the pairing.

Is there a way to pair the device via terminal or by writing a config file?

The bluetooth gadget does support the option to initiate the pairing from itself so I have to initiate it from my SFOS device.

edit retag close delete

Sort by » oldest newest most voted

@peterleinchen Thanks, I just didn't find anywhere the info which package I have to install to get the bluetooth command line tool. :)

So I was able to manually pair to the Bluetooth device the following way:

devel-su
pkcon install bluez5-tools

# First activate Bluetooth in the device settings/menu and then execute:

bluetoothctl

# Activate the authentication agent to handle the PIN entry (requires root to work)
agent on

# List all available devices
scan on

# Disable the scan again
scan off

# Display the information about a device
info 00:00:00:00:00:00

# Pair with the device (wait until you can type in the pin)
pair 00:00:00:00:00:00

# Trust the device for automatic connection
trust 00:00:00:00:00:00

# Try to connect to the device
connect 00:00:00:00:00:00

# Exit the bluetooth console
exit

more

Funny, ran against the exact same problem this morning while setting up my Xa2: neither bluetoothctl nor hciconfig are installed by default anymore.

(BTW, as a reference: my post about manual parigin also using hciconfig. I've also updated with explanations how to install missing packages)

To find which package contains what, some distribution include tools to search for missing commands (e.g.: cnf from package command-not-found in openSUSE).

In Sailfish, there is a (not install by default either) package called PackageKit-command-not-found. You can then /usr/libexec/pk-command-not-found{missing command} and it will suggest packages to install.

( 2019-03-29 14:52:16 +0300 )edit

Hello, this happens this some bluethooth devices. Just use the bluethoothctl command line program that will ask for your pin.

more

The receiving device must have the option to start a connection, otherwise you will not be able to establish the connection. First, I would try to find the intructions of the reciving device to identify how to start tge pairing process. I had the same error message as you on a soundlink mini. However, in my case I had already set the receiving device to start the pairing process. The way I succeded was to make my xa2 discoverable and tried a couple of additionnal attempts. Despite the error message I successfully paired the two devices. I hope this helps. Good luck!

more

Did you not find any of the already existing Bluetooth pairing related questions during creation lf this one?

I would start reading here https://together.jolla.com/question/200340/unable-to-pair-with-bluetooth-headphones-authenticationpasscode-error/ and continue with the provided link. Maybe you need to install package bluez5-tools manually (I had to).

more