Tag Archives: linux connect multiple devices via bluetooth

Linux bluetooth connection setup from the system’s start

  1. Multichannel keyboard that needed a pin entered (Logitech K480).
  2. JBL Flip Essential 2 bluetooth speaker.

With the keyboard, scan and connect via cli:


From the [bluetooth], turn on power, turn on agent and start scanning for devices.

[bluetooth] power on
[bluetooth] agent on
[bluetooth] scan on

Next, pair your keyboard:

pair <mac_address_of_the_keyboard>

When you get prompted a code type it with the keyboard that you are pairing and press enter with it.

At this point, I got a pairing success message. This pairing process also worked with the Blueman applet. But for some reason it was not permanent with my Logitech K480 keyboard. When pairing was done via cli it was permanent and survived a computer reboot. I suspect this being because the gui never asked for any pin, whereas the cli did.

Finally from the cli, I connected my keyboard with:

connect <mac_address_of_the_keyboard>

In the end the cli process was so stable and nice, that I ended up pairing and connecting all my devices via it. Blueman that I had used previously, got removed.

When pairing and connecting was done, I needed to get my bluetooth devices connecting from the system’s startup(automatically). Here is a bash script together with a systemd file to accomplish that:

sudo nano /opt/bluetooth.sh

Script content example:

Continue reading