This NASA OpenC3 COSMOS plugin is used to control and test the core Flight System (cFS) Flight Software (FSW). See the NASA/cFS documentation for all things cFS. See the OpenC3 documentation for all things OpenC3.
With this plugin, you can:
- Build and send commands to cFS
- Receive and view telemtry from cFS
- Run test suites for functional demonstration of the cFS
This plugin assumes two instances of the cFS are running (target names: CFS-1 and CFS-2),
and that COSMOS is connected to these instances via UDP.
CFS-1command / telemetry interface- receives commands from COSMOS on UDP port:
1234 - delivers telemetry to COSMOS on UDP port:
2234
- receives commands from COSMOS on UDP port:
CFS-2command / telemetry interface- receives commands from COSMOS on UDP port:
1235 - delivers telemetry to COSMOS on UDP port:
2235
- receives commands from COSMOS on UDP port:
The diagram below illustrates this expected network configuration.
Within each instance of the CFS target (CFS-1 and CFS-2) are:
- command and telemetry packet defintions
- telemetry screens for overviews of live telemetry
- a functional test suite (named
cfs_test_suite)- this is used to dempnstrate functionality of a single instance of the cFS (
CFS-1orCFS-2)
- this is used to dempnstrate functionality of a single instance of the cFS (
Additionally, there is a CFS_FLEET target that includes:
- command and telemetry overview screens
- a functional test suite (named
cfs_fleet_test_suite)- this is used to demonstrate functionality of two instances of cFS (
CFS-1andCFS-2together)
- this is used to demonstrate functionality of two instances of cFS (
This section outlines the basic setup steps for getting OpenC3 COSMOS running. In general, the OpenC3 COSMOS flow looks like this:
- Setup and Start OpenC3 COSMOS
- Build the NASA OpenC3 COSMOS Plugin
- Install the Plugin into OpenC3 COSMOS
This is necessary before you can build the NASA OpenC3 cFS COSMOS plugin.
- Install the OpenC3 COSMOS Project using their instructions.
- Update COSMOS Default Configs
- Configure UDP ports for COSMOS to receive telemetry from cFS
- To do this, add the
portsfield (shown below) to theopenc3-operatorservice incosmos-project/compose.yaml.openc3-operator: ports: - "127.0.0.1:2234:2234/udp" - "127.0.0.1:2235:2235/udp" - Note that, if OpenC3 COSMOS was already running, it must be restarted for these changes to take affect.
- To do this, add the
- Configure UDP ports for COSMOS to receive telemetry from cFS
- Start OpenC3 COSMOS (see OpenC3's documentation)
With OpenC3 COSMOS running, and openc3.sh in your PATH, the plugin can be build using the following command:
openc3.sh cli rake build VERSION=X.Y.Z
Notes:
- Use
openc3.batfor Windows - VERSION is required (example:
VERSION=1.2.3) - gem file will be built locally
Navigate to http://localhost:2900 in a web browser to access the OpenC3 COSMOS UI.
- Go to the OpenC3 Admin Tool, Plugins Tab
- Click the paperclip icon and choose your plugin.gem file
- Fill out the plugin parameters:
cfs_mem_addr_size- Default:
64 - If running a 32-bit system, use
32
- Default:
cfs_endianness- Default:
LITTLE_ENDIAN - If running on a big endian system, use
BIG_ENDIAN
- Default:
cfs_1_intf_ipandcfs_2_intf_ip:- Default:
172.17.0.1- This should match the IP address listed for the default docker network bridge (docker0) - You can use the following to find this info:ifconfig docker0 | grep "inet " | awk '{print $2}' - This field should match the IP address COSMOS should connect to when reading/writing to the FSW command/telemetry streams
- Default:
global_tlm_output_ip:- Default:
127.0.0.1 - This should match the IP address that cFS should send telemetry to
- This is often used in the Telemetry Output Enable command
- Default:
- Click "Install"
This section describes common ways users interact with the cFS with this plugin.
Using the browser / OpenC3 COSMOS UI, enable telemetry.
- Open the Command Sender
- From the "Select Target" dropdown, select the CFS target (
CFS-1orCFS-2). - From the "Select Packet" dropdown, select the TO Enable Output command (
TO_LAB_CMD_ENABLE_OUTPUT).
From this "Command Sender" page, many other cFS commands can be built and sent.
Once this TO_LAB_CMD_ENABLE_OUTPUT command is sent,
the cFS bundle should start transmitting requested telemetry data from the cFS apps to COSMOS.
See the next section, "View cFS Telemetry", to confirm the command succeeded.
Using the browser / COSMOS UI, open the relevant telemetry screens.
- Open the Telemetry Viewer
- From the "Select Target" drop-down, select the
CFS_FLEETtarget - From the "Select Screen" drop-down, select the
CFS_FLEET_OVERVIEWtelmetry screen
This CFS_FLEET_OVERVIEW screen (screenshot shown below) displays
an overview of the housekeeping telemetry flowing from each cFS instance.
There are also buttons to send simple commands to each cFS application:
Send Hk- requests a new housekeeping packet from the cFS appNo-Op- sends a "no-operation" command, which should increment the cFS app's Command CountReset- sends a "reset counters" command, which should clear the counters for the cFS app
Additionally, each cFS target (CFS-1 and CFS-2) includes housekeeping telemetry screens.
This cfs_test_suite, found within the procedures directory of the CFS-1 and CFS-2 targets,
includes functional tests to exercise features of a single cFS instance.
To run this test:
- Open the Script Runner
- Open the file:
CFS-1orCFS-2>procedures>cfs_test_suite.py
- Click the "Start" button, to the right of the "Suite" drop-down
This cfs_fleet_test_suite, found within the procedures directory of the CFS_FLEET target,
includes functional tests to exercise features that require multiple cFS instances.
To run this test:
- Open the Script Runner
- Open the file:
CFS_FLEET>procedures>cfs_fleet_test_suite.py
- Click the "Start" button, to the right of the "Suite" drop-down
We encourage you to contribute to both cFS and OpenC3!
Contributing is easy.
- Fork the project
- Create a feature branch
- Make your changes
- Submit a pull request
Before any contributions can be incorporated we do require all contributors to agree to a Contributor License Agreement. This protects both you and us and you retain full rights to any code you write.
This NASA OpenC3 COSMOS cFS plugin is released under the Apache 2.0 License. See LICENSE.txt

