Running in headless mode on Windows?

Hello everyone,

I have trouble grasping the concept of headless mode. Does it mean the web server will launch and process inside the web browser without external process ? Will the GUI, buttons, faders still accessible ? I tried this hopping performance boost.

When I tried to launch it from windows console I have an error.

On windows I run command :

set ELECTRON_RUN_AS_NODE=1

D:\Soft\Informatique\OpenStageControl\LastVersion>open-stage-control.exe -- --port 9000 --send 127.0.0.1:8000

But an error is thrown.

D:\Soft\Informatique\OpenStageControl\LastVersion>internal/modules/cjs/loader.js:720
    throw err;
    ^

Error: Cannot find module '--port'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
    at Module._load (internal/modules/cjs/loader.js:622:27)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Function.Module.runMain (internal/modules/cjs/loader.js:944:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []

What am I doing wrong ?

Thank you :smiley:

You’re missing the path/to/open-stage-control/resources/app part in the command (https://openstagecontrol.ammd.net/docs/getting-started/running-with-node/#lite-headless-mode). When setting ELECTRON_RUN_AS_NODE, open-stage-control.exe acts as simple nodejs binary and needs to be given the location of the app’s scripts.

When running in headless mode, only the webserver and the osc/midi backend will run, not the launcher nor the default client window.You'll be able to access the client app using a compatible browser.

Using this command return an error. And I'm using the binary version.

open-stage-control.exe resources\app

D:\Soft\Informatique\OpenStageControl\LastVersion>(INFO) Headless mode (--no-gui) enabled automatically (running with node)
(ERROR) A JavaScript error occurred in the main process:
Error: Cannot find module 'electron'
Require stack:
- D:\Soft\Informatique\OpenStageControl\LastVersion\resources\app\server\open-stage-control-server.js
- D:\Soft\Informatique\OpenStageControl\LastVersion\resources\app\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
    at Module._load (internal/modules/cjs/loader.js:622:27)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)
    at Module.require (internal/modules/cjs/loader.js:775:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at o (D:\Soft\Informatique\OpenStageControl\LastVersion\resources\app\server\node_modules\browser-pack\_prelude.js:1:1)
    at D:\Soft\Informatique\OpenStageControl\LastVersion\resources\app\server\node_modules\browser-pack\_prelude.js:1:1
    at Object.445.../package.json (D:\Soft\Informatique\OpenStageControl\LastVersion\resources\app\server\src\server\electron-app.js:1:1)
    at o (D:\Soft\Informatique\OpenStageControl\LastVersion\resources\app\server\node_modules\browser-pack\_prelude.js:1:1)

Sorry, it seems you need to add --no-gui, the headless mode detection doesn’t work properly. (edit: fixed in next release)

It’s working !! Thank you :smiley:
I don’t feel any performance boost, but at least I have tried :sweat_smile:

You software is a breeze to work with !