Flight software for the GASPACS mission written in Python, with some compents in c.
The Get Away Special Passive Attitude Control Satellite (GASPACS) is an experimental 1U cubesat in development by Utah State University's Get Away Special team. The purpose of the experiment is to test the viability of an inflatable aero-stabilization boom deployable component in Low Earth Orbit (LEO). This repository contains CubeWorks, the flight software for the satellite. The CubeWorks software module is designed to run on a Raspberry Pi Zero W running Raspbian lite os as its operating system.
CubeWorks is intended to be a robust, modular, and fault tolerant software framework for small satellites, with minimal barrier to entry. The experienced developer may be asking, "Why write the entire framework in python and not a more performant language with closer hardware interaction?" The answer is because the framework is designed to be accessible to newer developers who want to get into space research. The software isn't as performant as an equivalent solution written in, say, c++ but it isn't designed to be.
Framework components are designed to be modular, and easy to add to and remove from a given system. All that is needed is to define a driver that interacts with your hardware components and inherits from the built in Component
class, and include it in the main file.
- Download the CubeWorks Raspbian Lite image V6
- Flash image onto 8GB micro SD card
- Run image on Raspberry Pi Zero W
- Log in (email coordinator@gas.usu.edu if you do not have the login password)
- IMPORTANT: Make sure to enable the Serial port via raspi-config. Also update the chronodot time (see Software Unit Testing Procedure document for instructions)
- Run
./install.exe
- Use
htop
and check to see in main flight logic is running
git clone https://github.com/SmallSatGasTeam/ssdv
cd ssdv
make
nano ~/.bashrc
- Add the following line to the bashrc file:
export PATH=$PATH:/home/pi/ssdv/ssdv
- Reboot the pi, and make sure you can run
ssdv
from any spot on the pi
git clone https://github.com/SmallSatGasTeam/ssdv
cd ssdv
make
nano ~/.bashrc
- Add the following line to the bashrc file:
export PATH=$PATH:/home/pi/ssdv
- Reboot the pi, and make sure you can run
ssdv
from any spot on the pi
- Image a Raspberry Pi with Raspbian lite and boot the Pi
- Use
sudo raspi-config
to set the proper network settings, set a user password, localisation options. - Under Interfacing Options enable Camera, SSH, SPI, I2C, and Serial ("No" to login shell, "Yes" to serial interface)
- Update all packages with the commands:
sudo apt update
sudo apt full-upgrade
- Reboot, install the following dependencies:
- Python3,
sudo apt install python3
- python3-pip,
sudo apt install python3-pip
- NumPy,
sudo apt install python3-numpy
- Python3,
- Create the exe file to run for the installation process, run "gcc install.c -o install.exe"
- run "./install.exe"
- To run the testMainFlightLogic.py file (or any other program) on startup, run
sudo crontab -e
and then add the following line to the end of the file:@reboot sudo runuser pi -c "cd ; ./startup.exe"
.
This file structure comprises the major compoments of CubeWorks.
- Get the updateCode.c (it should be in any of the cubeworks repositories.)
- use this command
gcc upDateCode.c -o upDateCode.exe ; cp upDateCode.exe ~/ ; rm upDateCode.exe
- return to the root and then use
./upDateCode.exe
-TX windows have to be seperated by at least 25 seconds. This is the time from ending one window to the start time of the next window. If it is not separated by this buffer, then it is NOT guaranted that the TX window will be serviced.
- Ensure chronodot is connected to the pi and is powered on.
- Edit the file
/etc/modules
and addrtc-ds1307
to the bottom - Reboot the pi
- Edit the file
/etc/rc.local
and add the following lines before theexit 0
line:echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device hwclock -s
- The end of the file should look like:
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device hwclock -s exit0
- Reboot the pi
- Set the time with the command
sudo date -s "29 AUG 2010 13:00:00"
- Update the chronodot time with the command
sudo hwclock -w
- Note: The pi reads the time from the chronodot on boot and sets its internal clock to match that time. If you change the pi time, you have to update the chronodot as well or the updated time will be lost on a boot cycle.
1.use sudo raspi-config
2.go to go to the interface
tab
3.Enable cammera in settings
1.use sudo raspi-config
2.go to go to the interface
tab
3.On the first tab select no
4.ON the second tab select yes
-TX windows have to be seperated by at least 25 seconds. This is the time from ending one window to the start time of the next window. If it is not separated by this buffer, then it is NOT guaranted that the TX window will be serviced.
-run the code called flightConfig.exe, Warning: This will disable, wifi, hdmi, and the leds. You will have to reflash the sd if you want to commicate with the pi again.
-If you want to still have wifi run flightConfigWifi.exe Warning: This is for testing ONLY
Pi system
├──Home
│ ├──CubeWorks0
│ ├──CubeWorks1
│ ├──CubeWorks2
│ ├──CubeWorks3
│ ├──CubeWorks4
│ ├──flightlogicData
│ | ├──Attitude_Data.txt
│ | ├──TTNC_Data.txt
│ | ├──BootRecords.txt
│ | ├──backupBootRecors.txt
│ | └── Deploy_Data.txt
│ ├──TXISRData
│ | ├──AX25Flag.txt
│ | ├──flagsFile.txt
│ | ├──transmissionFla.txt
│ | └── txWindows.txt
│ ├──install.exe
│ ├──lastBase.txt
└── └── upDateCode.exe
Cubeworks
├── Drivers
│ ├── ExampleDriver
│ │ ├── ExampleDriver.py
│ │ └── __init__.py
│ ├── __init__.py
│ └── Driver.py
├── flightLogic
│ ├── mainFlightLogic.py
│ ├── missionModes
│ │ └── example.py
│ ├── postBoomTime.txt
│ └── saveTofiles.py
├── GroundStation
│ ├── example.sh
│ └── example.py
├── __init__.py
├── log.txt
├── mission_modes.py
├── protectionProticol
│ └── fileProtection.py
├── README.md
├── requirements.txt
├── runOnBoot.py
├── tests
│ ├── __init__.py
│ ├── testAllDrivers.py
│ └── unit_testing_example.py
├── TXISR
│ ├── example.py
│ └── __init__.py
└── watchdog
├── arduino_watchdog_v7
│ └── arduino_watchdog_v7.ino
└── Heartbeat
└── Heartbeat.py
###Data Flows: