SyrusJS based Apps/Instances

SyrusJS is an embedded application inside the Syrus 4 which manages a SyrusLang configuration based in files that provides configurable signals, events, and actions to meet our users needs.

Please refer to the following link to discover all the possibilities of SyrusJS:
SyrusJS - SyrusLang

When you use SyrusJS you have 3 options to run an application into the Syrus4.

Option #1 - Via SyrusCloud.

To use this option you need access to Syrus Cloud and follow these steps:

  1. Create the configuration files based on your needs:
    destinations.syrus.conf based on this link SyrusLang Destinations
    configuration.syrus.conf based on this link SyrusLang Configuration

  2. Enter into the Syrus Cloud and go to the application section.


    Here you will find 2 section the OVERVIEW that shows your group devices and what application these have installed, active or inactive, and the APPLICATIONS that shows the SyrusJS instances created.

  3. Go to the APPLICATIONS tab and click on DEFINE INSTANCE.

  4. Select your preferred SyrusJS version, fill the requested data and create or draw & drop your configuration files.

  5. Add you device and save to upload the changes.

  6. Go to the summary, find you device(s) and on the COMM tab check the update status.

Option #2 - Using Management Tool

  1. Create the configuration files based on your needs:
    destinations.syrus.conf based on this link SyrusLang Destinations
    configuration.syrus.conf based on this link SyrusLang Configuration
    .configuration.json based on the following JSON:

    {"configuration_file":"configuration.syrus.conf","destination_file":"destinations.syrus.conf","namespace":""}
    
  2. Enter into the management tool and go to the applications section.

  3. Click on the 3 points of the SyrusJS version you need, select create instance and name it.

  4. Once a instance and you see it in the instances list, go to the Files Browser section and go to

    PATH: /data/app_data/[instance_name]
    

  5. Click the upload icon and find the 3 config files.

  6. Go back to the application section and start the instance.

Option 3 - Via terminal.

  1. Create the configuration files based on your needs:
    destinations.syrus.conf based on this link SyrusLang Destinations
    configuration.syrus.conf based on this link SyrusLang Configuration
    .configuration.json based on the following JSON:

    {"configuration_file":"configuration.syrus.conf","destination_file":"destinations.syrus.conf","namespace":""}
    
  2. If don't have the SyrusJS app installed in the version you need, download and install with the following command (this command automatically installs the app):

    #Example: syrus-apps-manager download-app syrusjs 2.3.2
    syrus-apps-manager download-app syrusjs [version]
    
  3. Create the instance for the previous SyrusJS app installed with:

    #Example: syrus-apps-manager create-instance my_app syrusjs 2.3.2
     syrus-apps-manager create-instance [instance_name] syrusjs [app_version]
    
  4. Upload this files with the management tool (see the opt # 2) or with the SyrusCloud into the instance folder:

    #Example:  /data/app_data/my_instance 
    PATH: /data/app_data/[instance_name]
    

  5. Start your new instance with the following command:

    syrus-apps-manager start my_app
    

📘

Instances Management

Use the syrus-apps-manager tool to manage your instances and apps.

syrus-apps-manager commands:

  help                      Show this help message.

  install-app <zip_path>    Install an app from a .zip file on the device.

  update-app <app> [ver]    Update an app to a new version from its repository.
  download-app <app> [ver]  If [ver] is omitted, downloads the stable version if available.

  list-apps                 List installed apps on the device.
  delete-app <app> <ver>    Delete a specific version of an installed app.

  check-updates             Check for updates for all apps with a repository in
                            their manifest.

  list-instances            List all running app instances on the device.

  create-instance <name> <app> <ver>   Create a new instance from an installed app.
  update-instance <name> <ver>         Update an instance to a different version.
  delete-instance <name>               Delete an instance.

  start <instance>          Start a specific instance.
  stop <instance>           Stop a specific instance.
  restart <instance>        Restart a specific instance.
  status <instance>         Show the status of a specific instance.
  get-running               List only running instances.

  send-message                Send a message (via nc) to applications exposing a Unix socket.
  start-shell                 Start a shell (via nc) with applications exposing a Unix socket.
                                i.e.  syrus-apps-manager send_message _myinstance 'set .foo false'
  clear-buffer <name> <dest>  Clear the buffer of an instance.