- Muchas notas - Fran Acién

20240320 - Ground segment - Workshop 1 - Define you OpenC3 COSMOS system

TODO: Write an explanation about how to define your telemetry and telecomands with OpenC3 COSMOS.

This guide will show you how to create your OpenC3 COSMOS system. OpenC3 COSMOS software as the ground segment software. It is explain in the previous guide 20240320 - Ground segment - Workshop 1 - Overview of the system. For each target device that we would like to operate on COSMOS we would need to create a plugin, representing the target system. This will have all the information about possible telemetry, telecommands, how to connect to the device, and some other information.

How to add you system with a plugin

Plugins are how we add targets and microservices to COSMOS. You can follow the official documentation to build your system plugin. In this guide we will explain more briefly the steps that needs to be followed.

You need to keep in mind that you dont need to deploy your instance of OpenC3 COSMOS on your machine because we will be using the software on the cloud. But is necessary to specify our target system.

We will start by downloading the latest release of OpenC3 COSMOS

$ git clone https://github.com/openc3/cosmos-project
$ git checkout 7ef8d3982f6de6b663fa50f24d51cc7f91d25159 # Optional
$ cd cosmos-project
$ export PATH=$PATH:`pwd`
$ vim .env

Replace: OPENC3_TAG=5.15.0 -> Remote cosmos instance 5.12.0 OPENC3_LOCAL_MODE=1 OPENC3_DEMO=1

$ cosmos-project/openc3.sh cli generate plugin BOB
$ cd openc3-cosmos-bob
$ openc3.sh cli generate target BOB

The structure of the folder would look like:

├── LICENSE.txt
├── openc3-cosmos-bob.gemspec
├── plugin.txt
├── Rakefile
├── README.md
└── targets
    └── BOB
        ├── cmd_tlm
        │   ├── cmd.txt
        │   └── tlm.txt
        ├── lib
        │   └── bob.rb
        ├── procedures
        │   └── procedure.rb
        ├── screens
        │   └── status.txt
        └── target.txt

We need to modify 3 files:

  • openc3-cosmos-bob/plugin.txt
  • openc3-cosmos-bob/targets/BOB/cmd_tlm/cmd.txt
  • openc3-cosmos-bob/targets/BOB/cmd_tlm/tlm.txt

The file openc3-cosmos-bob/plugin.txt indicates what interface is going to be used when the target system is interfacing the OpenC3 COSMOS software and viceversa. As our ground segment software is deployed on the cloud, we need to specify OpenC3 COSMOS to act as a TCP server to listen incomming clients.

# Set VARIABLEs here to allow variation in your plugin

VARIABLE bob_target_name BOB

TARGET BOB <%= bob_target_name %>
INTERFACE <%= bob_target_name %>_INT tcpip_server_interface.rb 8002 8002 10.0 nil BURST
  MAP_TARGET <%= bob_target_name %>
$ openc3.sh cli rake build VERSION=1.0.0

We can go to our server and upload our plugin.

Send dummy data to your plugin

We can send some dummy data to test that the plugin was installed, and the server is hearing for incoming data.

netcat insightsat.com 8002

If we go to TLM Packets > UNKNOWN, we will see that we are receiving the data as incorrect.