0

How do I pair a bluetooth mouse in Debian 9?

When searching for this, a lot of confusing, often old information comes up. The steps cannot simply be applied to Debian 9. They refer to commands which don't appear to exist in the relevant packages. When this changed, is not clear to me. Furthermore, some information refers to deprecated commands, such as hcitool scan, e.g. in this post: https://askubuntu.com/questions/239189/how-can-i-set-up-a-bluetooth-mouse-without-using-a-mouse

I need simple steps for how to do this in Debian 9, from the command line.

I think this is a good question, because piecing it together from man pages and outdated information, takes longer than it should just to get a simple mouse working.

What packages do I need, exactly, in Debian 9?

What commands do I need to issue, exactly? I simply wish to pair with a bluetooth mouse. Assume the device with the following MAC: aa:bb:cc:dd:ee:ff and (if it matters), is a Logitech MX Anywhere 2S.

2 Answers 2

2

Pairing now works easily enough using the UI but making it work was trickier:

modprobe uhid

If that works then add uhid to /etc/modules

1

This is on Debian 10, but I think it worked exactly the same on Debian 9...

Make sure that the bluez and bluez-tools packages are installed and that bluetoothd process is running (systemctl status bluetooth).

Hold down the "Connect" button on the mouse until the bluetooth status LED on the mouse starts to blink rapidly, to make the mouse pairable.

Run bt-adapter -d to discover devices in range. For each discovered device, a series of lines identifying the device's name, alias, address, icon type, etc. will be displayed. Find the block of lines referring to the mouse to confirm it is discoverable for pairing. When done, press Ctrl-C to stop the discovery. (The mouse seems to be a Bluetooth Low Energy device, so this step will verify that the system's Bluetooth receiver can communicate with it.)

Then run bt-device -c aa:bb:cc:dd:ee:ff to start the connection attempt and automatically attempt to pair the device since it isn't already paired. It may prompt for a pairing PIN (for devices like mice, usually 0000) or just confirm that you want to pair with the device.

Later, if the mouse won't connect automatically, you can use this same command to establish a connection to it. If the pairing already exists, it should not prompt you for anything.

Finally, run bt-device --set aa:bb:cc:dd:ee:ff Trusted true to allow it to connect automatically from now on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .