I have recently changed OS from Ubuntu to Lubuntu. When I was on Ubuntu, I had a script which automatically connected to a bluetooth device on startup.
The script went like so:
rfkill unblock bluetooth sleep 15 bluetoothctl connect E0:B8:36:20:AA:35
In Lubuntu however, I can’t enable bluetooth from the command line. I’m using Bluetooth Device Wizard in the GUI to see what’s going on.
Initially, the Bluetooth Device Wizard starts with bluetooth disabled.
(I was going to show an image here, but new users can only use one image apparently, so imagine an identical image here to the other one, but instead of ‘Make Pairable’ it says ‘Enable Bluetooth’.
Then, when I run
rfkill unblock bluetooth ,
I am able to enable bluetooth, but the window now shows this:
As you can see, there is a new barrier that didn’t happen on Ubuntu, I have to ‘make pairable’.
Does anyone know how I can do that same as clicking this button but from the command line?
I have tried
bluetoothctl power on, and obviously
rfkill unblock bluetooth and
rfkill unblock all, but none of them allow me to use bluetoothctl commands.
When I try to use bluetoothctl commands like
bluetoothctl pair F2:EB:B7:1E:B5:D7, I it says it’s already paired. But if I try bluetoothctl connect F2:EB:B7:1E:B5:D7, I get
Failed to connect: org.bluez.Error.NotReady.
I want to clarify, my problem is not with connecting. I can connect the device fine. It is paired, trusted and connects perfectly well if I were to manually click the ‘enable bluetooth’ and ‘make pairable’ buttons in the Bluetooth Device Wizard. But I need to be able to do this from the command line without the GUI.
I thought there might be a simple setting in system preferences to enable bluetooth at startup from the GUI, but I couldn’t find it.
Does anyone know how I can do this please?