Set up the Varmilo VB87M Bluetooth 4 Keyboard in Ubuntu (and break Bluetooth for everything else)

The Varmilo VB87M is Bluetooth Low Energy (BLE) keyboard. It is based on the old familiar nRF51822. My version features Gateron blue keyswitches, which I prefer to the genuine Cherry article.

I want to connect it to Ubuntu, but found no instructions for doing so. Here’s how I did it.

On and Off

The included instructions are in Chinese, so it’s not clear how to turn on and off the keyboard. A Massdrop forum post helps out:



To turn on, press “Fn” and “Insert” together

To turn off, press “Insert” and hold for several seconds

To adjust backlight intensity, use “Fn” and the up / down arrow keys.

Ubuntu

Ubuntu ships an outdated version of Bluez. They’re planning to fix it. (Bluez follows the CADT development model.) The low-energy HID-over-GATT stuff landed in a later version of Bluez than Ubuntu ships.



There is a PPA that contains a newer version of Bluez. Installing this will break the bluetooth integration in Unity. Bluetooth will still work (better than ever) but the little Unity icon and the graphical bluetooth manager will not work anymore.



To install it, try this:

$ sudo add-apt-repository ppa:vidplace7/bluez5

$ sudo apt-get update

$ sudo apt-get install bluez bluetooth

Installation hangs at this point, so I did this to kill the installer and clean up:

$ sudo killall apt-get

$ sudo rm /var/lib/dpkg/lock

$ sudo dpkg –configure -a

Pairing



Now bluetooth is off, so turn it on:

$ sudo hciconfig hci0 up

And the graphical manager is now broken, so use bluetoothctl shell.

(Type the things in blue. The shell has tab completion for device addresses.)

Now the keyboard is working and paired.