├── .github └── workflows │ └── main.yml ├── .gitignore ├── .mvn └── wrapper │ └── maven-wrapper.properties ├── README.md ├── docker ├── Dockerfile ├── Makefile ├── README.md └── docker-compose.yml ├── mvnw ├── mvnw.cmd ├── pom.xml ├── simulator.py ├── src └── main │ ├── java │ └── com │ │ └── example │ │ └── myproject │ │ ├── MyCommandPostprocessor.java │ │ └── MyPacketPreprocessor.java │ └── yamcs │ ├── etc │ ├── processor.yaml │ ├── yamcs.myproject.yaml │ └── yamcs.yaml │ └── mdb │ └── xtce.xml └── testdata.ccsds /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | schedule: 7 | - cron: '0 0 * * 0' # Runs every Sunday at midnight 8 | 9 | jobs: 10 | build: 11 | name: Build and Test 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - name: Install dependencies 18 | run: sudo apt-get update && sudo apt-get install -y build-essential 19 | 20 | - name: Run make all and wait for Sent 21 | run: make wait-for-sent 22 | working-directory: ./docker 23 | 24 | - name: Archive all.txt logs 25 | if: always() 26 | uses: actions/upload-artifact@v4 27 | with: 28 | path: /quickstart/docker/all.txt 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse metadata 2 | /.settings/ 3 | /.classpath 4 | /.project 5 | 6 | # Maven output 7 | /target/ 8 | 9 | # VSCode 10 | .vscode/settings.json 11 | 12 | # Docker logs for CI 13 | docker/all.log 14 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | wrapperVersion=3.3.2 18 | distributionType=only-script 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Yamcs QuickStart 2 | 3 | This repository holds the source code to start a basic Yamcs application that monitors a simulated spacecraft in low earth orbit. 4 | 5 | You may find it useful as a starting point for your own project. 6 | 7 | 8 | ## Prerequisites 9 | 10 | * Java 17+ 11 | * Linux x64/aarch64, macOS x64/aarch64, or Windows x64 12 | 13 | A copy of Maven is also required, however this gets automatically downloaded an installed by using the `./mvnw` shell script as detailed below. 14 | 15 | 16 | ## Running Yamcs 17 | 18 | Here are some commands to get things started: 19 | 20 | Compile this project: 21 | 22 | ./mvnw compile 23 | 24 | Start Yamcs on localhost: 25 | 26 | ./mvnw yamcs:run 27 | 28 | Same as yamcs:run, but allows a debugger to attach at port 7896: 29 | 30 | ./mvnw yamcs:debug 31 | 32 | Delete all generated outputs and start over: 33 | 34 | ./mvnw clean 35 | 36 | This will also delete Yamcs data. Change the `dataDir` property in `yamcs.yaml` to another location on your file system if you don't want that. 37 | 38 | 39 | ## Telemetry 40 | 41 | To start pushing CCSDS packets into Yamcs, run the included Python script: 42 | 43 | python simulator.py 44 | 45 | This script will send packets at 1 Hz over UDP to Yamcs. There is enough test data to run for a full calendar day. 46 | 47 | The packets are a bit artificial and include a mixture of HK and accessory data. 48 | 49 | 50 | ## Telecommanding 51 | 52 | This project defines a few example CCSDS telecommands. They are sent to UDP port 10025. The simulator.py script listens to this port. Commands have no side effects. The script will only count them. 53 | 54 | 55 | ## Bundling 56 | 57 | Running through Maven is useful during development, but it is not recommended for production environments. Instead bundle up your Yamcs application in a tar.gz file: 58 | 59 | ./mvnw package 60 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM maven:3.9.9-eclipse-temurin-17 2 | 3 | WORKDIR /yamcs 4 | -------------------------------------------------------------------------------- /docker/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | .ONESHELL: 3 | .SHELLFLAGS := -eu -o pipefail -c 4 | .DELETE_ON_ERROR: 5 | MAKEFLAGS += --warn-undefined-variables 6 | MAKEFLAGS += --no-builtin-rules 7 | 8 | PYTHON := $(shell command -v python3 2>/dev/null || echo python) 9 | 10 | .DEFAULT_GOAL := help 11 | 12 | # Define function to print messages in different colors 13 | # Usage: $(call print_message,ANSI_COLOR_CODE,Your message here) 14 | define print_message 15 | @printf "\033[$(1)m$(2)\033[0m\n" 16 | endef 17 | 18 | .PHONY: all all-10hz clean yamcs-up yamcs-down yamcs-simulator yamcs-simulator-10hz yamcs-shell help 19 | 20 | all: clean yamcs-up yamcs-simulator ## run all: clean, yamcs-up (yamcs-down) and yamcs-simulator 21 | 22 | all-10hz: clean yamcs-up yamcs-simulator-10hz ## run all: clean, yamcs-up (yamcs-down) and yamcs-simulator 23 | 24 | yamcs-up: | yamcs-down ## bring up yamcs system 25 | docker compose up -d 26 | 27 | yamcs-down: ## bring down yamcs system 28 | $(call print_message,33,Stopping any running docker-yamcs containers...) 29 | docker compose down -v --remove-orphans 30 | 31 | yamcs-simulator: ## run yamcs simulator 32 | $(call print_message,36,Connect via http://localhost:8090/ system may take about 50 seconds to startup) 33 | cd .. && $(PYTHON) ./simulator.py 34 | 35 | yamcs-simulator-10hz: ## run yamcs simulator at 10hz 36 | $(call print_message,36,Connect via http://localhost:8090/ system may take about 50 seconds to startup) 37 | cd .. && $(PYTHON) ./simulator.py --rate=10 38 | 39 | yamcs-simulator-down: ## stop the yamcs simulator 40 | $(call print_message,33,Stopping the yamcs simulator...) 41 | pkill -f simulator.py 42 | $(call print_message,32,Simulator stopped successfully) 43 | 44 | yamcs-simulator-restart: yamcs-simulator-down yamcs-simulator ## stop the yamcs simulator and start it again 45 | 46 | yamcs-shell: ## shell into yamcs container 47 | docker compose up -d && docker compose exec yamcs bash 48 | 49 | clean: | yamcs-down ## remove yamcs build artifacts and docker resources created by this Makefile 50 | $(call print_message,33,Cleaning up docker-yamcs resources (containers, volumes, networks)...) 51 | docker compose rm -f -s -v 52 | $(call print_message,33,Removing docker-yamcs image...) 53 | docker image rm -f docker-yamcs 2>/dev/null || true 54 | $(call print_message,33,Cleaning up yamcs build artifacts...) 55 | rm -rf ../target 56 | $(call print_message,32,Done!) 57 | 58 | wait-for-sent: | yamcs-up ## run make all and wait up to 10 minutes for "Sent:" in the output 59 | @echo "Running make all and waiting for 'Sent:' in the output..." && \ 60 | nohup $(MAKE) all > all.log 2>&1 & \ 61 | pid=$$!; \ 62 | timeout=600; \ 63 | while ! grep -q "Sent:" all.log; do \ 64 | sleep 1; \ 65 | timeout=$$((timeout - 1)); \ 66 | if [ $$timeout -le 0 ]; then \ 67 | echo "Timeout waiting for 'Sent:' in the output"; \ 68 | kill $$pid; \ 69 | exit 1; \ 70 | fi; \ 71 | done; \ 72 | echo "Found 'Sent:' in the output"; \ 73 | kill $$pid 74 | 75 | TERM_WIDTH := $(shell tput cols 2>/dev/null || echo 80) 76 | 77 | define print_header 78 | @printf '%*s\n' "$(TERM_WIDTH)" '' | tr ' ' '-' 79 | @printf '%-*s\n' "$(TERM_WIDTH)" "$(1)" 80 | @printf '%*s\n' "$(TERM_WIDTH)" '' | tr ' ' '-' 81 | endef 82 | 83 | 84 | help: ## display this help message 85 | $(call print_header,"Makefile") 86 | @awk 'BEGIN {FS = ":.*##"; printf "\033[36m%-30s\033[0m %s\n", "Target", "Description"} /^[a-zA-Z_-]+:.*?##/ {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort 87 | 88 | print-%: ## Print any variable (e.g., make print-PYTHON) 89 | @echo $* = $($*) 90 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # Yamcs QuickStart's Docker and Makefile 2 | 3 | This folder contains content to run yamcs in a docker container 4 | 5 | ## Prerequisites 6 | 7 | * make 8 | * docker 9 | * docker-compose 10 | 11 | ## Builing, running, and simulating data in Yamcs 12 | 13 | Here are some commands to get things started: 14 | 15 | To list available make targets: 16 | 17 | make 18 | 19 | To run the all target: 20 | 21 | make all 22 | 23 | To bring up yamcs container: 24 | 25 | make yamcs-up 26 | 27 | To bring down yamcs container: 28 | 29 | make yamcs-down 30 | 31 | To run simulator by connecting to container: 32 | 33 | make yamcs-simulator 34 | 35 | To shell into yamcs container: 36 | 37 | make yamcs-shell 38 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | 2 | services: 3 | yamcs: 4 | build: . 5 | hostname: yamcs 6 | container_name: yamcs 7 | command: "mvn yamcs:run" 8 | healthcheck: 9 | test: ["CMD", "curl", "-f", "http://localhost:8090"] 10 | interval: 10s 11 | timeout: 5s 12 | retries: 30 13 | start_period: 30s 14 | volumes: 15 | - ../:/yamcs 16 | ports: 17 | - "8090:8090" 18 | - "10015:10015/udp" 19 | extra_hosts: 20 | - "host.docker.internal:host-gateway" 21 | networks: 22 | - quickstart 23 | networks: 24 | quickstart: 25 | driver: bridge 26 | -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Apache Maven Wrapper startup batch script, version 3.3.2 23 | # 24 | # Optional ENV vars 25 | # ----------------- 26 | # JAVA_HOME - location of a JDK home dir, required when download maven via java source 27 | # MVNW_REPOURL - repo url base for downloading maven distribution 28 | # MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven 29 | # MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output 30 | # ---------------------------------------------------------------------------- 31 | 32 | set -euf 33 | [ "${MVNW_VERBOSE-}" != debug ] || set -x 34 | 35 | # OS specific support. 36 | native_path() { printf %s\\n "$1"; } 37 | case "$(uname)" in 38 | CYGWIN* | MINGW*) 39 | [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" 40 | native_path() { cygpath --path --windows "$1"; } 41 | ;; 42 | esac 43 | 44 | # set JAVACMD and JAVACCMD 45 | set_java_home() { 46 | # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched 47 | if [ -n "${JAVA_HOME-}" ]; then 48 | if [ -x "$JAVA_HOME/jre/sh/java" ]; then 49 | # IBM's JDK on AIX uses strange locations for the executables 50 | JAVACMD="$JAVA_HOME/jre/sh/java" 51 | JAVACCMD="$JAVA_HOME/jre/sh/javac" 52 | else 53 | JAVACMD="$JAVA_HOME/bin/java" 54 | JAVACCMD="$JAVA_HOME/bin/javac" 55 | 56 | if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then 57 | echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 58 | echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 59 | return 1 60 | fi 61 | fi 62 | else 63 | JAVACMD="$( 64 | 'set' +e 65 | 'unset' -f command 2>/dev/null 66 | 'command' -v java 67 | )" || : 68 | JAVACCMD="$( 69 | 'set' +e 70 | 'unset' -f command 2>/dev/null 71 | 'command' -v javac 72 | )" || : 73 | 74 | if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then 75 | echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 76 | return 1 77 | fi 78 | fi 79 | } 80 | 81 | # hash string like Java String::hashCode 82 | hash_string() { 83 | str="${1:-}" h=0 84 | while [ -n "$str" ]; do 85 | char="${str%"${str#?}"}" 86 | h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) 87 | str="${str#?}" 88 | done 89 | printf %x\\n $h 90 | } 91 | 92 | verbose() { :; } 93 | [ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } 94 | 95 | die() { 96 | printf %s\\n "$1" >&2 97 | exit 1 98 | } 99 | 100 | trim() { 101 | # MWRAPPER-139: 102 | # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. 103 | # Needed for removing poorly interpreted newline sequences when running in more 104 | # exotic environments such as mingw bash on Windows. 105 | printf "%s" "${1}" | tr -d '[:space:]' 106 | } 107 | 108 | # parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties 109 | while IFS="=" read -r key value; do 110 | case "${key-}" in 111 | distributionUrl) distributionUrl=$(trim "${value-}") ;; 112 | distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; 113 | esac 114 | done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" 115 | [ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" 116 | 117 | case "${distributionUrl##*/}" in 118 | maven-mvnd-*bin.*) 119 | MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ 120 | case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in 121 | *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; 122 | :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; 123 | :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; 124 | :Linux*x86_64*) distributionPlatform=linux-amd64 ;; 125 | *) 126 | echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 127 | distributionPlatform=linux-amd64 128 | ;; 129 | esac 130 | distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" 131 | ;; 132 | maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; 133 | *) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; 134 | esac 135 | 136 | # apply MVNW_REPOURL and calculate MAVEN_HOME 137 | # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ 138 | [ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" 139 | distributionUrlName="${distributionUrl##*/}" 140 | distributionUrlNameMain="${distributionUrlName%.*}" 141 | distributionUrlNameMain="${distributionUrlNameMain%-bin}" 142 | MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" 143 | MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" 144 | 145 | exec_maven() { 146 | unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : 147 | exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" 148 | } 149 | 150 | if [ -d "$MAVEN_HOME" ]; then 151 | verbose "found existing MAVEN_HOME at $MAVEN_HOME" 152 | exec_maven "$@" 153 | fi 154 | 155 | case "${distributionUrl-}" in 156 | *?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; 157 | *) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; 158 | esac 159 | 160 | # prepare tmp dir 161 | if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then 162 | clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } 163 | trap clean HUP INT TERM EXIT 164 | else 165 | die "cannot create temp dir" 166 | fi 167 | 168 | mkdir -p -- "${MAVEN_HOME%/*}" 169 | 170 | # Download and Install Apache Maven 171 | verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." 172 | verbose "Downloading from: $distributionUrl" 173 | verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" 174 | 175 | # select .zip or .tar.gz 176 | if ! command -v unzip >/dev/null; then 177 | distributionUrl="${distributionUrl%.zip}.tar.gz" 178 | distributionUrlName="${distributionUrl##*/}" 179 | fi 180 | 181 | # verbose opt 182 | __MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' 183 | [ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v 184 | 185 | # normalize http auth 186 | case "${MVNW_PASSWORD:+has-password}" in 187 | '') MVNW_USERNAME='' MVNW_PASSWORD='' ;; 188 | has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; 189 | esac 190 | 191 | if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then 192 | verbose "Found wget ... using wget" 193 | wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" 194 | elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then 195 | verbose "Found curl ... using curl" 196 | curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" 197 | elif set_java_home; then 198 | verbose "Falling back to use Java to download" 199 | javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" 200 | targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" 201 | cat >"$javaSource" <<-END 202 | public class Downloader extends java.net.Authenticator 203 | { 204 | protected java.net.PasswordAuthentication getPasswordAuthentication() 205 | { 206 | return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); 207 | } 208 | public static void main( String[] args ) throws Exception 209 | { 210 | setDefault( new Downloader() ); 211 | java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); 212 | } 213 | } 214 | END 215 | # For Cygwin/MinGW, switch paths to Windows format before running javac and java 216 | verbose " - Compiling Downloader.java ..." 217 | "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" 218 | verbose " - Running Downloader.java ..." 219 | "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" 220 | fi 221 | 222 | # If specified, validate the SHA-256 sum of the Maven distribution zip file 223 | if [ -n "${distributionSha256Sum-}" ]; then 224 | distributionSha256Result=false 225 | if [ "$MVN_CMD" = mvnd.sh ]; then 226 | echo "Checksum validation is not supported for maven-mvnd." >&2 227 | echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 228 | exit 1 229 | elif command -v sha256sum >/dev/null; then 230 | if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then 231 | distributionSha256Result=true 232 | fi 233 | elif command -v shasum >/dev/null; then 234 | if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then 235 | distributionSha256Result=true 236 | fi 237 | else 238 | echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 239 | echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 240 | exit 1 241 | fi 242 | if [ $distributionSha256Result = false ]; then 243 | echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 244 | echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 245 | exit 1 246 | fi 247 | fi 248 | 249 | # unzip and move 250 | if command -v unzip >/dev/null; then 251 | unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" 252 | else 253 | tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" 254 | fi 255 | printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" 256 | mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" 257 | 258 | clean || : 259 | exec_maven "$@" 260 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | <# : batch portion 2 | @REM ---------------------------------------------------------------------------- 3 | @REM Licensed to the Apache Software Foundation (ASF) under one 4 | @REM or more contributor license agreements. See the NOTICE file 5 | @REM distributed with this work for additional information 6 | @REM regarding copyright ownership. The ASF licenses this file 7 | @REM to you under the Apache License, Version 2.0 (the 8 | @REM "License"); you may not use this file except in compliance 9 | @REM with the License. You may obtain a copy of the License at 10 | @REM 11 | @REM http://www.apache.org/licenses/LICENSE-2.0 12 | @REM 13 | @REM Unless required by applicable law or agreed to in writing, 14 | @REM software distributed under the License is distributed on an 15 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | @REM KIND, either express or implied. See the License for the 17 | @REM specific language governing permissions and limitations 18 | @REM under the License. 19 | @REM ---------------------------------------------------------------------------- 20 | 21 | @REM ---------------------------------------------------------------------------- 22 | @REM Apache Maven Wrapper startup batch script, version 3.3.2 23 | @REM 24 | @REM Optional ENV vars 25 | @REM MVNW_REPOURL - repo url base for downloading maven distribution 26 | @REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven 27 | @REM MVNW_VERBOSE - true: enable verbose log; others: silence the output 28 | @REM ---------------------------------------------------------------------------- 29 | 30 | @IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) 31 | @SET __MVNW_CMD__= 32 | @SET __MVNW_ERROR__= 33 | @SET __MVNW_PSMODULEP_SAVE=%PSModulePath% 34 | @SET PSModulePath= 35 | @FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( 36 | IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) 37 | ) 38 | @SET PSModulePath=%__MVNW_PSMODULEP_SAVE% 39 | @SET __MVNW_PSMODULEP_SAVE= 40 | @SET __MVNW_ARG0_NAME__= 41 | @SET MVNW_USERNAME= 42 | @SET MVNW_PASSWORD= 43 | @IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) 44 | @echo Cannot start maven from wrapper >&2 && exit /b 1 45 | @GOTO :EOF 46 | : end batch / begin powershell #> 47 | 48 | $ErrorActionPreference = "Stop" 49 | if ($env:MVNW_VERBOSE -eq "true") { 50 | $VerbosePreference = "Continue" 51 | } 52 | 53 | # calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties 54 | $distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl 55 | if (!$distributionUrl) { 56 | Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" 57 | } 58 | 59 | switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { 60 | "maven-mvnd-*" { 61 | $USE_MVND = $true 62 | $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" 63 | $MVN_CMD = "mvnd.cmd" 64 | break 65 | } 66 | default { 67 | $USE_MVND = $false 68 | $MVN_CMD = $script -replace '^mvnw','mvn' 69 | break 70 | } 71 | } 72 | 73 | # apply MVNW_REPOURL and calculate MAVEN_HOME 74 | # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ 75 | if ($env:MVNW_REPOURL) { 76 | $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } 77 | $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" 78 | } 79 | $distributionUrlName = $distributionUrl -replace '^.*/','' 80 | $distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' 81 | $MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" 82 | if ($env:MAVEN_USER_HOME) { 83 | $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" 84 | } 85 | $MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' 86 | $MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" 87 | 88 | if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { 89 | Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" 90 | Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" 91 | exit $? 92 | } 93 | 94 | if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { 95 | Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" 96 | } 97 | 98 | # prepare tmp dir 99 | $TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile 100 | $TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" 101 | $TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null 102 | trap { 103 | if ($TMP_DOWNLOAD_DIR.Exists) { 104 | try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } 105 | catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } 106 | } 107 | } 108 | 109 | New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null 110 | 111 | # Download and Install Apache Maven 112 | Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." 113 | Write-Verbose "Downloading from: $distributionUrl" 114 | Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" 115 | 116 | $webclient = New-Object System.Net.WebClient 117 | if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { 118 | $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) 119 | } 120 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 121 | $webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null 122 | 123 | # If specified, validate the SHA-256 sum of the Maven distribution zip file 124 | $distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum 125 | if ($distributionSha256Sum) { 126 | if ($USE_MVND) { 127 | Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." 128 | } 129 | Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash 130 | if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { 131 | Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." 132 | } 133 | } 134 | 135 | # unzip and move 136 | Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null 137 | Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null 138 | try { 139 | Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null 140 | } catch { 141 | if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { 142 | Write-Error "fail to move MAVEN_HOME" 143 | } 144 | } finally { 145 | try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } 146 | catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } 147 | } 148 | 149 | Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" 150 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.example 6 | myproject 7 | 1.0.0-SNAPSHOT 8 | jar 9 | 10 | My Project 11 | https://example.com 12 | 13 | 14 | UTF-8 15 | 19 | 5.11.8 20 | 21 | 22 | 23 | 24 | 25 | org.yamcs 26 | yamcs-core 27 | ${yamcsVersion} 28 | 29 | 30 | 31 | org.yamcs 32 | yamcs-web 33 | ${yamcsVersion} 34 | 35 | 36 | 37 | 38 | 39 | 40 | org.apache.maven.plugins 41 | maven-compiler-plugin 42 | 3.13.0 43 | 44 | 17 45 | 46 | 47 | 48 | org.apache.maven.plugins 49 | maven-site-plugin 50 | 3.12.1 51 | 52 | 53 | org.yamcs 54 | yamcs-maven-plugin 55 | 1.3.5 56 | 57 | 58 | 59 | 60 | detect 61 | 62 | 63 | 65 | 66 | bundle-yamcs 67 | package 68 | 69 | bundle 70 | 71 | 72 | 73 | tar.gz 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-project-info-reports-plugin 87 | 3.4.3 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /simulator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import binascii 4 | import io 5 | import socket 6 | import sys 7 | import argparse 8 | 9 | from struct import unpack_from 10 | from threading import Thread 11 | from time import sleep 12 | 13 | parser = argparse.ArgumentParser(description='Yamcs Simulator') 14 | parser.add_argument('--testdata', type=str, default='testdata.ccsds', help='simulated testdata.ccsds data') 15 | 16 | # telemetry 17 | parser.add_argument('--tm_host', type=str, default='127.0.0.1', help='TM host') 18 | parser.add_argument('--tm_port', type=int, default=10015, help='TM port') 19 | parser.add_argument('-r', '--rate', type=int, default=1, help='TM playback rate. 1 = 1Hz, 10 = 10Hz, etc.') 20 | 21 | # telecommand 22 | parser.add_argument('--tc_host', type=str, default='127.0.0.1', help='TC host') 23 | parser.add_argument('--tc_port', type=int, default=10025 , help='TC port') 24 | 25 | args = vars(parser.parse_args()) 26 | 27 | # test data 28 | TEST_DATA = args['testdata'] 29 | 30 | # telemetry 31 | TM_SEND_ADDRESS = args['tm_host'] 32 | TM_SEND_PORT = args['tm_port'] 33 | RATE = args['rate'] 34 | 35 | # telecommand 36 | TC_RECEIVE_ADDRESS = args['tc_host'] 37 | TC_RECEIVE_PORT = args['tc_port'] 38 | 39 | def send_tm(simulator): 40 | tm_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 41 | 42 | with io.open(TEST_DATA, 'rb') as f: 43 | simulator.tm_counter = 1 44 | header = bytearray(6) 45 | while f.readinto(header) == 6: 46 | (len,) = unpack_from('>H', header, 4) 47 | 48 | packet = bytearray(len + 7) 49 | f.seek(-6, io.SEEK_CUR) 50 | f.readinto(packet) 51 | 52 | tm_socket.sendto(packet, (TM_SEND_ADDRESS, TM_SEND_PORT)) 53 | simulator.tm_counter += 1 54 | 55 | sleep(1 / simulator.rate) 56 | 57 | 58 | def receive_tc(simulator): 59 | tc_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 60 | tc_socket.bind((TC_RECEIVE_ADDRESS, TC_RECEIVE_PORT )) 61 | while True: 62 | data, _ = tc_socket.recvfrom(4096) 63 | simulator.last_tc = data 64 | simulator.tc_counter += 1 65 | 66 | 67 | class Simulator(): 68 | 69 | def __init__(self, rate): 70 | self.tm_counter = 0 71 | self.tc_counter = 0 72 | self.tm_thread = None 73 | self.tc_thread = None 74 | self.last_tc = None 75 | self.rate = rate 76 | 77 | def start(self): 78 | self.tm_thread = Thread(target=send_tm, args=(self,)) 79 | self.tm_thread.daemon = True 80 | self.tm_thread.start() 81 | self.tc_thread = Thread(target=receive_tc, args=(self,)) 82 | self.tc_thread.daemon = True 83 | self.tc_thread.start() 84 | 85 | def print_status(self): 86 | cmdhex = None 87 | if self.last_tc: 88 | cmdhex = binascii.hexlify(self.last_tc).decode('ascii') 89 | return 'Sent: {} packets. Received: {} commands. Last command: {}'.format( 90 | self.tm_counter, self.tc_counter, cmdhex) 91 | 92 | 93 | if __name__ == '__main__': 94 | simulator = Simulator(RATE) 95 | simulator.start() 96 | sys.stdout.write('Using playback rate of ' + str(RATE) + 'Hz, '); 97 | sys.stdout.write('TM host=' + str(TM_SEND_ADDRESS) + ', TM port=' + str(TM_SEND_PORT) + ', '); 98 | sys.stdout.write('TC host=' + str(TC_RECEIVE_ADDRESS) + ', TC port=' + str(TC_RECEIVE_PORT) + '\r\n'); 99 | try: 100 | prev_status = None 101 | while True: 102 | status = simulator.print_status() 103 | if status != prev_status: 104 | sys.stdout.write('\r') 105 | sys.stdout.write(status) 106 | sys.stdout.flush() 107 | prev_status = status 108 | sleep(0.5) 109 | except KeyboardInterrupt: 110 | sys.stdout.write('\n') 111 | sys.stdout.flush() 112 | -------------------------------------------------------------------------------- /src/main/java/com/example/myproject/MyCommandPostprocessor.java: -------------------------------------------------------------------------------- 1 | package com.example.myproject; 2 | 3 | import org.yamcs.YConfiguration; 4 | import org.yamcs.cmdhistory.CommandHistoryPublisher; 5 | import org.yamcs.commanding.PreparedCommand; 6 | import org.yamcs.tctm.CcsdsSeqCountFiller; 7 | import org.yamcs.tctm.CommandPostprocessor; 8 | import org.yamcs.utils.ByteArrayUtils; 9 | 10 | /** 11 | * Component capable of modifying command binary before passing it to the link for further dispatch. 12 | *

13 | * A single instance of this class is created, scoped to the link udp-out. 14 | *

15 | * This is specified in the configuration file yamcs.myproject.yaml: 16 | * 17 | *

18 |  * ...
19 |  * dataLinks:
20 |  *   - name: udp-out
21 |  *     class: org.yamcs.tctm.UdpTcDataLink
22 |  *     stream: tc_realtime
23 |  *     host: localhost
24 |  *     port: 10025
25 |  *     commandPostprocessorClassName: com.example.myproject.MyCommandPostprocessor
26 |  * ...
27 |  * 
28 | */ 29 | public class MyCommandPostprocessor implements CommandPostprocessor { 30 | 31 | private CcsdsSeqCountFiller seqFiller = new CcsdsSeqCountFiller(); 32 | private CommandHistoryPublisher commandHistory; 33 | 34 | // Constructor used when this postprocessor is used without YAML configuration 35 | public MyCommandPostprocessor(String yamcsInstance) { 36 | this(yamcsInstance, YConfiguration.emptyConfig()); 37 | } 38 | 39 | // Constructor used when this postprocessor is used with YAML configuration 40 | // (commandPostprocessorClassArgs) 41 | public MyCommandPostprocessor(String yamcsInstance, YConfiguration config) { 42 | } 43 | 44 | // Called by Yamcs during initialization 45 | @Override 46 | public void setCommandHistoryPublisher(CommandHistoryPublisher commandHistory) { 47 | this.commandHistory = commandHistory; 48 | } 49 | 50 | // Called by Yamcs *after* a command was submitted, but *before* the link handles it. 51 | // This method must return the (possibly modified) packet binary. 52 | @Override 53 | public byte[] process(PreparedCommand pc) { 54 | byte[] binary = pc.getBinary(); 55 | 56 | // Set CCSDS packet length 57 | ByteArrayUtils.encodeUnsignedShort(binary.length - 7, binary, 4); 58 | 59 | // Set CCSDS sequence count 60 | int seqCount = seqFiller.fill(binary); 61 | 62 | // Publish the sequence count to Command History. This has no special 63 | // meaning to Yamcs, but it shows how to store custom information specific 64 | // to a command. 65 | commandHistory.publish(pc.getCommandId(), "ccsds-seqcount", seqCount); 66 | 67 | // Since we modified the binary, update the binary in Command History too. 68 | commandHistory.publish(pc.getCommandId(), PreparedCommand.CNAME_BINARY, binary); 69 | 70 | return binary; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/example/myproject/MyPacketPreprocessor.java: -------------------------------------------------------------------------------- 1 | package com.example.myproject; 2 | 3 | import java.nio.ByteBuffer; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import java.util.concurrent.atomic.AtomicInteger; 7 | 8 | import org.yamcs.TmPacket; 9 | import org.yamcs.YConfiguration; 10 | import org.yamcs.tctm.AbstractPacketPreprocessor; 11 | import org.yamcs.utils.TimeEncoding; 12 | 13 | /** 14 | * Component capable of modifying packet binary received from a link, before passing it further into Yamcs. 15 | *

16 | * A single instance of this class is created, scoped to the link udp-in. 17 | *

18 | * This is specified in the configuration file yamcs.myproject.yaml: 19 | * 20 | *

21 |  * ...
22 |  * dataLinks:
23 |  *   - name: udp-in
24 |  *     class: org.yamcs.tctm.UdpTmDataLink
25 |  *     stream: tm_realtime
26 |  *     host: localhost
27 |  *     port: 10015
28 |  *     packetPreprocessorClassName: com.example.myproject.MyPacketPreprocessor
29 |  * ...
30 |  * 
31 | */ 32 | public class MyPacketPreprocessor extends AbstractPacketPreprocessor { 33 | 34 | private Map seqCounts = new HashMap<>(); 35 | 36 | // Constructor used when this preprocessor is used without YAML configuration 37 | public MyPacketPreprocessor(String yamcsInstance) { 38 | this(yamcsInstance, YConfiguration.emptyConfig()); 39 | } 40 | 41 | // Constructor used when this preprocessor is used with YAML configuration 42 | // (packetPreprocessorClassArgs) 43 | public MyPacketPreprocessor(String yamcsInstance, YConfiguration config) { 44 | super(yamcsInstance, config); 45 | } 46 | 47 | @Override 48 | public TmPacket process(TmPacket packet) { 49 | 50 | byte[] bytes = packet.getPacket(); 51 | if (bytes.length < 6) { // Expect at least the length of CCSDS primary header 52 | eventProducer.sendWarning("SHORT_PACKET", 53 | "Short packet received, length: " + bytes.length + "; minimum required length is 6 bytes."); 54 | 55 | // If we return null, the packet is dropped. 56 | return null; 57 | } 58 | 59 | // Verify continuity for a given APID based on the CCSDS sequence counter 60 | int apidseqcount = ByteBuffer.wrap(bytes).getInt(0); 61 | int apid = (apidseqcount >> 16) & 0x07FF; 62 | int seq = (apidseqcount) & 0x3FFF; 63 | AtomicInteger ai = seqCounts.computeIfAbsent(apid, k -> new AtomicInteger()); 64 | int oldseq = ai.getAndSet(seq); 65 | 66 | if (((seq - oldseq) & 0x3FFF) != 1) { 67 | eventProducer.sendWarning("SEQ_COUNT_JUMP", 68 | "Sequence count jump for APID: " + apid + " old seq: " + oldseq + " newseq: " + seq); 69 | } 70 | 71 | // Our custom packets don't include a secundary header with time information. 72 | // Use Yamcs-local time instead. 73 | packet.setGenerationTime(TimeEncoding.getWallclockTime()); 74 | 75 | // Use the full 32-bits, so that both APID and the count are included. 76 | // Yamcs uses this attribute to uniquely identify the packet (together with the gentime) 77 | packet.setSequenceCount(apidseqcount); 78 | 79 | return packet; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/yamcs/etc/processor.yaml: -------------------------------------------------------------------------------- 1 | realtime: 2 | services: 3 | - class: org.yamcs.StreamTmPacketProvider 4 | - class: org.yamcs.StreamTcCommandReleaser 5 | - class: org.yamcs.tctm.StreamParameterProvider 6 | args: 7 | streams: ["pp_realtime", "sys_param"] 8 | - class: org.yamcs.algorithms.AlgorithmManager 9 | - class: org.yamcs.parameter.LocalParameterManager 10 | config: 11 | subscribeAll: true 12 | persistParameters: true 13 | # Check alarms and also enable the alarm server (that keeps track of unacknowledged alarms) 14 | alarm: 15 | parameterCheck: true 16 | parameterServer: enabled 17 | tmProcessor: 18 | # If container entries fit outside the binary packet, setting this to true causes the error 19 | # to be ignored, otherwise an exception will be printed in Yamcs log output 20 | ignoreOutOfContainerEntries: false 21 | # Record all the parameters that have initial values at the start of the processor 22 | recordInitialValues: true 23 | # Record the local values 24 | recordLocalValues: true 25 | 26 | # Used to perform step-by-step archive replays to displays, etc 27 | Archive: 28 | services: 29 | - class: org.yamcs.tctm.ReplayService 30 | - class: org.yamcs.algorithms.AlgorithmManager 31 | 32 | # Used by the ParameterArchive when rebuilding the parameter archive 33 | ParameterArchive: 34 | services: 35 | - class: org.yamcs.tctm.ReplayService 36 | - class: org.yamcs.algorithms.AlgorithmManager 37 | 38 | # Used for performing archive retrievals via replays (e.g. GET /api/archive/{instance}/parameters/{name*}?source=replay) 39 | ArchiveRetrieval: 40 | services: 41 | - class: org.yamcs.tctm.ReplayService 42 | - class: org.yamcs.algorithms.AlgorithmManager 43 | config: 44 | subscribeContainerArchivePartitions: false 45 | -------------------------------------------------------------------------------- /src/main/yamcs/etc/yamcs.myproject.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | - class: org.yamcs.archive.XtceTmRecorder 3 | - class: org.yamcs.archive.ParameterRecorder 4 | - class: org.yamcs.archive.AlarmRecorder 5 | - class: org.yamcs.archive.EventRecorder 6 | - class: org.yamcs.archive.ReplayServer 7 | - class: org.yamcs.parameter.SystemParametersService 8 | args: 9 | producers: 10 | - fs 11 | - jvm 12 | - class: org.yamcs.ProcessorCreatorService 13 | args: 14 | name: realtime 15 | type: realtime 16 | - class: org.yamcs.archive.CommandHistoryRecorder 17 | - class: org.yamcs.parameterarchive.ParameterArchive 18 | args: 19 | realtimeFiller: 20 | enabled: true 21 | - class: org.yamcs.plists.ParameterListService 22 | - class: org.yamcs.timeline.TimelineService 23 | 24 | dataLinks: 25 | - name: udp-in 26 | class: org.yamcs.tctm.UdpTmDataLink 27 | stream: tm_realtime 28 | port: 10015 29 | packetPreprocessorClassName: com.example.myproject.MyPacketPreprocessor 30 | 31 | - name: udp-out 32 | class: org.yamcs.tctm.UdpTcDataLink 33 | stream: tc_realtime 34 | host: localhost 35 | port: 10025 36 | commandPostprocessorClassName: com.example.myproject.MyCommandPostprocessor 37 | 38 | mdb: 39 | # Configuration of the active loaders 40 | # Valid loaders are: sheet, xtce or fully qualified name of the class 41 | - type: xtce 42 | args: 43 | file: mdb/xtce.xml 44 | 45 | # Configuration for streams created at server startup 46 | streamConfig: 47 | tm: 48 | - name: "tm_realtime" 49 | processor: "realtime" 50 | - name: "tm_dump" 51 | cmdHist: ["cmdhist_realtime", "cmdhist_dump"] 52 | event: ["events_realtime", "events_dump"] 53 | param: ["pp_realtime", "pp_dump", "sys_param", "proc_param"] 54 | parameterAlarm: ["alarms_realtime"] 55 | tc: 56 | - name: "tc_realtime" 57 | processor: "realtime" 58 | 59 | -------------------------------------------------------------------------------- /src/main/yamcs/etc/yamcs.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | - class: org.yamcs.http.HttpServer 3 | args: 4 | port: 8090 5 | address: "0.0.0.0" 6 | cors: 7 | allowOrigin: "*" 8 | allowCredentials: false 9 | 10 | # This is where Yamcs will persist its data. Paths are resolved relative to where Yamcs is running 11 | # from (by default: target/yamcs). This means that `mvn clean` will remove also persisted data. 12 | # Change this property to an absolute path in case you want to persist your data. 13 | dataDir: yamcs-data 14 | 15 | instances: 16 | - myproject 17 | 18 | # Secret key unique to a particular Yamcs installation. 19 | # This is used to provide cryptographic signing. 20 | secretKey: changeme 21 | -------------------------------------------------------------------------------- /src/main/yamcs/mdb/xtce.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Octets 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 29 193 | 194 | 195 | 196 | 197 | 27 198 | 199 | 200 | 201 | 202 | 25 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | out0.setFloatValue(in.getEngValue().getFloatValue()); 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | -------------------------------------------------------------------------------- /testdata.ccsds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yamcs/quickstart/0773d97f3ebbc00e2868fe129b52642afc5bad4a/testdata.ccsds --------------------------------------------------------------------------------