StSupervisor (Ground Station Monitor)

The StSupervisor microservice is an important (optional) component of a system that is used for monitoring and managing STANAG 4609 multicast video streams. It is responsible for detecting stream parameters, generating live video previews, and reporting events such as Timeout, Bitrate, Stream errors, and Klv metadata info, etc.

This microservice communicates with other system microservices using MQTT messages. By using MQTT messages, the StSupervisor microservice can easily communicate with other microservices in the system, allowing it to coordinate with them to perform its monitoring and reporting tasks.

One of the key features of the StSupervisor microservice is its ability to generate live video previews. This feature allows operators to view the multicast video streams in real-time, making it easier to detect any issues or problems that may arise. Additionally, the microservice is able to detect stream parameters, such as bitrate and Klv rate, which can be used to optimize the performance of the system.

In the event that an issue is detected with a multicast video stream, the StSupervisor microservice is able to report the issue to other microservices in the system. This reporting allows the system to quickly respond to any issues, minimizing downtime and ensuring that the system is able to operate at peak efficiency.

Overall, the StSupervisor microservice plays a critical role in the monitoring and management of multicast video streams. By detecting stream parameters, generating live video previews, and reporting issues to other microservices in the system, it helps to ensure that the system is operating smoothly and efficiently.

Note: The StSupervisor microservice works on the local network (http only).

Main features

  • Monitors a pre-configured list of multicast video streams (simple yaml configuration file)
  • Multiple UAV platforms (with multiple sensors each)
  • Timeout, Bitrate, Stream errors and Klv rate reporting
  • Low latency video preview
  • MISB 0601, 0102, 0903 live decoding
  • Stream parameters detection
  • User-defined event triggers based on speed, altitude, location etc
  • MQTT messages for easy integration (InfluxDB, Grafana, etc)
  • Cross-platform Windows/Linux. Easy setup.
  • Desktop and mobile UI.

Additional information can be found here StSupervisor

Usage

StSupervisor can be used as stand-alone application (no external dependencies required ) or as a Docker container.

Stand alone operation

Windows

To start the playback run stsupervisor.exe with the command line argument that specifies the configuration file.

stsupervisor EoSensor.yml

Linux

To start the playback run stsupervisor.run with the command line argument that specifies the configuration file.

./stsupervisor.run EoSensor.yml

Docker container

Create application and platform configuration files (as explained below) in a host directory and mount the directory to the /app/config folder in the container:

docker run --rm -it --net=host -v ~/stservices/stsupervisor/config:/app/config impleo/stsupervisor:1.0.12

Docker compose

version: "3.4"

services:

# StSupervisor
  stsupervisor:
    image: impleo/stsupervisor:1.0.12
    container_name: stsupervisor
    restart: always  
    network_mode: host
    volumes:
      - ~/Work/stservices/stsupervisor/config:/app/config

Licensing

Application without license will work in demo mode (for about 15 min). In order to lift demo restrictions you should provide the license using one of two options:

  • passing license info as the arguments (with --licenseFile and --licenseKey)
  • copying license file (.lic) file into a current working directory

Please contact info@impleotv.com for the licensing information.

Configuration

StSupervisor uses 2 configuration files:

  • supervisor.yml - application configuration file
  • platforms.yml - platforms, sensors etc configuration file

When launched without parameters, StSupervisor will look for these two files in a current directory. You can use arbitrary files by supplying --appConfig and --platformConfig arguments. Also, some of the file parameters can be overwritten with the options shown in the Options table.

.ENV

StSupervisor will also check for the presence of the .env file. If found, the parameter defined in it will override the configuration arguments. The following entries can be defined:

  • APP_CONFIG - StSupervisor yaml configuration file. Default - supervisor.yml in the config dir
  • PLATFORM_CONFIG - Platforms yaml configuration file. Default - platforms.yml in the config dir
  • SERVER_NAME - Server name

Options

Flag Name Description
--appConfig StSupervisor yaml configuration file. Default - supervisor.yml in root dir
--platformConfig Platforms yaml configuration file. Default - platforms.yml in root dir
--mqttBrokerHost Mqtt broker host url. If not provided, internal mqtt server will be launched
--mqttPort Mqtt broker port
--mqttWsPort Mqtt websocket broker port. Default 9001
--httpPort HTTP server port. Default 8065. Port to access the application.
--httpMonitorStartPort Channel HTTP port. Will start from this value and increment for each instance. Default - 4000
--wsVideoStreamStartPort Web socket video preview stream port. Will start from this value. Default - 9010
--videoBitrate Video preview bitrate. Default - 96K
--videoResolution Video preview resolution. Default - '128x96'
--stServerMode Work with StServer
--nodeInfo Show NodeInfo string
--licenseFile License file
--licenseKey License Key
--printUsage Print args description (true/false)
-v --version Version

Note StSupervisor works with multicast streams only. As it is a monitoring service, it makes no sense to directly consume unicast streams. If, for any reason you only have a unicast in your system and want to monitor the stream, consider using ImpleoTV's unicast to multicast recaster.

Basic StSupervisor app configuration

Here is an example of the application configuration file:

# StSupervisor config 
server:
  httpPort: 8065

# Mqtt section
mqtt:
  brokerHost: tcp://localhost  
  internal: true  # use (create) internal MQTT broker
  port: 1883
  wsPort: 9001
  username:
  password:

# influxdb section
influxdb:
  host: 35.178.214.216 # influxdb server address
  port: 8086
  username: 
  password: 
  database: telegraf

# Stream monitor config section 
streamMonitor:
  httpStartPort: 4000               # create stream monitor server starting from port 4000
  wsVideoStreamStartPort: 9010      # create websocket starting from port 4000
  bitrateReportingPeriod: 1000      # report bitrate every 1000 ms
  metadataSampling: 1000            # sample metadata every 1000 ms
  timeout: 1000                     # report stream timeout after 1000 ms
  noSignalAfter: 30000              # report no signal, and restart the monitor (this will allow to receive a different stream on this ip/port )

# licensing section
license:
  file: StSupervisor-Lenovo.lic
  key: 022B9FA1-9500AD67-86CAD66D-2A459B66

Basic platform configuration

Here is an example of the configuration file that defines two UAV platforms (with names UAV_1 and UAV_2)

First UAV has 4 video sensors:

  • EO/IR sensor with the stream coming on udp://227.1.1.1:30120
  • Tail camera sensor with the stream coming on udp://227.1.1.2:30122
  • Operator screen capture sensor with the stream coming on udp://227.1.1.3:30123
  • Radar capture sensor with the stream coming on udp://227.1.1.4:30124

Note, Radar sensor has active setting set to false (active: false), so this sensor is not monitored (set it to true, to enable monitoring).

Second UAV has only one sensor:

  • EO/IR sensor with the stream coming on udp://228.1.1.1:1234

If you only have one UAV (platform) to monitor, there should be one platform in the list.

# Platforms 
platforms:
# First platform 
  - platform: UAV_1    
    active: true
    name: UAV_1
    description: First platform
    type: UAV
    sensors:
      - sensor: EO
        name: EO/IR
        description: EO/IR sensor
        active: true       
        type: video
        url: udp://227.1.1.1:30120

      - sensor: Tail
        name: Tail
        description: Tail camera
        active: true
        type: video
        url: udp://227.1.1.2:30122

      - sensor: Operator
        name: Operator screen
        active: true         
        type: video
        url: udp://227.1.1.3:30123   

      - sensor: Radar
        name: Radar
        active: false     
        type: video
        url: udp://227.1.1.4:30124  

# Second platform
  - platform: UAV_2
    active: true
    name: UAV_2
    description: Second platform
    type: UAV
    sensors:
      - sensor: EO
        active: true
        name: EO/IR
        type: video
        url: udp://228.1.1.1:1234        

Note. If you have to select the specific network interface, use add ?localaddr= to the url:

udp://227.1.1.1:30120?localaddr=192.168.1.28

Operation

To start stream monitoring run stsupervisor.exe (with or without additional command line arguments).

stsupervisor

Mqtt broker

If no broker host parameter is provided, the StSupervisor will launch an internal broker. You can use any Mqtt broker (note, it must support websockets)

For example, to use Mosca Mqtt broker one can launch it with the following command:

mosca -v --port 1883 --http-port 9001 --http-bundle --http-static ./

Mqtt reporting

Stream Monitor sends events to Mqtt broker in the following format: applicationName/platformId/sensorId/event, where event has one of the following values:

event Description
state Current state
detection Stream detection results (JSON)
bitrate Current stream bitrate
custom events User-defined events
config General configuration information - httpServer, wsVideoPreview
demoExpired Demo Expired

For example,

StreamMonitor/Heron/EO/state

State events

Stream Monitor reports the following stream state events:

  • Unknown. This state will be reported when Stream Monitor goes offline (or not started yet) and therefore there is no info on the stream available.
  • Offline. Stream is not present.
  • Online. Stream is running.

Bitrate reporting

Stream Monitor periodically sends bitrate notifications with a configurable period

Triggers

Triggers are used to issue events when certain conditions are met. Stream Monitor will send Mqtt message with "trigger" topic and conditions payload when there is a match. Upon reporting, the trigger is removed from an internal queue.

The logic: - Event is fired when the conditions inside the trigger resolve to true (logical AND) - Event is fired only once ( if armed state is true). After that, the armed state is set to false.

For example, below are YAML defined triggers:

triggers: 
  # Send start message when stream becomes online 
    - trigger: start 
      armed: true
    conditions:
    state: online
  # Send start message based on telemetry defined conditions - ground speed > 100 km/h and altitude > 200 m
    - trigger: start
    armed: true 
    conditions:
      state: online
        telemetry:
          speed:
            above: 100
          altitude:
                        above: 200  
    # Send arrived message based on telemetry defined conditions - platform location is inside of predefined polygon
    - trigger: arrived
      armed: true  
    conditions:  
      telemetry:
        location:
          coordinates: [[[34.7373,32.0686],[34.8616,32.0686],[34.8616,32.1238],[34.7373,32.12387],[34.7373,32.0686]]]
    # Send stop message based on telemetry defined conditions - ground speed < 20
    - trigger: stop
      armed: true  
    conditions:  
      telemetry:
        speed:
          below: 20       

Triggers can also be included as a separate file:

   triggers: !!inc/file triggers.yml 

HTTP interface

GET

version

Command:

http://localhost:8065/version

Response:

1.0.0

platforms

Command:

http://localhost:8065/platforms

Response:

[
  {
    "platform": "UAV_1",
    "active": true,
    ...
     "sensors": [ 
         ...
     ]
  },
  {
    "platform": "UAV_2",
    "active": true,
    ... 
    "sensors": [ 
        ... 
     ]
  }
  ...

]

config

Command:

http://localhost:8065/config

Response:

{
  "mqtt": {
    "brokerHost": "tcp://localhost",
    "port": 1883,
    "wsPort": 9001,
    "username": null,
    "password": null
  },
  "streamMonitor": {
    "httpStartPort": 4000,
    "wsVideoStreamStartPort": 9010,
    "bitrateReportingPeriod": 1000,
    "metadataSampling": 1000,
    "timeout": 1000,
    "noSignalAfter": 30000
  }
}

nodeinfo

Command:

http://localhost:8065/nodeinfo

Response:

a43c1b0a-a53a-0c90-8810-c06ab1ff3967

license

Command:

http://localhost:8065/license

Response:

returns license

readme

Command:

http://localhost:8065/readme

Response:

README content...