Getting a Bluetooth keyboard to connect at start-up

Hi, :slight_smile:

I’ve got a Bluetooth keyboard, which I’ve paired with my Raspberry Pi, following this guild: http://thepihut.com/blogs/raspberry-pi-tutorials/17841464-bluetooth-installing-and-using-bluetooth-on-the-raspberry-pi

I’ve added

sudo hidd -i hci0 --connect 20:73:AB:15:38:E8

to the /etc/rc.local file, and during booting it says

[ok] Starting bluetooth: bluetoothhd rfcoom.

but it also says

[FAIL] startpar: service(s) returned fallure: rc.local … failed!

And the Bluetooth keyboard doesn’t work unless I boot into the GUI and re-connect it.

As you may know, I’m running a script at login: https://dietpi.com/forum/t/resolved-running-a-command-at-login/79/1 - Is that causing the problem?

Is there an easy way to fix this, or should I just use USB?

The error is most likely caused by Sudo. Sudo is not installed by default on DietPi systems, as its not required for root users.

You can resolve the error by either:

  • apt-get install sudo
    or
  • remove sudo from your code in /etc/rc.local

Hopefully that should resolve the issue.

Hi, :slight_smile:

Sorry it’s taken me so long to get back, but I’ve only just been able to try it out.

I had already installed sudo, but I have now tried doing it without the sudo bit, and it didn’t come up with the same error message.

Instead it now says “hidd not found”, so I’m wondering if it’s a fault with the keyboard or dongle? Although it does find it if I boot into the gui.

Anyway, I’m going to use a wired keyboard now, so I’m not to worried.

Thank you for helping.