[howto] Powermate extension on a Raspberry Pi

Thanks to @Steve_Kalkwarf, I was able to easily install the Griffin Powermate extension into my system. The knob is attached to a Pi, and can be set to control volume on a different Pi / Roon Bridge via API requests over the network to the Core. Very cool! Instead of Raspbian / NOOBS, for the OS I am using DietPi, which has a nice, easy package tool for installing Node.js, and which also does not have several prerequisite packages needed to compile the extension. Consequently, the installation process was a slight bit different in detail from the provided instructions. Here’s the steps I followed; hopefully others will find it useful.

# DietPi uses the 'root' account for routine access.  No need for "sudo"
#
# Install the Node.js package via DietPi's installer: 
dietpi-software install 9

# check the version of Node  (I get v9.0.0) 
node -v
 
# Install a number of prerequisite packages via standard raspbian repositories:
apt-get -y install build-essential git python libudev-dev libusb-1.0-0-dev

# install the HID package to Node, to speak to the powermate:
npm install node-hid

# make sure we're still in root's home dir:
cd 

# Pull down the Powermate Extension code:
git clone https://github.com/RoonLabs/roon-extension-powermate.git

# change into the directory:
cd roon-extension-powermate/

# build & install the extension with Node Package Manager:
npm install

# Create the udev config file with a text editor:
pico /etc/udev/rules.d/50-usb-powermate.rules
      SUBSYSTEM=="input", GROUP="input", MODE="0666"
      SUBSYSTEM=="usb", ATTRS{idVendor}=="077d", ATTRS{idProduct}=="0410", MODE:="666", GROUP="plugdev"

# Plug in the Powermate, check that DietPi system sees the raw device:
# expect:  "Bus 001 Device 004: ID 077d:0410 Griffin Technology PowerMate"
lsusb

# reload the udev rules:
udevadm control --reload-rules

# start the Node server, which sends the Powermate events to the Roon Core API:
node .

# Create a startup script to launch Node, mind the path is different from original instructions:
pico /root/start-powermate.sh 
  #!/bin/sh -e
  cd /root/roon-extension-powermate 
  2>/dev/null 1>/dev/null node . &

#edit  mark script executable
chmod a+x /root/start-powermate.sh

# Add the following to the 2nd-from-bottom line of /etc/rc.local, above final 'exit 0' (caution, this might be overridden by later vendor updates)
   # start powermate HID extension in Node:
   /root/start-powermate.sh
1 Like