Mission Operations - cubesat-project/CubeSat GitHub Wiki

Current Status (Summer 2020)

The user authentication platform will be switched from AWS Cognito to Google Firebase. The reasoning behind the switch is because AWS does not have a free tier for development and it will be too cost prohibitive once operations begin.

The MySQL database will be switched to Heroku for the same reasons listed above.

Implemented Functionality

  • Develop secure log-in portal for mission operators and administrators, utilizing AWS Cognito
  • Administrative users can maintain all other system users. This entails viewing users, creating new users, deleting users, changing user permissions (i.e. modifying if user is an admin or not), and requesting that a user update their password on next login
  • Develop ground station server that watches for new data-dumps from the CubeSat and sends those data-dumps to the main application server for processing
  • Data-dumps are processed on the main application server. This means that the telemetry data is inputted into storage (an AWS RDS MySQL instance) and is filtered for anomalies, i.e. any reported telemetry values above or below the pre-set limit will be labelled accordingly
  • All anomalies are displayed to the users in a searchable, paginated, and sortable table
  • All users can subscribe to systems in which they are interested in receiving real-time anomaly alerts via SMS (utilizing Twilio SMS service)
  • All users have the ability to add new telecommands. Telecommands can be created and archived, but never permanently deleted in the case that a user wishes to view the telecommand details of past queue uplinks. Telecommand creation entails specifying the bandwidth usage of the actual telecommand during uplink, and the power consumption required to execute the telecommand on the CubeSat, as well as a priority option and command details
  • Users have the ability to add pre-set telecommands to a "batch". A batch is like a set of telecommands that is frequently used together. This allows ease of use for the mission operators to add related telecommands to the queue.
  • Users have the ability to view past and future telecommand queues. Each telecommand queue is associated with a pass of the CubeSat. Each future telecommand queue is mutable in the sense that a user can add/remove telecommands to/from the queue. Past telecommand queues cannot be altered
  • Along with viewing telecommands to be uplinked, users can view which telecommands will be executed on the CubeSat between the pass selected and the next pass
  • Users have the ability to view telemetry data in a dashboard style layout, organized by system. Graphical representations are shown with their respective upper and lower limits, which utilizes High Charts
  • When viewing telemetry data received from the CubeSat, the user also has the option to specify a time period in which they are interested in viewing data
  • The user functionality for viewing 360-degree images and videos (payload data) is available
  • During the setup of the mission operations portal prior to launch and during testing in the future, administrators have the ability to input all of the initial systems, components, and telemetries that we will be receiving housekeeping data from, along with their telemetry types and the upper and lower bounds of each telemetry, if they exist. These are modifiable in the future incase of any changes

User Manual

Administrator Functionalities

Manage users
Add new user
  1. On the right of the navigation bar at the top of the screen, click your name to view the drop-down menu.
  2. Select “Manage Users”.
  3. Click “Add New User” at the top right.
  4. Fill out the required information, and specify if this user account will have administrator privileges or not. This is modifiable later on.
  5. Click “Create” or “Cancel” once complete.
Edit user or force password reset
  1. On the right of the navigation bar at the top of the screen, click your name to view the drop-down menu.
  2. Select “Manage Users”.
  3. Select “Edit” beside the user you’d like to force the password reset upon. a. Select “Reset Password” and you’ll either see a success or error message. If successful, on the user’s next login, they will be prompted to reset their password. b. Edit any fields or change their admin privileges.
Manage system inputs
  1. On the right of the navigation bar at the top of the screen, click your name to view the drop-down menu.
  2. Select “Manage System Inputs”.
  3. Select a predefined system, component, component telemetry, or telemetry type to edit or delete it. Note that all children of a system and component will be deleted if you delete the parent; i.e. if you delete “ADCS” all of its components and all of the component telemetries of each component will be deleted as well.
  4. To add a system, component, or component telemetry, navigate to its respective position in which you’d like to add it (i.e. if you want to add component telemetry X to component Y and system Z, you’ll need to select system Z and then component Y) and then specify its lower and upper bound (if applicable), and it’s telemetry type.
  5. To add a telemetry type, simply select “Add” under the telemetry types listing and specify the name and unit associated with the type.

General User Functionalities

Edit profile
  1. On the right of the navigation bar at the top of the screen, click your name to view the drop-down menu.
  2. Select “Edit Profile”.
  3. Update your name, phone number, change your password, or modify your preferred contact method.
  4. Select “Save Changes” or “Return Without Saving” to go back to the last page you accessed.
Anomaly subscriptions
  1. On the right of the navigation bar at the top of the screen, click your name to view the drop-down menu.
  2. Select “Manage Anomaly Subscriptions”.
  3. Select “Subscribe” or “Unsubscribe” respectively beside each system based on your current subscription status. If you don’t have a phone number for SMS alerts, this will be irrelevant, so ensure that you have one registered.
Manage telecommands
Add a telecommand
  1. On the navigation bar at the top of the screen, select “Telecommands”.
  2. Select “Add New Telecommand”.
  3. Fill in all specification details. Note that these cannot be edited, so make sure you’ve typed everything properly!
  4. Select “Save Changes”.
Archive a telecommand
  1. On the navigation bar at the top of the screen, select “Telecommands”.
  2. Select the telecommand.
  3. Select “Archive”. This will remove the telecommand from the interface but will still be stored in the backend for logging purposes.
Modify telecommand batches
Add new telecommand batch
  1. On the navigation bar at the top of the screen, select “Telecommand Batches”.
  2. Select “Add New Telecommand Batch”.
  3. You’ll see a new batch listed on the left called “New Telecommand Batch”. Select it and move onto the section below, Edit Telecommand Batch, to edit it.
Edit/remove telecommand batch
  1. Follow the instructions for Add New Telecommand Batch above.
  2. Select a telecommand batch from the list on the left of the “Telecommand Batches” page.
  3. Edit the name of the batch in the topmost text box and press “Save Name”.
  4. Add new telecommands to the batch by choosing a pre-existing telecommand from the dropdown menu and selecting “Add Telecommand To Batch”.
  5. Once a telecommand is added to the batch, it can be edited or removed. After adding a new telecommand to a batch, its parameter values must be set, as the JSON values are empty upon creation. The execution time of any new telecommands must be set as well. Execution times of a telecommand within a telecommand batch are relative to the execution time set when the batch as a whole is added to the queue. For instance, if you specify the relative execution time of a telecommand X to be 5 minutes, and you add the batch to the queue at execution time 01:00:00 UTC, telecommand X will execute at 01:05:00 UTC.
  6. Select any telecommand in the batch to delete it by pressing “Delete Preset Telecommand”. This does not delete the telecommand from the collection of preset telecommands, only from the batch itself.
  7. Save any changes to your telecommands in the batch selected by selecting “Save Changes”.
  8. Delete the batch by selecting “Delete Batch” on the selected batch.
Add telecommands to queue
Add a preset telecommand
  1. On the navigation bar at the top of the screen, select “Queue”.
  2. Select “Add Telecommand to Queue”.
  3. Select the preset telecommand that you wish to add from the dropdown selector.
  4. Fill in the required parameter values.
  5. Select whether or not this telecommand is a high priority command, i.e. should be sent up first in the transmission.
  6. Set the execution date-time of the telecommand in UTC by typing the datetime or selecting from the dropdown calendar view.
  7. Select “Add to Queue”.
  8. Note that you cannot change the user field; this is a read-only field which logs your user account with the addition of this telecommand to the queue.
Add a telecommand batch
  1. On the navigation bar at the top of the screen, select “Queue”.
  2. Select “Add Telecommand Batch to Queue”.
  3. Select the batch you’d like to add from the dropdown selection.
  4. Specify the execution datetime in UTC; remember all telecommands in the batch will execute at times respective to the one set here.
  5. Select “Add to Queue”.
View anomalies
  1. On the navigation bar at the top of the screen, select “Anomalies”.
  2. By default, anomalies are sorted by most recent. You can change the ordering of any column by clicking the column name to flip between ascending and descending.
  3. Use the search bar to filter the anomalies.
View telemetry
  1. On the navigation bar at the top of the screen, select “Telemetry”.
  2. Select a system on the left to view its components.
  3. Select a component from the selected system to view all of its component telemetries.
  4. Filter by datetime in UTC by specifying a start and end time from the dropdown calendar selector and press “Refresh” to view the updated results.

Installation Guide

Application Installation

Setting up global system dependencies
  • Install Node.js via the installer available on their website [23]. This also installs npm.
  • Install Git via the installer available on their website [24]. On Windows machines this will also install the Git Bash terminal program.
Setting up the application repository locally
  • After setting up global system dependencies, you may proceed with setting up the application Git repository locally.
  • Open Terminal (Mac/Linux) or Git Bash (Windows).
  • Navigate to the directory you want to put the application code in using the following command:
cd ~/[your directory here]
  • Clone the Git repository using the following command:
git clone https://github.com/cubesat-project/CubeSat.git
  • Navigate to the frontend directory in the repository by running the following command:
cd ~/[your directory here]/CubeSat/MC/frontend/mission-ops
  • Install all of the dependencies required by the frontend with the following command:
npm install
  • Navigate to the backend directory in the repository by running the following command:
cd ~/[your directory here]/CubeSat/MC/backend/cubesat-appserver
  • Install all of the dependencies required by the backend with the following command:
npm install
  • To set up the ground station, see the instructions listed below in the Ground Station Installation section.
Configuring AWS access for your machine
  • Login to the AWS Console with the username and password provided for the CubeSat team.
  • Navigate to the RDS link.
  • Select “Databases” on the left.
  • Select “cubesatdb-2” in the Databases table.
  • Scroll down to “Security group rules”.
  • Select the first listing of type “EC2 Security Group - Inbound”.
  • Scroll down and select the “Inbound” for this security group.
  • Click “Edit”.
  • Click “Add Rule” and select Type: “MySQL/Aurora”, Protocol: TCP, Port Range: 3306, Source: My IP, and Description: {your_name}-{your_location}.
  • Click “Save”.
Starting the application
  • After setting up the application repository locally, you may proceed with starting the application.
  • Open two instances of Terminal (Mac/Linux) or Git Bash (Windows).
  • In the first instance:
    • Navigate to the backend directory by entering the following command:
cd ~/[your directory here]/CubeSat/MC/backend/cubesat-appserver
* Start the backend server by entering the following command:
node server.js
  • In the second instance:
    • Navigate to the frontend directory by running the following command:
cd ~/[your directory here]/CubeSat/MC/frontend/mission-ops
* Start the frontend application by entering the following command, which will also open the application in a browser window:
ng serve -o

Ground Station Installation

Setting up the Raspberry Pi
  • Follow the instructions found at https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up/2 to initially set up your Raspberry Pi. This instruction set details the hardware peripherals required to interact with the Pi as well as how to install Raspbian, the required operating system.
  • Ensure that the timezone selected is Greenwich Time (UTC) during the initial setup.
  • Ensure that the Pi has Wifi connectivity, either through a Wifi dongle or just on the Pi itself.
Setting up Node.js on the Pi
  • Open an instance of the Terminal application.
  • Type uname -m to verify the chipset that the Pi is based on.
    • This application requires at least Node version 11, which can only run on ARMv7 or later.
  • If the chipset is compatible with the Node server that will be running on the Pi, we can retrieve an installation of Node version 11 by entering:
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E
  • Once the NodeSource package repository has been added through the previous command, the following command will install Node.js:
sudo apt-get install -y nodejs
  • Once Node.js completes installing, verify that Node and npm have both been installed by running the following commands:
node -v 
npm -v
Troubleshooting
  • “node -v’ returns with ‘command not found’: This means that a symlink was not properly established when Node.js was installed. To establish a proper link, run the following command:
ln -s /usr/bin/nodejs /usr/bin/node

or

ln -s /usr/local/bin/nodejs /usr/local/bin/node
Initializing the server on the Pi
  • Once Node.js has been installed on the Pi, the Git repository containing the ground station needs to be added to the device.
  • Open a Terminal instance and run the following command to be in the Desktop directory:
cd ~/Desktop
  • Once in the Desktop directory, clone the Git repository into a folder on the Desktop by running the following command:
git clone https://github.com/cubesat-project/CubeSat.git
  • Once the repository is cloned, navigate to the ground station server code by entering the following command:
cd CubeSat/MC/ground_station
  • Now in the ground station server code, you will need to install server dependencies before being able to start the server. Node makes this very easy through the package.json file and the npm module. Running the following command will install all dependencies automatically:
npm install
  • Once this command has completed, the Pi will have all of the necessary Node modules to run the server. Still in the ground_station directory in Terminal, run the following command to start the server:
node server.js
Troubleshooting
  • ‘Cannot find module inotify’: this means that a server dependency was missed on the initial install. This module handles the filesystem events. To install this dependency, run the following command:
npm install dev
Simulating a data dump from the CubeSat
  • Start the server (see above instructions).
  • In the ground_station/test directory in the CubeSat Git repository, there is a committed file called sample_dump.json. Open this file and modify the dates of each item to correspond with a legitimate date for the pass you will be simulating. (i.e. The date times must be between the last “past” pass actual date-time and the first “future” pass estimated date-time.)
  • Copy this file to the clipboard.
  • In the ground_station directory, there is a file called constants.js which will contain the directory that is being watched by the server, denoted by DATA_DUMP_WATCH_DIR. Open the directory defined by that constant in a Files window.
  • Paste the sample_dump.json file into this directory. This will start the simulation.
    • Outcomes: the sample_dump.json file should be saved to the DATA_DUMP_BACKUP_DIR in a folder denoted by the date-time stamp the simulation occurred at. Texts should be sent to the subscribed users if there are anomalies in the sample. The first “future” pass should now be marked as a “past” pass, and the telemetry and anomalies (if any) should be available in the Anomalies and Telemetry pages.
Connecting the ground station server to the application server
Ground station to application
  • Determine the application server IP address.
    • This can just be the deployed server URL if deployed, or if you are running the server locally via localhost, you can navigate to your System Preferences/Settings to find your current IP address.
  • Within the ground_station directory in the CubeSat Git repository, there is a file named constants.js. This file includes all of the constant path values and addresses the server uses. Open this file in a text editor on the Pi.
  • Locate the APP_SERVER_HOST constant definition in the file. The constant should be associated with some IP address as a string. Replace the current IP address with the application server IP address determined above.
  • Locate the APP_SERVER_PORT constant definition in the file. The constant should be associated with some port number as a string. Ensure that the port the application server is running on matches the port defined here.
  • Start the server (see above instructions) and simulate a data dump (see above instructions) to ensure this connection is functioning properly.
Application to ground station
  • Determine the ground station server IP address.
    • This can be found on the Raspberry Pi by opening a Terminal window and running the following command:
ifconfig
* Note the IP address listed at _wlan0_ or _eth0_; this will be the IP address of the server.
  • Within the frontend/environments directory in the CubeSat Git repository, there is a file names environments.ts. This file includes global system constants. Open this file in a text or code editor.
  • Locate the groundStationIP constant value in the file. The constant should be a URL with a port number as a string (ex. ‘http://10.0.0.8:3700’). Replace the current IP address in the string (the ‘10.0.0.8’ part) with the IP address of the ground station server determined previously.
  • If the ground station server is running on another port, you will have to change the port number in the string as well (the ‘3700’ part). To check this, navigate to the ground_station directory and to the constants.js file, and check the value assigned to PORT. Make sure the port number at the end of the groundStationIP string and the number at PORT are the same.
  • Start the server (see the above instructions) and save a transmission queue to check if the connection works properly.
    • Saving a transmission queue is through the front-end of the application. Navigate to the Queue tab and click on any Pass listed under Future in that page. Once a Pass is clicked, the Transmission Queue will appear with a ‘Save to Ground Station’ button. Click this button to send a queue object (it will still send if it is empty).

Application API Documentation

Generating API documentation
  • Open an instance of Terminal (Mac/Linux) or Git Bash (Windows).
  • Navigate to the frontend directory by running the following command:
cd ~/[your directory here]/CubeSat/MC/frontend/mission-ops
  • The API documentation generator, Compodoc, is a development dependency. To install development dependencies, run the following command:
npm install dev
  • Generate the documentation by running the following command, which will open the documentation in a browser window:
compodoc -s -o

Link to CubeSat Interaction Diagram: https://drive.google.com/file/d/1LWpN9IF0Nl5tfu6YKTqzyEgaTpC9s_A8/view?usp=sharing