API questions for a beginner... but not new to linux


#1

Recently I created a kind of cool volume control using a Griffin Powermate (USB) attached to a RBP Zero that when adjusted, sends commands via SSH to a Roon Bridge (amixer commands) for volume adjustments. Works great, albeit a bit laggy. I did it this way so that I wasn’t doing any direct mods to the bridge (running Ropieee via RBP 3).

I now have a few zones grouped so I’m back to adjusting volume via my iPad since it controls volume for both zones simultaneously. I now want to leverage my Powermate to send master volume commands directly to Roon, rather than to the bridge itself. My DAC supports volume adjustments directly via Roon.

I attempted to install the API on my RBP Zero by using Apt-get to install node.js and git. I went through the examples on the forum and am failing miserably. I created the .JSON files, and run “npm install” and instead of installing dependencies, it fails. Here is the output:

----begin output---

**pi@raspberrypi** : **~ $** cd roon-extention-test/

**pi@raspberrypi** : **~/roon-extention-test $** npm install

(node:20427) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

npm WARN package.json roon-extension-test@1.0.0 No repository field.

npm WARN package.json roon-extension-test@1.0.0 No README data

\nter passphrase for key '/home/pi/.ssh/id_rsa': /

npm ERR! git clone git@github.com:github:roonlabs/node-roon-api Cloning into bare repository '/home/pi/.npm/_git-remotes/git-github-com-github-roonlabs-node-roon-api-e166b9a7'...

npm ERR! git clone git@github.com:github:roonlabs/node-roon-api fatal: remote error: 

npm ERR! git clone git@github.com:github:roonlabs/node-roon-api is not a valid repository name

npm ERR! git clone git@github.com:github:roonlabs/node-roon-api Email support@github.com for help

npm ERR! Error: Not found : node-roon-api

npm ERR! at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:300:14)

npm ERR! at Request._callback (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:238:65)

npm ERR! at Request.self.callback (/usr/lib/nodejs/request/index.js:148:22)

npm ERR! at emitTwo (events.js:126:13)

npm ERR! at Request.emit (events.js:214:7)

npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/index.js:896:14)

npm ERR! at emitOne (events.js:121:20)

npm ERR! at Request.emit (events.js:211:7)

npm ERR! at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/index.js:847:12)

npm ERR! at emitNone (events.js:111:20)

npm ERR! If you need help, you may report this *entire* log,

npm ERR! including the npm and node versions, at:

npm ERR! <http://github.com/npm/npm/issues>

npm ERR! System Linux 4.14.70+

npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"

npm ERR! cwd /home/pi/roon-extention-test

npm ERR! node -v v8.11.1

npm ERR! npm -v 1.4.21

npm ERR! 

npm ERR! Additional logging details can be found in:

npm ERR! /home/pi/roon-extention-test/npm-debug.log

npm ERR! not ok code 0

**pi@raspberrypi** : **~/roon-extention-test $**

----end output----

Now, above if you are keen you will notice where it asks me to enter a passphrase. That is because I was getting an error saying bad authentication. I followed the web down a rabbit hole and saw someone else with a similar issue saying I had to generate a new SSH key using a passphrase and then registering it with a GIT account. I did that, and now this is where I’m at.

The error that I’m focusing on above is saying that there is no such repository for roon API. Odd?

Here is the detail from my package.json:

----begin output---

pi@raspberrypi:~/roon-extention-test $ cat package.json 
{
    "name": "roon-extension-test",
    "version": "1.0.0",
    "description": "Roon Extension to test using Roon API",
    "main": "app.js",
    "author": "Elvis Presley",
    "license": "Apache-2.0",
    "dependencies": {
        "node-roon-api": "github:roonlabs/node-roon-api"
    }
}
pi@raspberrypi:~/roon-extention-test $ 

---end output---

Questions:

  1. Do I even need to do this on the device with the powermate connected? I’m assuming yes since I need to install the extension on this device so that it can be “installed” within my roon core?

  2. Is there anything I need to do on my Roon core (running Windows server 2016) in preparation?

  3. So that I’m not reinventing the wheel, is there any extensions pre-build that I can steal from to use this powermate as a volume knob for the master mixer within Roon?

Cheers -


(Jan Koudijs) #2

That’s a pretty old version of npm, maybe it is too old.

There already exists a Powermate extension, made by Roon Labs. If it is not the perfect fit for your use case then it might be the perfect example.


#3

Thanks Jan. I thought NPM was old, too. But when I try to run apt-get upgrade on nodejs / node.js and NPM it is showing I’m running the latest version?

My other question is, if there is already an extension that I can steal from, is this even required (the entire NPM / node.js stuff)? I’m guessing yes as I need to install dependencies? Or is there a package to download that will install the extension within linux?


#4

Ok - whew. I found a website that showed how to update NPM. Got that done. Then it started failing for installing the HID required component. After 100 webpages later, I found someone that showed to install HID development tools via apt-get. Got past that error. Now I’m able to launch the powermate extension and it shows in roon! Now the powermate extension is showing that it’s not finding the powermate via USB. I’ll find that extension forum thread and go from there.


#5

Figured that out. Had to run it as sudo for some reason normal users could not gain access to USB devices? Some dumb permissions issue I don’t feel like chasing.

Unfortunately this powermate extension only allows for controlling one zone at a time. So I modified the .JS file and hard-coded the section for volume control to control two device ID’s simultaneously. Worked a charm.