Bluetooth Keyboard in Linux

puci2020

New Member
Joined
Apr 10, 2021
Messages
8
Reaction score
1
Credits
58
I bought Microsoft Bluetooth Keyboard and with Windows 10 works perfectly. But I installed Linux Ubuntu 18.04 and 20.04 because I want learn this system. So, in technical specification this Keyboard works only with Windows and MacOS. But i was try connect this device in Ubuntu and works. The issue is that when I write something suddenly keyboard disconnects with system and I have to clicks in any button few times until the device connect again. For new connection I have to wait 5-10 seconds and it is annoying.

So, maybe someone has this same problem with similar devices and with Linux and exist any solution?
 


You can run 'cat /etc/bluetooth/input.conf' to check if there's a timeout enabled.
 
Thanks for fast answer! I checked it and idle timeout value was 30 and i changed it to 0. Now I am waiting for results :D
 
Unfortunately your solution doesn't work :( The issue is that Keyboard is parring with notebook and still connected.When I am writing something it works but suddenly device disconnect or it looks like reset of bluetooth or something, I don't know :( With Windows 10 works perfectly.
 
When you changed it, did you remove the # sign at the start of the line? Did it have a # sign at the start of the line?
 
Of course I removed the # sign so in this file I think everything is correctly. Additionally i was try enabled HID mode but this didn't help
 
Well, I've gotta ask. I suppose you also remembered to restart the bluetooth service?

The only other place I can think of to check is /etc/bluetooth/main.conf where there is a pairable timeout.

Hopefully someone else will come along with more options for you to try.
 
Yes, I restarted the bluetooth. In main.conf file I find the pairable timeout but is set default to 0.

Maybe not without reason The Microsoft written that this keyboard works only on Windows and MacOS.

But thank you for try to help :D
 
Some more digging says you can also look one last place. It'll vary based on your hardware.

/var/lib/bluetooth/{BT MAC]/{keyboard MAC}/info

It should contain info like:

Code:
[ConnectionParameters]
MinInterval=6
MaxInterval=9
Latency=44
Timeout=216

After that, I'm plum out of ideas!
 
I have this file and it looks that:

Code:
[General]
Name=Microsoft Bluetooth Keyboard
Appearance=0x03c1
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
Services=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;

[SlaveLongTermKey]
Key=1D17D2E9F4F3897751B9DC5D37BAD15B
Authenticated=3
EncSize=16
EDiv=0
Rand=0

[DeviceID]
Source=2
Vendor=1118
Product=2096
Version=276

[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=66
Timeout=300
 
That timeout may be in seconds. So, 300 seconds is five minutes.

Toss a few zeros at the end, save it, restart the bluetooth service, and see if that does the trick?

I also read that setting the PIN to 0000 helped some people with mice/keyboards, but that doesn't make a lot of sense and sounds more coincidental.
 
Hmm... I am completely drained of ideas. I have no idea why that'd return to 300.

Well, you could try changing it and *not* restarting the Bluetooth service - but that just doesn't sound right to me. If you're not doing anything better, you might as well try it.

I'd say don't give up hope - it could EASILY be something I'm overlooking or don't know. Someone else may come along with more ideas - or even have the same device. I've used a ton of Microsoft hardware and never had an issue - but I've used exactly zero Microsoft bluetooth devices.

So, keep an eye on the thread (or your inbox, if you get notifications by email) and let's hope someone else comes along. It's a weekend, during the day, and people here span the globe - so there's still plenty of time for other people to chime in.

Sorry that I could not get it sorted for you.
 
I have same annoying issue :( It disconnect randomly or on screen-lock or keyboard awake...

After every disconnect, It change it's Bluetooth-MAC address so I have to re-pair it with bluez v5.60

#bluetoothctl devices
Device E7:5B:CE:75:3F:97 Surface Keyboard
Device E7:5B:CE:72:3F:97 Surface Keyboard
Device E7:5B:CE:73:3F:97 Surface Keyboard

What is happening?
 
now you may think this sounds silly.. but it could be that your getting interference from another close by bluetooth perifial [blue tooth speakers, headphones/mobile phone etc]
 
now you may think this sounds silly.. but it could be that your getting interference from another close by bluetooth perifial [blue tooth speakers, headphones/mobile phone etc]
No! I don't have any other bluetooth device(s) around my ArchLinux.
 
I have a temperory idea: as I know, if the sleep time of keyboard is long (several minutes) the disconnection issue happen. so can some one write a shell script to watch the keyboard connection state and as soon as disccoent, force to reconnect it with MAC address?!
 

Members online


Top