Anyone willing to coach a total n00b in using the API?

I’ve been dreaming about having Roon control my multi-zone AV receiver, turning on the amps, changing source, and controlling volume on each of the three zones. The receiver (Denon AVR-x4100w) is designed for home integration and can be controlled through IP commands or through RS-232. Am I correct in thinking that the Roon API might be able to issue commands to the receiver to do things like turn on Zone 2, set its input to Aux 2, and adjust volume? (All these commands are present in the Denon command set.)

If so, would anyone be willing to coach me through getting started with the programming? I’m pretty good with technology, but unfortunately my coding experience stopped somewhere back around Fortran and Basic. I tried reading the guide, but it was obviously written for someone with more base knowledge than I currently have. :fearful:

If you don’t mind i will be joining you in the class room.
My objective is to build some basic control from Windows Phone.

Jules :slight_smile:

fun stuff – this looks interesting – without diving into that et’al and the roon api, I’d assume you’ll be needing to do some orchestration in the middle with a complex endpoint like the AVR… don’t have an AVR device, but would be happy hack yak with you both about putting this together. feed free to pm me to coordinate.

Heard about iRule ?

Still the guide is the place to start to learn about the API specifics. Follow the steps and if you got stuck somewhere asks for help here. A specific question more likely gets an answer than a very broad one.

To learn about JavaScript, any online introduction will do.

Perhaps I should clarify that I’m hoping to get the Roon app itself to control the AVR. For example, I want to be able to connect a Squeezebox or RPi Roon endpoint to an input the AVR, then when I connect to that zone in Roon, have Roon make sure the AVR amp is on and listening on the correct input. Then I want to be able to use the Roon app to increase and decrease the volume of the amplifier. Then I want to be able to set up three separate zones to correspond to the three zones in the AVR and have them all behave this way. In other words, I want it to work just like the AVR’s AirPlay input does with Roon, but on three separate zones and with RAAT quality sound.

Thanks, Jan. Working my way through the guide now, and I’m already stuck on step 4, “Initialize your package.json file and install the dependencies.”

The intro on https://nodesource.com/blog/your-first-nodejs-package/ seemed like a good guide, but their instructions and what I’m seeing in Node.js don’t exactly match up with what I’m seeing in the guide. I was doing ok up until the “cat” part. When I enter this at the command line:

cat << EOF > package.json

It says “<< was not expected at this time.”

When I just enter:

cat package.json

It says “‘cat’ is not recognized as an internal or external command…”

Also, when I initialized the package.json file, it never asked me about dependencies, so I’m not exactly sure what to do about that.

It might be easier to copy the text from the first curly bracket to the last curly bracket, past it into a text editor (e.g. notepad) and save the file as package.json. The guide describes a way to do the same from the command line.

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"
    }
}

It sounds like you are on Windows. The guide assumes you are on Linux or MacOS.

Running Node.js on Windows can be done but it’s a bit more of a challenge IMO. I would expect that any guides on the web will assume you have Linux/shell commands available. You could use VirtualBox to run a Linux virtual machine.

Yes, that was the problem. Since the first few commands worked in Windows, I thought I was in the right place. Thanks.

I know this is a dumb question, but where do Roon extensions live (and run) once they are complete? On the Roon core machine? Does node.js need to be installed on that machine?

Not a dumb question. Extensions can run on any computer on your local network. It doesn’t need any part of Roon installed, it just needs to be able to communicate with your core. You could get a Raspberry Pi, add it to your network and use it just for running extensions.

It does need node.js installed. Node.js is the framework that runs your JavaScript code inside a persistent server.

1 Like

I know this thread has been quiet for several days, but I just wanted to put in my 2 cents in case someone is looking for info and finds this thread: I have Node.js and I am doing some stuff with the Roon API in Windows with no issues at all, works great.

1 Like

You may find some tip here:

At least I managed to rune nodejs, and update the latest version of the extension :grinning:

Not dumb at all, was there myself 6 days ago :grinning:

Here is a screenshot RDT from my iPad on my HTPC. That command prompt is moving all the time.
I would assume at some stage this will change in one way or an other. I think that Extention wake up is alpha or maybe beta :wink:

It has already done more than 17000 ping…!!!

I had asked about the pinging in another thread, and then figured it out myself. Here is what I posted in that thread:

Since this is all javascript code, I realized “hey, I can just crack open the code and find where stuff is getting logged to the console”, and sure enough, if found the lines in the lib.js file in the node-roon-api folder. FYI just search for “console.log” in the lib.js file and comment out as you see fit.

I would like to do the same myself with my Theta. They also use RS232 interface. And I suppose you already purchased an RS232 to Ethernet converter as I have done :grinning:

And maybe try to email Denon / Marantz to support RAAT. Which I suppose is hard for them to do as it seems they already made their own standard. Heos or something…

Now, there also exist Ethernet to ir converters. And ir codes for the different gear is quite public available I think.

So maybe the “right” or best direction is to make a Roon universal ir transmitter ?
Quite equal to that Logitech universal remote that cover almost the whole world of ir remotes. It requires you to login to internet and configure your remote.

Understand where I’m headed?

Now, how about Roon connect with Logitech and ask to interact with their database, is that one possible direction ?

Or alternatively we need a Roon API that transmits ir codes.
Is that easy to do ?

Or can you think of a way around using airplay ?
(RAAT support airplay)

Has someone already invented a universal airplay to ir coverter ?

Maybe email these guys https://www.simplecontrol.com/ ?
Ops. Someone already asked;
https://forum.simplecontrol.com/feature-requests/roon-t11145.html

Have you seen this:

I think there you need either to use a Roon Brigde or a MicroRendu or similar.

Since your AVR seems to have airplay, it may has a RJ45 interface with DNLA. Have you investigated that route ? What is your Denon model ?

Are you saying you have full access to Jan’s code, so if you have the knowledge, you can copy and edit it if you like ?

I am no expert, but what I am saying is that all this stuff that runs in Node.js is JavaScript, and easily editable. Just look through the downloaded Roon API stuff, all JavaScript (and some json)