Tutorial 3: Scepter-Javelin communication
Now that you have been introduced to Scepter and Javelin, and have become more
familiar with what they are and how they work, we can now build the workbench.
This tutorial will focus on preparing the database with all the relevant information
regarding the satellite and ground station couple for our workbench. We will then
go through the process of selecting a contact instruction and converting the
database information into a command ready to send in the next tutorial.
Installation and environment setup
For this tutorial, we will use the OSSO Tutorials environment. To configure the
environment, run the following commands from the base directory.
Workbench section 1: Scepter setup
Tutorial 1 showed us how to communicate with Scepter and gave a brief explanation
on the formats and inputs necessary. This tutorial will take that one step further
and take users through the creation of both a ground station and satellite in the
Scepter database, including the commands which will be sent. In the OSSO workbench
directory, this software is given in the form of packages named
new_satellite
and new_groundstation
, the third package given in the directory (scepter_other
)
provides other scepter endpoints not under the satellite or ground station sections
but useful for this tutorial and beyond. The following process is done using Python
function examples. Equivalent curl commands have been given, however, we do
recommend that for applying multiple commands at once, you use the Python scripts.Creating the ground station
The first thing we can do is create a ground station. For this, we will use the
ground station located at Sydney University, however, you may choose any ground
station you like and simply update the example input files to suit. Let's create
a new ground station!
First, we need to create the initial overview. This will essentially serve as our
frame which we can add the remaining components and information to. For our example,
we chose the USYD ground station, however, you may use any ground station you like.
To do so, simply update the JSON files in the examples directory or change the
file paths in the Python functions. The following function and JSON were used for
this step.
Following this, we can add the telecommunications information. Although this won't
be used for this workbench, it is a good thing to help grasp the concepts around
satellite operations. To do this, we used the following function and input.
Finally, we want to update our ground station's status to active. To do this,
the following function and JSON was used. Notice how the JSON requires a satellite
ID, for ours we placed one of our existing satellites, which was then updated
later on. For yours, we recommend that you create a satellite overview (steps
shown below) to get the satellite ID needed for this step.
Congratulations, you have now made a new ground station in Scepter.
Creating a satellite
Similar to the ground station, the first step in creating a satellite in Scepter
is to create the overview. This will generate and return a satellite ID which
should be saved as it will be used extensively later on. To complete this step,
the following function and JSON was used.
As mentioned, this will return a JSON containing a satellite ID. To make matters
easier later on, it is recommended that you save this in a variable via the
following lines.
Now we can start adding in extras to our satellite. Our first step will be to
add a new subsystem. This will hold the information about our satellite's On
Board Computer (OBC) which we will look to ping later. To add a subsystem, the
following Python function and JSON input is used.
Following on from this, we can also add our telecommunications information.
The next additions will be important to the workbench; these are the command,
script, and contact additions. The format of some of these are not set in stone,
however, the functions and process designed for this workbench are based on these
formats, so it is recommended that for an initial use, the following command
formats are maintained. To add a command to Scepter, use the following function
and input:
This command outlines the services and GraphQL command that we want to send to the
OBC. For all of them, we simply want to ping the service to check that each is
functioning. We put in other little bits of information such as the entry point and
the port numbers for records. When adding a new command, you can set the command
ID as seen above. It is worth keeping this as a variable for use later on.
In a similar way, a script can also be added to Scepter through the following.
Since we are not going to be using the script anywhere further on, we decided to
leave the
args
section blank, however you may add any JSON dictionary you like.Finally, we can create a contact for this satellite. This can be done through the
following.
Once this has run successfully, you will need to extract and save the contact ID
from the output. This can be done in a similar was as the satellite and ground
station IDs.
Finally, just like our ground station, we can update the status of our satellite
to show it is active.
Well done! You have now completed the first section of the workbench.
Workbench section 2: preparing for Javelin
To prepare the commands for Javelin, the following steps are undertaken:
- Grab the contact information from Scepter.
- Using this, grab the relevant information regarding the commands.
- Convert this information into the required format, ready to be used by Javelin.
Once we have set up our satellite and ground station, we can begin sending commands
to the satellite. Our first step is to select a contact for us to use in this
operation. This can be done through the following function.
If users wish to see a complete list of contacts, the following two functions will
provide the relevant information.
A contact contains all the information we need to communicate with our satellite.
It states which overpass and ground station we need to use, when this contact was
issued and dispatched, who issued the contact, and the instructions to be completed.
For this example, we will be completing the command instruction for the following
contact.
For tutorials 3 and 4, the overpass information will be neglected as we will be
sending our commands immediately. However, Tutorial 5 will upgrade this process
to account for the overpass requirements of this contact.
As stated, we will need the command instructions from this contact for our example.
This was done using the following function.
Once we have our list of instructions, we can sort them into command instructions
and script instructions. For the example above, we will have one of each. We
did this by using the following loop.
To grab the finer details of the command, we will use the following function to get
the specific command ID we want to execute. This function will also notify Scepter
that we have started to execute this command and to dispatch the instruction if it
has not already been done.
Once Scepter has been notified, we can now grab our command information and
convert it into a form that Javelin will understand. This is done through the
following function.
The command lines are what the
send_cmd_script.py
file used in the previous
tutorial use to communicate to the satellite.Congratulations, you have successfully used a contact in Scepter to prepare satellite
commands that are ready to be sent. This tutorial will now follow on to
Tutorial 4 where we will go through the setup of a
KubOS OBC (or placeholder) and send the commands.
Table of contents