Giter VIP home page Giter VIP logo

ltunify's Introduction

Logitech Unifying tool for Linux

See also the article on <https://lekensteyn.nl/logitech-unifying.html>

Logitech documents

I have learned a bit from the kernel source code hid-logitech-dj, but the
"official" Logitech specification (HID++ 1.0) was much more useful. These
documents can be found on <https://lekensteyn.nl/files/logitech/>.


Debuggers
usbmon.awk - initial debugging tool used for tapping usbmon from debugfs
hidraw.c   - successor of usbmon.awk that can parse packets of usb payload.
read-dev-usbmon.c - Reads data from /dev/usbmonX and show interpreted data in a
  more human-readable way.

Note: as a quick-n-dirty hack, I included hidraw.c at some point into the
read-dev-usbmon program. Otherwise, I had no way to show the difference between
a send or receive packet without adding to the same stdout stream. If I included
it in the stderr pipe, then it would be interleaved with stdout in an
unpredictable manner. This means that hidraw.c is currently unusable, it does
not process data correctly.

Usage of USB debugger:
1. Use `lsusb -d 046d:c52b` to determine the bus number. If the output is "Bus
   001 ..", your usb monitor device is at /dev/usbmon1.
2. sudo chgrp $USER /dev/usbmon1
3. sudo chmod g+r /dev/usbmon1
4. ./read-dev-usbmon /dev/usbmon1
5. Profit!


Pairing tool (ltunify)
ltunify allows you to pair new devices, unpair existing devices or view
information for those devices. In order to build the ltunify binary and install
it to `$HOME/bin/ltunify`:

    make ltunify
    make install-home

If you intend to package ltunify or otherwise install it system-wide with a
udevrule, you can use:

    make ltunify
    make install DESTDIR=$pkgdir bindir=/usr/bin udevrulesdir=/lib/udev/rules.d

Once installed, run `ltunify --help` for available options.

Usage of the pairing tool is pretty straight-forward. Example session:

    $ ./ltunify list
    /dev/hidraw0: Permission denied
    Logitech Unifying Receiver device is not accessible.
    Try running this program as root or enable read/write permissions
    for /dev/hidraw0
    $ sudo chgrp $USER /dev/hidraw0 && sudo chmod g+rw /dev/hidraw0 
    $ ./ltunify list
    Devices count: 1
    Connected devices:
    idx=1   Mouse   M525
    $ ./ltunify info 1
    Device index 1
    Mouse
    Name: M525
    Wireless Product ID: 4013
    Serial number: DAFA335E
    Device was unavailable, version information not available.
    $ ./ltunify unpair 1
    Device 0x01 Mouse successfully unpaired
    $ ./ltunify list
    Devices count: 0
    Connected devices:
    $ ./ltunify pair
    Please turn your wireless device off and on to start pairing.
    Found new device, id=0x01 Mouse
    $ ./ltunify list
    Devices count: 1
    Connected devices:
    idx=1   Mouse   M525

TODO
- organize code in multiple files
- simplify code
- HID++ 2.0 debugging (transparent if possible)

~ Peter Wu <[email protected]>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.