Roon doesn't remember enabled extension

Hi

I’m playing around with https://github.com/st0g1e/roon-extension-http-api

It works fine once I have enabled it in the Roon > Settings > Extensions dialog.

However, if I quit and restart Roon, it stops working. If I go back to the Roon > Settings > Extensions dialog again I can see it discovered as a new extension (with the same name). Viewing already enabled extensions shows the original still enabled. Enabling the new version makes it work again. So then I have two identical entries in the already enabled extensions box.

The same behaviour occurs if I close my laptop and re-open it.

So can anyone help me understand how Roon identifies discovered extensions as unique? Anything I can do to fix this?

Thanks

Rob

The general mechanism works like this:

  1. When the user enables the extension in the settings page in Roon, Roon sends a random “token” string to the extension.
  2. The extension saves the token string, and sends it to Roon the next time it is restarted.
  3. If Roon sees a token it remembers being authorized it trusts that extension and doesn’t show the enable button.

My best guess is that the http-api extension isn’t saving the token value, or perhaps isn’t resending it correctly. I’m not sure how helpful that is exactly, just trying to get back into the habit of responding here when I can.

Hi Ben

Thanks for explaining - makes perfect sense. I will dig into the extension and debug what is going wrong!

Rob

This problem is now resolved for me. In case anyone else has the same symptoms, here’s what I found / did.

I’m on a Mac. I’m running Roon core locally.

I had installed the roon-extension-http-api into /Users/me/roon/roon-extension-http-api/

After firing up node to run the extension, a file called config.json appeared in this directory, which (confusingly to me, at least) seems to be written by Roon itself, not by the extension. It contains the magic token.

Subsequently restarting the extension and/or Roon worked fine - the token persisted and the extension was remembered by Roon.

In order to launch the extension automatically on boot, I had created a Mac launch agent. This didn’t “remember” extension authorisations at first, because (it transpired) Roon couldn’t find the config.json file. Adding a WorkingDirectory key to the launch agent plist fixes the issue.

Now sending GET requests to localhost:3001 allows me to control Roon. I am using Alfred to bind hotkeys to curl requests for volume up, volume down and play/pause, which now work globally (ie, no matter what app has focus).

My plist for the service is below.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key><string>reha</string>
      <key>ProgramArguments</key>
      <array>
        <string>/usr/local/bin/node</string>
        <string>/Users/me/roon/roon-extension-http-api</string>
      </array>
      <key>KeepAlive</key><true/>
      <key>NetworkState</key><true/>
      <key>StandardErrorPath</key><string>/Users/me/roon/launchagent.log</string>
      <key>StandardOutPath</key><string>/Users/me/roon/launchagent.log</string>
      <key>WorkingDirectory</key> <string>/Users/me/roon/roon-extension-http-api</string>
      <key>LaunchOnlyOnce</key><true/>
    </dict>
  </plist>

Thanks again to Ben for pointing me in the right direction.

For reference, that file is written by the library we wrote for node.js code to interface with the Roon API. It’s technically part of the extension, in that it lives in the extension code, but it’s a couple layers away from what people normally think of as “an extension” that they might write or ship to someone.

Continuing the discussion from Roon doesn't remember enabled extension:

Hi Ben,
I found the place where the token is transmitted from the roon core to the extension (roon.extension_reginfo.token).
Sorry, but I have no idea how to submit the token next time I start the plugin?
Help would be appreciated.
Thanks Charly

Well,
I found that I had to allow writing in the app’s directory.
If the “config.json” file can be written it will be used next time the extension is started. So authentication is no more an issue for me
:slight_smile:

Hello.

PROBLEM: ROON CLIENT SHOWS “NO EXTENSION DISCOVERED”

BLUF: I am a RooExtend owner. I’ve had a licensed version of RoonDial working fine for many months. I have re-booted RooExtend, and my Roon ROCK server. No changes. I have made no changes recently to the network or power configs.

Next Step: Do I have to re-image the SD card on the RooExtend? The red leds are blinking fast; which doesn’t seem normal. Please provide corrective solutions; so I can get my RoonDial back in working order. Thank you.

Speak to the developer of your extension it’s his code not Roons. He should be supporting it.