Sane bluetooth keyboard setup for lightweight Linux desktop?
2014-07
I have a pretty light Debian unstable setup, just xdm and a window manager, no fancy desktop environments or Ubuntu-whatever that a lot of guides seem geared towards.
I'm trying to switch to a bluetooth keyboard. I have it so that when I run this it works:
$ hidd --connect <address>
The first issue is I can't really type this when the system boots and xdm
starts. (Sure I could solve that with an init script, but the next issue comes into play...) The other issue is that if I lose pairing (say the thing goes into power-saving mode), I need to re-run the above command.
How do I get it so that it pairs and re-pairs without any intervention? On Windows with the same hardware I can pull out the keyboard randomly, type a key to wake it up, and it just pairs. Then it goes to sleep, no big deal, it comes back on and is paired. What do I need to get this behavior on Linux? A lot of stuff steers towards bluez-simple-agent
but even when I get that working it still needs manual setup and running hidd
.
Well that was weird. Looking into what people said about hidd
online, I tried using the -i
option, I found that one of the daemons started by /etc/init.d/bluetooth
was hogging the socket that hidd --server
might have otherwise used. Specifically I got:
# hidd -i hci0 --server
Can't listen on HID control channel: Address already in use
So strangely the following in /etc/rc.local
does mostly what I wanted so far:
/etc/init.d/bluetooth stop
hidd -i hci0 --server
Kind of a crazy hack and I might prefer some other solution...
Does the Apple keyboard require 8 digits to pair, or could i pair with, say, 4 digits, as the usual cell phones and other Bluetooth device ?
It really depends on the BT software on the desktop. For example, when I pair my Windows machine with my Apple BT alu-keyboard, it requires 6 characters, not 8.
I've heard of people pairing it with BT Nokia cellphones, WM devices, etc - so it should not be a problem or a limitation set by Apple AFAIK.
If pairing with a Mac OS X system, yeah, it's 8 digits.
It has been found that the Apple keyboard can work with different number of digits. The issue is that until an Apple keyboard is somehow initialized by a MAC and given an identity, it cannot remain connected under linux. I do not know whether this a Linux Issue, or this is an unnamed keyboard issue, but since the keyboard was given a name under MacOSX, it connects fine under Windows and Linux.