Skip to content

brightsign/3.2.0.4_Sup_Exp

Repository files navigation

bs-bootstrap

Overview

The Supervisor is a JavaScript component (wrapper) that runs when the player starts and continues running in the background at all times. It is deployed as part of every BOS build, first appearing in build 8.0.x(?).

The overall purpose of the supervisor is to:

  • enable CMS to use BSN.cloud
  • enable near real-time and secure communication between player and BSN.cloud

See General Supervisor Info.

(back to top)

Project Docs

(back to top)

Developing for the supervisor

Refer to Writing services section above for details on how to write services for the supervisor.

Running Desktop Supervisor

To run the supervisor in desktop mode, use the following command:

cd src
npm i
npm start

The default logging level for desktop supervisor is INFO. This may be set for bootstrap.js via the BOOTSTRAP_LOGGING_LEVEL environment variable. This should set to one of the numeric values for logging level in bootstrap.js (0-3). To enable trace level logging (example):

export BOOTSTRAP_LOGGING_LEVEL='3'

Note that BOOTSTRAP_LOGGING_LEVEL is only used by bootstrap.js and adjacent software. To configure the logging level for the supervisor, you can do this through the registry key !supervisor.brightsignnetwork.com::trace_level (see https://brightsign.atlassian.net/wiki/spaces/IKB/pages/535822560/Registry+Key+Information). To enable trace level logging for your mock player (example):

npm run set-registry '!supervisor.brightsignnetwork.com' 'trace_level' '3'

Not everything will work like it does on the player, but it's useful for debugging particular services.

For adding more functionality to the desktop supervisor, the registry entries from src/tools/src/register.js will need to be modified to add valid registry values like for tokens, etc.

The desktop supervisor will open a NodeJS server on port 8000 that hosts the DWS APIs, so those can be called locally. For example - Opening a browser window and going to http://localhost:8000 will open the Local DWS for the fake player. The default username and password are admin and StrongPass123! respectively. Note that the results are faked by the wrapper methods written for the various OS APIs. These can be found under the src/brightsign folder, refer to the player.js file first for details on which API file to look at for specific API wrapper methods.

Running test-runner

The test-runner is a program that runs on your local machine. It executes the supervisor test-suite on a physical player, present in your local network. This allows for the tests to run against the actual OS APIs on the player, instead of the wrapper ones that the desktop supervisor mode uses.

To run the test-runner, use the following command:

cd test-runner
npm i
node index.js run --d=27D33C000051 --use-supervisor=new --run-tests=true --reboot=true --ip=10.0.4.48 --p=27D33C000051

Update the values for player serial, player IP, DWS password as needed. There are more options that can be found in the test-runner/index.js file.

Note that currently there are about 55 odd tests that are skipped when the test-runner is ran. This is because the tests that are trying to run setup/configuration tests cause issues with the player's own configuration parameters sometimes. Also the This is a known issue and will be worked on at a later time.

Manually pushing development Supervisor to player

Prerequisites

  • nvm use 18.18.2
  • npm install
  • DWS_html - contents need to be added to supervisors folder (not added by build script) TODO: instructions on how to generate
  • In webpack.config.js swap the dataStringName definition so uncommented line is const dateStringName = '0000-00-00T00-00-00-00-00';
  • Make sure player registry points to correct bootstrap. In DWS: registry write autorun bootstrap sd:/runner/bootstrap.js

This bash script, placed in the src directory, makes it easy to push development changes:

#!/bin/bash

PLAYER_IP=YOUR_PLAYER_IP
PWD=YOUR_SERIAL_OR_PASSWORD

npm run build-dev-bundle

curl --silent --location --write-out "\n" --request PUT "http://${PLAYER_IP}/api/v1/files/sd/runner/supervisors/0000-00-00T00-00-00-00-00"  --digest -u admin:${PWD} --form =@../dist-player/supervisors/0000-00-00T00-00-00-00-00/0000-00-00T00-00-00-00-00.js
curl --silent --location --write-out "\n" --request PUT "http://${PLAYER_IP}/api/v1/files/sd/runner/supervisors/0000-00-00T00-00-00-00-00"  --digest -u admin:${PWD} --form =@../dist-player/supervisors/0000-00-00T00-00-00-00-00/0000-00-00T00-00-00-00-00.js.meta

curl --silent --location --write-out "\n" --request PUT "http://${PLAYER_IP}/api/v1/control/reboot"  --digest -u admin:${PWD}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published