1

I am running Ubuntu 14.04, and I want to run multiple griffin powermate knobs: https://store.griffintechnology.com/powermate. I want to map them to different keys other than audio control. I want to use four of them (perhaps more) to control robot joint positions. We are going to be using ROS to capture the commands and relay them to the robot.

I got the first one up and running using a modified version of these commands: https://askubuntu.com/questions/138148/need-help-with-griffin-powermate-usb-volume-controller-new-64-bit-desktop-ub

But I can't use multiple controllers. I tried modifying the udev rules to account for the KERNEL=x.x value since that's the only value that changes between the knobs, and then changing the .evrouterrc file to /dev/input/event* instead of "Griffin Technology Powermate" but that did not allow both of them to be used.

I also tried adding two users (powermate, powermate2) and replicated the steps for both of the controllers (evrouterrc, evrouterrc2), but evrouter did not allow to instances to be run.

I'm confused about what steps to take now. Is it possible to use the udev rules and evrouter to account for multiple instances of identical devices and assign different functions to them? Or do I need to find a different way? Or do you know of any linux compatible full turn knobs that we could use instead?

  • Before you mess with udev rules -- what is the output of evtest? Are all your powermates recognized? If so, you may read from them directly by writing a short C program that dumps their output. – Rom1 Nov 23 '16 at 19:22
0

You can script the controls of each USB device by scanning the events reported.

How can I run a shell script on input device event

Just build a script for each of your devices and run in the background. You can also poll the event stream in the programming language of your choice. The idea of how to handle the input stream is in the linked article.

If you need to specify a device by what port it's plugged into, please try using the /dev/by-path or /dev/by-id, and if you want to make it configurable, you can iterate over all the inputs and cat out the name: cat /proc/bus/input/devices

I am copying and pasting for posterity:

#!/bin/bash

device='/dev/input/by-id/usb-Targus_Laser_Presentation_Remote-if02-event-kbd'
event_blank='*code 48 (KEY_B), value 1*'
event_esc='*code 1 (KEY_ESC), value 1*'
event_f5='*code 63 (KEY_F5), value 1*'
event_prev='*code 104 (KEY_PAGEUP), value 1*'
event_next='*code 109 (KEY_PAGEDOWN), value 1*'

evtest "$device" | while read line; do
  case $line in
    ($event_blank) echo "BLANK SCREEN" ;;
    ($event_f5)    echo "F5" ;;
    ($event_esc)   echo "ESCAPE" ;;
    ($event_prev)  echo "PREVIOUS" ;;
    ($event_next)  echo "NEXT" ;;
  esac
done

Using evtest I was able to find out the event number /dev/input/event18 for the device, but this number may vary depending on the devices on your system and in which order they were connected

Because of that I used udevadm info /dev/input/event18 to find out the device's unique id

S: input/by-id/usb-Targus_Laser_Presentation_Remote-if02-event-kbd

Finally, using evtest again I was able to catch all events from device to use them on the case statement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.