How to autostart & connect to bluetooth keyboard before login (right after boot)

Hello,

I have just setup Zorin 16 on my desktop and used this guide to install drivers for my wireless & BT dongle (RTL8812bu).

Although the driver has solved my issue of wireless & Bt connectivity, there's one thing I am having trouble with. I use a Bluetooth keyboard (it does not have USB link to plug in & connects via BT) which is multi device & auto connect capable. It is the same keyboard to connect to my work laptop(windows) & personal PC (Zorin). Upon successful, when I have to key -in the password, Zorin does not detect & connect to keyboard. However, after login using a spare wired keyboard, it connects to the BT keyboard fine.

I want the connection to be working before login so I can enter the password using the same keyboard as I use for other PC. There is a device selection button my keyboard and that is selected to the matching device when I want to switch. The auto connect works in windows (even with this wireless & BT dongle) and not on Zorin. Can some one be kind enough to help me solve this issue ? i think it is got to do with how bluetooth starts only after I login or something.

Be interested in seeing any answers to your post ..... I have a Bluetooth keyboard and I have to use my laptop keyboard to log in to Zorin .... once my desktop shows up I can then go to Bluetooth settings in System Settings and click on the Blueman icon and hit connect .....

To make it simpler I put the Blueman icon on my task bar and all I do is open it and hit connect .... my Bluetooth keyboard has a code that must be used each time you connect it to a device ..... as you can connect up to 3 different devices to the keyboard if you keep the same code for the same device .... in my case my Asus laptop ..... you only have to hit connect ....

It may be tricky to solve, depending on when the module can initialize.
We can try.

Ensure that in /etc/bluetooth/main.conf you are set to [Policy] AutoEnable = true

sudo nano /etc/bluetooth/main.conf

It should look just like

[Policy]
AutoEnable = true

The bluetooth will not autostart after reboot, only after Startup (login) if in your startup apps.
Setting autoenable to "true" should enable it after every reboot, as soon as the module loads.

1 Like

Hummmm ..... I get this .....

[General]

Default adaper name

Defaults to 'BlueZ X.YZ'

#Name = BlueZ

Default device class. Only the major and minor device class bits are

considered. Defaults to '0x000000'.

#Class = 0x000100

How long to stay in discoverable mode before going back to non-discoverable

The value is in seconds. Default is 180, i.e. 3 minutes.

0 = disable timer, i.e. stay discoverable forever

#DiscoverableTimeout = 0

How long to stay in pairable mode before going back to non-discoverable

The value is in seconds. Default is 0.

0 = disable timer, i.e. stay pairable forever

#PairableTimeout = 0

Automatic connection for bonded devices driven by platform/user events.

If a platform plugin uses this mechanism, automatic connections will be

enabled during the interval defined below. Initially, this feature

intends to be used to establish connections to ATT channels. Default is 60.

#AutoConnectTimeout = 60

Use vendor id source (assigner), vendor, product and version information for

DID profile support. The values are separated by ":" and assigner, VID, PID

and version.

Am I suppose to type type the [Policy] AutoEnable = true .... at the end of the dialogue ?????

Hmmm I just cat /etc/bluetooth/main.conf to check my own (To make it easier to see what to point at).
It already is set on mine (all the way at the bottom):


[Policy]

# The ReconnectUUIDs defines the set of remote services that should try
# to be reconnected to in case of a link loss (link supervision
# timeout). The policy plugin should contain a sane set of values by
# default, but this list can be overridden here. By setting the list to
# empty the reconnection feature gets disabled.
#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb

# ReconnectAttempts define the number of attempts to reconnect after a link
# lost. Setting the value to 0 disables reconnecting feature.
#ReconnectAttempts=7

# ReconnectIntervals define the set of intervals in seconds to use in between
# attempts.
# If the number of attempts defined in ReconnectAttempts is bigger than the
# set of intervals the last interval is repeated until the last attempt.
#ReconnectIntervals=1, 2, 4, 8, 16, 32, 64

# AutoEnable defines option to enable all controllers when they are found.
# This includes adapters present on start as well as adapters that are plugged
# in later on. Defaults to 'false'.
AutoEnable=true
1 Like

I found it I just didn't scroll far enough .....

[Policy]

The ReconnectUUIDs defines the set of remote services that should try

to be reconnected to in case of a link loss (link supervision

timeout). The policy plugin should contain a sane set of values by

default, but this list can be overridden here. By setting the list to

empty the reconnection feature gets disabled.

#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9>

ReconnectAttempts define the number of attempts to reconnect after a link

lost. Setting the value to 0 disables reconnecting feature.

#ReconnectAttempts=7

ReconnectIntervals define the set of intervals in seconds to use in between

attempts.

If the number of attempts defined in ReconnectAttempts is bigger than the

set of intervals the last interval is repeated until the last attempt.

#ReconnectIntervals=1, 2, 4, 8, 16, 32, 64

AutoEnable defines option to enable all controllers when they are found.

This includes adapters present on start as well as adapters that are plugged

in later on. Defaults to 'false'.

AutoEnable=true

Well, you and I both show it as enabled by default in Zorin OS

This likely is not our solution.

1 Like

Some bios have the setting listed in advanced, though few. Bluetooth should be enabled by the login screen to use for login... the majority of machines with this configuration are embedded machines, not standard laptops.

You could attempt to force the connection by disconnecting the keyboard, since the machine requires a keyboard to run.

Possibly a grub entry? I'm sorry I don't have time right now to search it further... educated guesses for direction are the best I can do at the moment.

1 Like

I have verified main.conf in /etc/bluetooth/ .
AutoEnable = true
I guess this will enable bluetooth upon successful login. I did verify that BIOS do have option to enable bluetooth & wireless (these were already checked, but probably apply to internal devices). In my case, the BT and WiFi are from USB dongle.

However I see that Wireless is connected even before login but not bluetooth.

1 Like

True ..... on mine the WiFi dongle and mouse both connect on log-in but Bluetooth doesn't .... my BT keyboard requires a code to be typed in like 784501 to activate .... once activated it will allow me to connect but not at login only when my desktop is functional and only after I activate Connect on Blueman ....

If I use it on a different device .... like going back to Win10 .... it will require me to again enter a code but it will be different than the previous one on Zorin ..... when I return back to Zorin it will use the same old code but require me to Connect to Blueman again on DE ....

Oh well just the nature of the beast I guess ....

I had bluetooth mouse and keyboard on Zorin OS 15 and on 16. I switched to wired because I uh... got tired of recharging batteries.

And they both always worked for Login.
This is aggravating seeing you both not have it working. It always worked straight away for me, so I never had to troubleshoot it and therefor, never learned how to fix it.
What this does mean though is that we know already that the system can have BT up and running by the time you reach the login screen.
I will keep looking into this.

1 Like

When I first started using Zorin Pro it worked just fine but somewhere down the line it jumped ship .....

As to batteries .... this Logitech is good for more than a year ..... I have only replaced the 2 AAA batteries once in the 2 years I've been using it .... and I use it hard .... 10-12 hrs per day and use it for light gaming like Fishing Planet and Stardew Valley .... for Encase I use my gaming USB keyboard .... it has been a beast and will buy another if this on ever craps out .... :+1:

I believe your keyboard is not of the autoconnect/pair type.

Mine is a true multi device keyboard. I can switch between 4 devices using a fn button (they are all supposed to be paired once to begin with). It is much like phone autoconnects to car bluetooth every time once it is paired. This system works alright with android & windows. It just would not autoconnect on Zorin 16 pro for some reason.

My WiFi and Bluetooth are from the same USB dongle (RTL8812bu). Since WiFi is up, i thought bluetooth should be up as well. but the bluetooth option is also greyed out on the login screen which is why I think it is something to do with the OS preventing BT to be on & connect before login. In fact it would not auto connect even after login.

While I try to figure out the bluetooth autoconnect issue, I have ordered another multi device keyboard which has 2.4G wireless via USB & BT for two additional devices. Will update here on how it plays with zorin.