I just went through this rigmarole, and I'm happy to say that I'm typing this answer on my Surface Ergonomic Keyboard (albeit on Ubuntu 19.04).
The cause of the problem in my case was that the Bluetooth firmware on my machine was not up to date. Once I updated the firmware, bluetoothctl
prompted me with a pin code, when entered on my keyboard paired successfully.
A few things you could try:
Determine if the firmware is loading correctly. From a terminal type
dmesg | grep -i blue
. If you see any errors indicating that firmware was not loading, then you should determine the manufacturer of your bluetooth chip, and from there figure out how update it to the latest version.
If that doesn't help you, then you may want to start the bluetooth daemon in debug mode and look at the logs, to see if it helps you out. To do this, modify the following file: /lib/systemd/system/bluetooth.service
. Find this line:
ExecStart=/usr/lib/bluetooth/bluetoothd
and configure it to log debug info by appending -d:
ExecStart=/usr/lib/bluetooth/bluetoothd -d
Restart the bluetooth service, and you'll find debug info in syslog. This may or may not help you out, but it should at least help you narrow down the problem in your case. Good luck! While I found this problem really frustrating, it makes typing on my keyboard a lot more satisfying!
I'm pretty sure this solution would have worked on 18.04. The only reason I'm on 19.04 is because I upgraded in an attempt to get this keyboard to work!