Terminus Logo

Question ? Dual Pairing bluetooth keyboard under Linux and OS-X ?  

 as I do have a mac-mini in tripple boot configuration, I wondered how to get my bluetooth keyboard to work using all operating systems at the same time. For windows, many howto's have been written out there (google). For linux though, emptines is what you get. So - it took me a long time to understand how it works and find a way to get it to work. In fact, the entire trick consists in reading the plist file on the mac-side, and decode it so that the linux side can read it too.

We will first need to find the blued.plist file on the Mac OS-X filesystem you have previously mounted under linux. Get it from
[MountPoint-OS-X-System]/private/var/root/Library/Preferences/blued.plist. Download the attached file plutil.pl into the same directory, and execute it under linux OS.

~# ./plutil.pl blued.plist 
plutil.pl v1.5

Old: blued.plist, from: binary, to: text
Found .plist
TryName: blued.text.plist
TryName: blued.text.plist
BinaryToXML:
Offsets are 1 bytes
Object Refs are 1 bytes
There are 9 objects in the file
The top object is at 0
The Offset Table is at offset 126

Int Lengths = 10
Misc Lengths = 37
String Lengths = 63
Unique Strings = 4
oVal=37755725973e42848271a0bf2743e00d
buf=
N3VXJZc+QoSCcaC/J0PgDQ==
oVal=b8767b7d6422049a32ce75b4ab6c4e33
buf=
uHZ7fWQiBJoyznW0q2xOMw==

In the same directory you will find now a file blued.text.plist. It has all required information we need for further processing.
All you need to do now is to identiy the keyboard.
I did find (code modified):

 (key)58-b0-35-81-28-6e(/key)
                (dict)
                        (key)00-1f-20-05-0a-2c(/key)
                        (data)
                        N3VXJZc+QoSCcaC/J0PgDQ==
                        (/data)
                        (key)00-1f-20-07-38-e4(/key)
                        (data)
                        uHZ7fWQiBJoyznW0q2xOMw==
                        (/data)
                (/dict)


For that, hit the Connect button on the keyboard and make sure it's in discoverable mode.

~$ hcitool scan
Scanning ...
        00:1F:20:05:0A:2C    Logitech MX5500 Keyboard

that's it. Look up the keyboard MAC Address (here 00:1F:20:05:0A:2C) in the bluez.text.plist file, and use the assigned (data) value to convert.
Convert it with:

~# echo -n "N3VXJZc+QoSCcaC/J0PgDQ==" | base64 -d | hexdump -C
00000000  37 75 57 25 97 3e 42 84  82 71 a0 bf 27 43 e0 0d  |7uW%.>B..q..'C..|
00000010

and you're done.
All you have to do now is to put that HEX Value into the linkkeys file. On an ubuntu 11.10 it is /var/lib/bluetooth/58:B0:35:81:28:6E/linkkeys. Just replace the value after the correct identifier:

00:1F:20:07:38:E4 B8767B7D6422049A32CE75B4AB6C4E33 0 4
00:1F:20:05:0A:2C 37755725973E42848271A0BF2743E00D 0 8

you're done.
NOTE that you see it also in the Oval output of the plutil.pl, however you still don't know which device it belongs to.

BTW - in case you need to access the keyboard in a kind of emergency, just putting the keyboard in discoverable mode and hit:

~$ sudo hidd --connect 00:1F:20:05:0A:2C

you can access it without key. 

Entered by smurphy on Friday, 23 December 2011 @ 10:31:24  
Linux on Apple Hardware - Common Linux problems, # Hits: 81450

Attach   plutil.pl  [ 23,196 bytes - application/x-perl ]

This page was issued from the Terminus Website:
https://www.solsys.org

The URL for this page is:
https://www.solsys.org/mod.php?mod=faq&op=view&faq_id=158


  Close