jmason86 / MinXSS_Beacon_Decoder

Beacon decoder for the MinXSS CubeSat in space; MinXSS-2 launch on 2018-11-19
http://lasp.colorado.edu/home/minxss
GNU General Public License v3.0
11 stars 6 forks source link
cubesat gui ham-radio nasa pyside2 python qt serialport socket space telemetry

The MinXSS Beacon Decoder and Forwarder

DOI

Overview

A GUI for decoding serial or socket data received with a UHF HAM radio station from the MinXSS CubeSat in space. There are two MinXSS spacecraft: MinXSS-1 deployed from the International Space Station on 2016 May 16 and operated until 2017 May 06 when it burned up in Earth's atmosphere (as planned); MinXSS-2 will be launched in early 2018.

MinXSS-1 operates at 437.345 MHz with a beacon every 54 seconds nominally. MinXSS-2 will beacon every 9 seconds at 437.250 MHz. The modulation scheme is GMSK. The beacons contain health and safety information about the spacecraft.

This program receives the serial or socket data from MinXSS, interprets it, and displays that interpreted data in human readable formats. For example, you can see real time voltages, currents, temperatures, and spacecraft mode. The telemetry is color coded corresponding to the expected ranges for each telemetry point (green = good, yellow = borderline or warning, red = bad). It also forwards the binary data recorded to the MinXSS team (by default, but this can be disabled with the corresponding toggle).

All of this code is made open source to hopefully encourage other CubeSat programs to adopt it.

The GUI is built with the designer component of Qt Creator (open source version; it's not necessary to have this unless you want to edit the interface). It uses the Qt for Python project (pyside2 module, available, e.g., in anaconda) to convert the Qt Designer .ui file into a .py (this is required if you want to run the code directly but not required if you're running the built beacon decoder application). minxss_beacon_decoder.py wraps around that GUI code to provide the buttons and text displays with functionality. It uses connect_port_get_packet.py to establish a link with the user-specified serial port or TCP/IP socket and then read from it. minxss_parser.py is then fed the binary and interprets the data into a dictionary, which is returned to minxss_beacon_decoder.py for display in the GUI.

Here is what the layout looks like: Example Screenshot of Telemetry

The other important component of this program is the optional (but default) automatic forwarding of binary data to the MinXSS team at the University of Colorado at Boulder / Laboratory for Atmospheric and Space Physics. There we merge data received at our own ground stations in Boulder and Alaska, and any other data sent in from volunteer HAM operators around the world. We process the data automatically up to the high-level science products and publish them online at our website (http://lasp.colorado.edu/home/minxss/data/). This all occurs daily. In order to forward the data, just make sure to leave the "Forward data" toggle checked, and when the pass is over, either click the "Complete Pass" button or just exit the program.

Example Screenshot of Input / Options

See the release page for periodic releases of code in a good state: https://github.com/jmason86/MinXSS_Beacon_Decoder/releases.

Example Screenshot of About

How to run from the compiled code (.exe, .app)

  1. If you haven't already downloaded the latest release, do so.
  2. Just double click the downloaded .exe or .app! If it gives you issues, try running it as administrator to give it the permissions to write to your disk. In Windows, you can just right click on the application and select "Run As Administrator". In Mac, open a terminal, change directories to where you have the .app, then change directories into the .app/Contents/MacOS/ and type "sudo MinXSS_Beacon_DecoderMac".
  3. If you're still having problems, make a new directory in your home folder called "MinXSS_Beacon_Decoder". Copy the input_properties.cfg file from this MinXSS_Beacon_Decoder codebase into the new folder. Try running again.
  4. If it is still not working, create an issue on this page.

How to run from the code directly

  1. If you haven't already downloaded a local copy of this codebase, do so.
  2. Open a terminal, navigate to the directory you are storing this codebase, and type: "python minxss_beacon_decoder". Note that this code was developed with python 3, so it may not work if you're using python 2.
  3. That's it! You should see the UI window pop open and you should be able to interact with it.

How to edit interface

  1. If you don't already have python > anaconda > pyqt installed, do so. In a terminal, type "conda install pyqt".
  2. Open the Qt Designer. It should be in a path like this: /Users//anaconda/bin/Designer.app
  3. Go to File > Open and select ui_mainWindow.ui from your local copy of this MinXSS_Beacon_Decoder codebase.
  4. Edit away!
  5. Go to File > Save.
  6. Convert the .ui to a .py. To do this, in a Unix terminal, type "./compile_ui.sh" while in the local directory where you have this MinXSS_Beacon_Decoder codebase. If you're on Windows, just take a look at the commands in compile_ui.sh and run them in your command prompt.
  7. That's it! Next time you run minxss_beacon_decoder.py, it should show your edits. Note that if you are making edits where you want to change the functionality of the code, you'll need to dive into the corresponding .py files to make those changes as well.

How to compile code to executable

  1. Get onto the operating system that you want to compile for. The tool we're using (pyinstaller) is not a cross-compiler. That means that if you're on Windows, you can't compile for Mac and vice versa and ditto for Linux.
  2. Test that the code works when you do a normal run from the code directly (see instructions above).
  3. From a terminal window, navigate to the directory where you have your local copy of this codebase. If on Windows, type: "make.bat". If on Mac or Linux, type: "./make.sh". This is just a convenient wrapper script for pyinstaller so you don't have to remember all of the input and output parameters. If it crashes, read the warning messages and respond appropriately. The most likely thing to fail is missing python modules. If that's the reason for failure, in the terminal, just type "pip install" and the name of the module. For example, "pip install pyserial".

So you want to modify the code for your own use

  1. Fork the code on github.
  2. Set up your development environment however you like to interface between your developers local copies and the github server. Or if you don't want to use github, do whatever setup you like.
  3. Edit the code and follow good programming practices with commits, etc.

Which code to edit and why