Skip to content

A Python module that encapsulates access to a Griffin PowerMate USB knob (read & write, poll & block modes).

License

Notifications You must be signed in to change notification settings

doom-fr/pypowermate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pypowermate

This module encapsulates access to the Griffin USB PowerMate "knob" device 1. The PowerMate is an "assignable controller" in the shape of a knob. The knob can be rotated, pressed and also features a LED at its base that can be used to indicate events to the operator.

This module provides functions to read knob events (rotate/press) and to write/set the LED brightness and pulse speed (when in "pulse"-mode).

The module interfaces with the device through the powermate Linux kernel driver and will therefore only work on Linux systems.

Getting started

For python3, just use python3/pip3 instead of python/pip2 in all command.

  1. Install using pip:
    $ cd pypowermate-master
    $ sudo pip2 install .
    
  2. Ensure "powermate" kernel module is loaded in your system. It ships with most modern Linux distros and should insmod automatically when you plug in the PowerMate.
    $ lsmod | grep powermate
    
  3. Ensure your user can read/write the powermate input device. On Ubuntu, this means adding yourself to the "input" usergroup.
    $ sudo groupadd input
    $ sudo usermod -a -G input "$USER"
    $ echo 'KERNEL=="event*", NAME="input/%k", MODE="660", GROUP="input"' | sudo tee -a /etc/udev/rules.d/99-input.rules
    

then reboot

  1. Testrun the example script.
    $ python examples/pulse_and_brightness.py
    

Depending on the exact model, you will have to change MinSpeed and MaxSpeed values.

API

See the documentation in pypowermate/powermate.py for details on how to use the module from your own code.

License

This module is licensed under GNU Lesser General Public License (LGPL v3). See LICENSE.txt for details.

About

A Python module that encapsulates access to a Griffin PowerMate USB knob (read & write, poll & block modes).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%