Tutorial 2: Javelin setup and configuration
This tutorial will outline how to install, set up, and use Javelin on your
computer. This will include information on the required software, a shell script
to automate a lot of the setup, and examples on how to use some of the tools at
Javelin's disposal including how to send a command using GraphQL.
Installation
To install Javelin, either clone the repository or download it as a ZIP file from
the GitLab repository. It would also be a good idea to download the
javelin-scripts
repository as that contains some helpful examples that extend beyond the scope
of these tutorials. You should also ensure that you have Python 3.9+, GraphQL, and
GNU Radio installed as these are required for some tools. Some helpful links for
these are given below.Environment setup
There are five main steps to installing and configuring Javelin to your system.
These will be outlined step-by-step below, however, they will also be placed into
a shell script file which can be run directly from the main Javelin directory.
Step 1: Make the virtual environment and install requirements
Step 2: Rename TLE file
Step 3: Make log files
Step 4: Make data log directory
Step 5: Make groundstation control logs
These are separate from the logs created in step 3 and hold different information
on the Groundstation control tools.
Using Javelin
Javelin has four main modes of operation. This tutorial will take you through
one of those modes and will give a brief explanation on the other three modes.
It is recommended that a “satellite” (in this case a Beaglebone Black (BBB)
running Kubos) is set up and configured to connect however it is not necessary
to complete this tutorial.
To configure your “satellite”, go to the source folder and open the file titled
config.py
. This is where the network connection information for the “satellite”
and the host machine. This file has the following structure;Line numbers | Description |
---|---|
2 → 4 | Ground Station position (Longitude, Latitude, Altitude). |
7 → 8 | "Satellite" Command network connection settings (IP and port number). |
13 → 16 | File Transfer Protocol (FTP) connection settings (“Satellite IP and port, Host IP and port). |
23 | Ground station view above the horizon. |
29 → 30 | Radio Settings (Gain, etc). |
35 | Setting to save local copies of the Wave files (True/False). |
Along with this, you will need to update the port mapper dictionary in the
source/commands/utils.py
file so they match those used by your KubOS System.
This is also explained in the README.Modes of operation
As mentioned, Javelin has four main modes of operation. A brief overview of these
modes is given below.
GraphQL commands over a network
This mode of motion sends GraphQL commands to the
'satellite' via a network connection. It requires you to configure the correct
network settings into Javelin before operating.
RF emulator link
This mode uses a BBB radio emulator (run on the BBB) to take messages in the
CubeSat Space Protocol (CSP)
packet format. This is the mode that this tutorial uses and is what the majority
of examples provided in both the Javelin and Javelin Scripts repositories use.
RF link
This mode is Javelin's staging tool. It is aimed at users who have developed the
applications and commands using the previous two modes of motion. A GNU radio
file is provided in the
flowgraphs
directory of Javelin to give a generic example.Full tracking mode
This mode is reserved for use once your satellite has been launched. The Javelin
repository contains all the required tools for you to autonomously track and send
data to your spacecraft.
Javelin examples
Sending a command
The first example will use the RF emulator link mode of operation to send a ping
to the BBB's app service.
The first step in this process is to turn the radio emulator on. This can be done
by one of the following methods. In the terminal, run the following command.
or run the following shell script file
Once our radio is on, we can build our command file that we're going to send to
the satellite. Since we want to ping the app service, we're going to use a
GraphQL query. We are going to have 3 attempts with a 5-second timeout on each
attempt. This is structured within the text file as follows:
To send the file, we can put this into the terminal within the
javelin-main
directory.Our terminal will then begin to print the following:
Let's see what happens if we get no response.
As we can see, there were three attempts at sending the ping message. For each
attempt, our log shows that after 5 seconds, Javelin told us there was no response
before sending an error message.
Ground station antenna rotation
The next examples will take us through some other tools available in the
Javelin toolkit. All of these tests will be done via a local setup, however the
methods and functions used will work in a remote operation case as well.
The next example will take users through the use of the antenna rotation control
suite. To do this, we will split our screen into 3 sections structured the
following way.
This portion of the screen will hold a terminal window. From here, we can run our dummy ground station antenna which can be found in the javelin-main/scripts directory under start_rotctl_dummy.sh. | In the final portion of the screen, we can run our set position function. This script forms a continuous loop which takes terminal inputs for the new azimuth and elevation. To exit the loop, simply type "no" when prompted to set a new position. The script for this file has been provided at the end of this tutorial along with the other additional resources. |
Underneath the dummy, we can run the monitor position script. This can be found in the javelin-main/rotor_utils/rotctl directory under monitor_position.sh. This script connects to the dummy and returns the ground station's azimuth and elevation at 5 second intervals |
When running all of these, starting with the dummy, followed by the position
monitor and finally running the position setting loop, the screen should look
similar to the following.
Conclusion
Congratulations, this completes the second tutorial. The
next tutorial will focus on configuring both Scepter and Javelin
to communicate with each other and allow us to form the first link in our
engineering workbench.
Additional resources
List of required directories and files for manual creation
.../javelin-main/logs/commands/command.log
.../javelin-main/logs/control/control.log
.../javelin-main/logs/rigctl/rigctl.log
.../javelin-main/logs/rotctl/rotctl.log
.../javelin-main/logs/kubos_ftp/download
.../javelin-main/logs/kubos_ftp/upload
GraphQL command file input format
Below is a script that shows off some commands and provides some code to
help users get started.
This code creates a file named Test_Command.txt which is displayed below:
Javelin installation file
This shell script is also provided in the support code for this tutorial.
Ground station rotation setter
Below is the script containing the loop used in the ground station antenna rotation
example. This was created using Python 3.9+. The file paths in this will need to
be updated to match those on your device.
Table of contents