Unifying Logitech Devices on Linux

I was recently given a Logitech K800 keyboard and a Logitech Performance Mouse MX, both of which are great devices. I picked them because wireless-ness is useful for ergonomic reasons, and they have rechargeable batteries, and you can attach them both to the same USB input, so you have fewer cables lying around.

Naturally, though, when I unboxed them I found out that you can only unify them to the same receiver with Windows-only software. There are a number of other features that are only usable with the Windows-only software, but I figured there would be a hardware sync process. Unfortunately, there's not a Logitech supported one.

There is, however, a community developed one! There's a short C program with a bunch of magic numbers which send commands to the device and cause it to unify with a new device. Unfortunately, the program comes with no directions, so I thought I'd post about how to do it. First, put the program in pairing_tool.c, as suggested in the post. Then, compile it with:

gcc -o pairing_tool pairing_tool.c

To run it, we need to figure out where the Logitech unifying receiver is. The program wants the hidraw device corresponding to the unifying receiver. To find this out, you can look in /sys/class/hidraw/hidraw*/device/uevent. In my case, the device is hidraw2, and the output looks like this:

smitten:~$ cat /sys/class/hidraw/hidraw2/device/uevent 
DRIVER=generic-usb
HID_ID=0003:0000046D:0000C52B
HID_NAME=Logitech USB Receiver
HID_PHYS=usb-0000:00:1a.0-1.4/input2
HID_UNIQ=
MODALIAS=hid:b0003v0000046Dp0000C52B

So, we can now unify the devices with the following command:

sudo ./pairing_tool /dev/hidraw2

And then power on your device as the tool tells you to. I think there's some timeout on this, because the first time I did it I waited a few minutes and then powered on the device, and it didn't work. So, have your device ready and do it seconds after you run the pairing tool, and it should all work fine. HTH!

demon @ 2012-01-31 22:41:37:

@ding: Looks like the patch at the start of the thread has to do with allowing individual keyboards and mice attached via a Unifying receiver to appear to the kernel as separate HID devices. Looks like this utility should work without it, just multiple devices' events would show up via the same mouse/keyboard device node. (I wanted to get a Performance MX mouse, but I was hoping to get the Bluetooth version; looks like that isn't gonna happen, but this means that I can at least use the "Unifying" receiver as intended.)

Tehas @ 2012-01-28 02:18:29:

I didn't have luck looking through the uevent files. Instead, I went through the output from 'dmesg'. I plugged in the USB receiver and then ran dmesg | less. The last set of messages in the output indicated that I needed to use /dev/hidraw2. Thanks for documenting this.

Pavel @ 2012-01-25 20:06:07:

Thanks man. Really helped me out. In my case I was not able to find hiddraw device so I run the tool on all of them. Last one worked.

Pavel @ 2012-01-25 20:04:12:

Thanks man. Really helped me out. In my case I was not able to find hiddraw device so I run the tool on all of them. Last one worked.

tycho @ 2012-01-12 21:48:31:

Nope, it doesn't (at least, not on my xubuntu kernel); I'd say the patch was already accepted. Just run the pairing tool and you're good to go.

ding @ 2011-12-30 10:06:42:

That's cool! So, this doesn't require any kernel patches for the extra mouse buttons? The mailing list thread you've linked to contains kernel patches in the first thread.