Logitech unifying receiver on Ubuntu


So, I happened to umm…  own both the Logitech Performance MX, and the sleek Anywhere MX, both supporting Logitech Unifying receivers. Meaning a single usb receiver can be used to connect more multiple Logitech peripherals at once. To do that, Logitech has provided Windows and Mac users with the Logitech Unifying software.

Unifying receiver for Anywhere MX

Linux? Not so much.

Anyway, Benjamin Tissoires posted a program that we can compile and use to connect an existing usb receiver to additional logitech stuff. First, get the script here.

Update 08/17/2012:

It seems that some of you are having trouble compiling the script on 32-bit environment. Actually, despite the warning, the program compiled just fine. I have updated the script so it can be compiled without warning on 32-bit or 64-bit. You can get it here

Put the file in a directory, let say /opt/unify, then compile the program

ikhsan@Mach5-NX:/opt/unify$ sudo gcc -o pairing_tool pairing_tool.c

Next, we need to find out which hidraw device represents the unifying receiver. Unplug and replug the receiver, and type:

ikhsan@Mach5-NX:/opt/unify$ dmesg

You should see messages such as these:

 [18675.906824] generic-usb 0003:046D:C52B.000F: hiddev99,hidraw8: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1d.0-1.6/input2

Unfortunately, it seems that, all of hidraw devices in my box (0 to 8) belong to the receiver, so I ended up trying each of them one by one. To start connecting, do this:

ikhsan@Mach5-NX:/dev$ sudo /opt/unify/pairing /dev/hidrawx

Where x is the number of hidraw device that belong to the receiver, in my case, it’s hidraw2. You should see this message:

The receiver is ready to pair a new device.
Switch your device on to pair it.

Turn on the new device, and it will be ready for use.

Advertisements

18 Comments Add yours

  1. ICDeadPpl says:

    I get this error when I try to compile it (on Mint 13):
    pairing_tool.c:78:25: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘unsigned int’ [-Wformat]

    Would you mind posting the binary?

    1. ikhsan says:

      Sure, this is compiled on Mint 13 X64

  2. tommoravec says:

    I try to compile it on Kubuntu 12.04 32-bit and I get the same error. How can I fix it?

    1. ikhsan says:

      it seems that the script will spew some error if compiled under 32-bit machine. I have updated the script so that it no longer give that particular warning message. I have tested it under mint 11 32-bit, and it compiled just fine. Get the new script here

  3. Henry says:

    Nice one. This works out of the box!

  4. Daniel AJ says:

    It worked great with the keyboard, but the next day it wouldn’t work with the mouse (M705). On hidraw0 and hidraw1 it says “broken pipe” and on hidraw2 I get the “ready to pair” message, but it still won’t work.

    Would you have any suggestions?

    1. ikhsan says:

      Have you tried turning off the mouse and turning it on again? Also you can try to pair it with different dongle

      1. Daniel AJ says:

        I have tried many things. On, off, reboots, etc. No go. I will try with a different receiver and/or on a different computer.

      2. Daniel AJ says:

        After plugging the receiver into a Windows XP system and installing the Logitech software, I figured it out: The receiver’s table fo max. 6 devices was full! (Devices from the former owner, I had no idea.) I deleted them and paired the second mouse on the Windows machine. It now works nicely on my Ubuntu.

        Would anyone know how to pimp the script so that it returns a message if the receiver is maxed out?

  5. JAM W says:

    Worked fine !

    I had 2 devices; keyboard + mouse.

    Unplugged the mouse-device, turned if off.. Used the program with hiddraw0 (this was the keyboard receiver-dj). Turned the mouse back on.. everything worked just fine !

    thanx

  6. Name says:

    Work like a charm. Thanks

  7. bill says:

    compiled the program ok under rhel6.2

    have 3 devices that show up in dmesg hidraw0,1 and 2

    get broken pipe error with all 3…tried rebooting with receiver out and plugging back in…same deal….tried a different receiver…same deal

    1. ikhsan says:

      Have you tried with sudo? or perform pairing as root?

      1. bill says:

        ran as root

      2. ikhsan says:

        i’m out of idea 😦

  8. we6jbo says:

    This worked for me. Thanks!

  9. Leonard says:

    Keep getting sudo /opt/unify/pairing_tool /dev/hidraw4
    Error: 32
    write: Broken pipe
    Red Hat Enterprise Linux Workstation release 6.4 (Santiago) Linux 2.6.32-358.11.1.el6.x86_64 x86_64

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s