This should have been easy. Really easy. It wasn’t.
Start with a freshly installed Raspian. I used NOOBS 2.3.0.
Ensure you have a network connection.
We’ll do 90% of the work from the Terminal.
Update the package manager:
sudo apt-get update; sudo apt-get upgrade
Get a recent version of Node. The latest as of this writing was 7.8.0:
wget https://nodejs.org/dist/v7.8.0/node-v7.8.0-linux-armv7l.tar.gz
Extract it:
tar -xvf node-v7.8.0-linux-armv7l.tar.gz
Then copy it into place:
cd node-v7.8.0-linux-armv7l/
sudo cp -R * /usr/local/
Check your work:
node -v
should report:
v7.8.0
Powermate requires node-hid
, and there isn’t precompiled package for ARM. No big deal. Change back to your home directory:
cd
Grab the dependencies:
sudo apt-get install libudev-dev
sudo apt-get install libusb-1.0-0-dev
Then install. It’ll report errors about not finding a download, and then it’ll fall back to building from source:
npm install node-hid
When it finishes, grab the Roon Powermate package:
git clone https://github.com/RoonLabs/roon-extension-powermate.git
Run the install:
cd roon-extension-powermate/
npm install
To see the Powermate device as a non-administrator, you need to set up permissions. This was by far the trickiest part of the project:
sudo pico /etc/udev/rules.d/50-usb-powermate.rules
Add these lines, watching for typos:
SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="077d", ATTRS{idProduct}=="0410", MODE:="666", GROUP="plugdev"
Refresh the cached rules:
sudo udevadm control --reload-rules
Unplug the Powermate, then plug it back in to apply the permissions.
Check your work:
node .
Open a Roon client, go to Settings, and select Extensions. You should see the Roon Powermate listed.
Finally, to allow this setup to run headless, we need to create a script to run it, and add it to the startup applications.
Type ^C
to stop the extension. Open an editor again:
cd
pico start-powermate.sh
Add these lines:
#!/bin/sh -e
cd /home/pi/roon-extension-powermate
2>/dev/null 1>/dev/null node . &
Make the script executable:
chmod a+x start-powermate.sh
Now, use the GUI to make this script auto-run:
- Choose Preferences->Main Menu editor
- In the left column, click
Preferences
- Enable the checkbox for
Default applications for LXSessions
- Click OK
- Choose Preferences->Default applications for LXSessions
- In the left column, click Autostart
- In the text area next to the Add button, type
/home/pi/start-powermate.sh
- Click Add
- Close the window
Final test:
Reboot your Pi, and on your Roon controller, open Settings->Extensions, and verify that you see the Powermate extension running: