Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-09-04 23:20:42

yurbev
Member
Registered: 2016-04-18
Posts: 24

Autoconnect Bluetooth Keyboard at Startup

I have a 1byOne bluetooth keyboard. It works fine after Linux MInt 19 logs in, but for the login screen I need to plug in my other keyboard to enter the password.

The most promising directions I've found on how to solve this problem are here, but I haven't been able to get them to work: https://askubuntu.com/questions/17504/h … at-startup

But I was wondering if anybody knows of an easier way to get the computer to recognize the keyboard at startup. I use a Surface Pro 2.

Offline

#2 2018-09-05 00:02:52

alcornoqui
Member
Registered: 2014-07-28
Posts: 295

Re: Autoconnect Bluetooth Keyboard at Startup

Not sure if it translates to Mint 100%, but the Arch wiki has thorough instructions:

Automatically enabling a Bluetooth Keyboard

Remember that you have to pair and trust your device in bluetoothctl to cause autoconnect. Then you can power up your adapter automatically in several ways:

Custom systemd service file:

Create a config file /etc/btkbd.conf

# Config file for btkbd.service
# change when required (e.g. keyboard hardware changes, more hci devices are connected)
BTKBDMAC = ''mac_address_of_your_device''
HCIDEVICE = ''hci_device_identifier''

mac_address_of_your_device can be found with the scan on command of the bluetoothctl utility.

hci_device_identifier can be found with:

# hcitool dev
Devices:
   hci0   06:05:04:03:02:01

We are looking for the identifier hci0 in this case. The MAC address shown here is the address of the controller, not the address of the keyboard itself.

Next, create a new service file at /etc/systemd/system/btkbd.service.

[Unit]
Description=systemd Unit to automatically start a Bluetooth keyboard
Documentation=https://wiki.archlinux.org/index.php/Bluetooth_Keyboard
ConditionPathExists=/etc/btkbd.conf
ConditionPathExists=/usr/local/bin/hcitool
ConditionPathExists=/usr/local/sbin/hciconfig

[Service]
Type=oneshot
EnvironmentFile=/etc/btkbd.conf
ExecStart=
ExecStart=/usr/local/sbin/hciconfig ${HCIDEVICE} up
# ignore errors on connect, spurious problems with bt? so start next command with -
ExecStart=-/usr/local/bin/hcitool cc ${BTKBDMAC}

[Install]
WantedBy=bluetooth.target

And then enable this service with systemd's tools.

Or udev rule:

Create new file /etc/udev/rules.d/10-local.rules

# Set bluetooth power up
ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"

Good luck!

Offline

#3 2018-09-05 01:26:58

yurbev
Member
Registered: 2016-04-18
Posts: 24

Re: Autoconnect Bluetooth Keyboard at Startup

Thanks! I got that working. However, I have two different passwords, one for login and I also have an encrypted drive. So before the login I have an earlier password prompt for unencrypting the drive. The bluetooth keyboard does not work on that prompt, only on the login prompt. It didn't work on either of the password prompts before, so this is an improvement. But I'd like to find a way to get it to work for both. Is that possible?

I even plugged in my bluetooth keyboard at the unencryption prompt, and it still wasn't recognized.

Offline

#4 2018-09-05 10:46:25

alcornoqui
Member
Registered: 2014-07-28
Posts: 295

Re: Autoconnect Bluetooth Keyboard at Startup

Oh, I see. That's discussed here.

Good luck!

Offline

#5 2018-09-10 15:45:12

yurbev
Member
Registered: 2016-04-18
Posts: 24

Re: Autoconnect Bluetooth Keyboard at Startup

I ended up reinstalling. No big deal, as I had a freshly-installed system when I caught this problem.

Offline

Board footer

Powered by FluxBB