Making things easier with Node

Hello,

As with Node the server is launcher with the command line, is it possible to put the options in a file to avoid typing them at each launch?

Moreover, is it possible to automatically start the server at startup on a Raspberry Pi?

Thank you.

1 Like

You can create a shell script with all you options and execute it.

#!/bin/sh
open-stage-control --debug --load path/to/session.json

Making it run on startup should be doable but I think there are good online resources on that matter.

2 Likes

Thank you. I see with --help that there's a config-file too but I can't find it. It's supposed to be in "cache-dir" but I can't find this directory within O-S-C folder. Where is it supposed to be?

~/.config/open-stage-control/config.json

1 Like

Thank you.

Is there a way to request the current state of the server from the command line or from the client?

Also, is it possible to use a configuration file from another installation of O-S-C on a Windows or Mac computer as an example to edit the file? Where are these files located?

Is there a way to request the current state of the server from the command line or from the client?

If launched from the command line, you can copy the command from the terminal.

I forgot to mention, this config file is not meant to provide command line options, it's more a way to save the launcher's config.

So the config file is of no use with Node?

Yes it is, sorry.

My question about the current configuration is for checking purposes. For instance, I have a session opened in a browser but I am not sure the server is running.

The client app should show a notification popup when disconnected that stays forever.

1 Like

Isn't there any way to display the server configuration in the client window?

You could create a custom module that reads the server config using settings.read() and feed it to a widget when the session is loaded, something like (to be adjusted to your needs of course)

var config = {}
var configStr = ''
for (var opt in ['send', 'port', 'load']) {
  config[opt] = settings.read(opt)
  configStr += opt + ':' + config[opt] + '\n'
}


app.on('sessionOpened', (data, client)=>{
    receive('/text_widget_address', configStr)
})
2 Likes