Skip to content
Snippets Groups Projects
Forked from an inaccessible project.
user avatar
Robin Mueller authored
08043241
History

TMTC Client

This client was developed by KSat for the SOURCE project to test the on-board software but has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand) handling and testing via different communication interfaces. Currently, only the PUS standard is implemented as a packet standard. This tool can be used either as a command line tool or as a GUI tool.

This client currently supports the following communication interfaces:

  1. Ethernet, UDP packets
  2. Serial Communication
  3. QEMU

Cloning the repository

It is recommended to fork this repository for new missions. The tmtc_core folder contains most generic software components while this repository is based on the SOURCE mission. However, this repostiory is a good starting point and example implementation which can be adapted easily to other projects.

Fork the repository or clone it with following command:

git clone https://git.ksat-stuttgart.de/source/tmtc.git

Initiate the core components by initiating and updating the submodules

git submodule init
git submoduke update

Install all require packages by running

pip install -r requirements.txt

Now the script can be tested by running

python tmtc_client_cli.py -h

It is recommended to use and setup PyCharm to also use the preconfigured run configurations.

Prerequisites

Tested with Python 3.8. Don't use Python 2.x! Manual installation of crcmod and pyserial might be needed. It is recommended to install use PyCharm to run this client. Students of the Uni Stuttgart usually have access to PyCharm Professional.

  1. Install pip for used Python distribution if it is not installed yet
  2. Install crcmod and all other required packages if using system python compiler. If using the local venv as the compiler, these packages should be installed.
    Command:
pip install -r requirements.txt

Alternatively:

python<version> -m pip<version> install crcmod

or use IDE (interpreter settings -> pip in PyCharm)

  1. Install python-tk on Linux.
sudo apt-get install python-tk

On Windows, the package should be included.

How To Use

It is recommended to use PyCharm and load the run configurations to have a starting point. PyCharm also provided the option of remote deployment, which allows TMTC testing with remote setups (e.g. flatsat setup in a cleanroom).

Command line mode

The script can be used by specifying command line parameters. Please run this script with the -h flag or without any command line parameters to display options.

Import run configurations in PyCharm

The PyCharm IDE can be used to comfortably manage a set of run configuations (for example tests for different services). These configurations were shared through the version control system git and should be imported automatically. If these configurations dont show up, try to open the tmtc folder as a new PyCharm project in a new window.

To add new configurations, go to Edit Configurations... at the top right corner in the drop-down menu. Specify the new run configurations and set a tick at Share through VCS.

Examples

Example command to send a ping command. Specify the communication interface by adding -c <number> to the command.

tmtc_client_cli.py -m 3 -s 17

Example to run listener mode

tmtc_client_cli.py -m 1

Architectural notes

Some additional information about the structure of this Python program are provided here.

Modes and the TMTC queue

There are different communication modes. Run the client with the -h flag to display the modes. The TMTC commander is able to send multiple telecommands sequentially by using a provided queue. The queue is filled by the developer. Some examples can be found in the tc folder. The queue can also be filled with special commands, for example a wait command or a print command.

This application is also able to listen to telemetry packets in a separate thread. The specific TM handling is also implemented by the developer. Some examples can be found in the tm folder.

Communication Interfaces

The communication interfaces decouple the used interface from the communication logic. This enables to write the telecommand and telemetry specifications without worrying about the used communication interface.

Serial Communication

Serial communication was implemented and is tested for Windows 10 and Ubuntu 20.04. It requires the PySerial package installed. It should be noted that there are several modes for the serial communication. There is a fixed frame mode and a mode based on a simple DLE transport layer. When using the DLE transport layer, sent packets are encoded with DLE while received packets need to be DLE encoded.

Issues

Ethernet Communication

If there are issued with the Ethernet communcation, there might be a problematic firewall setting. It might be necessary to allow UDP packets on certain ports

Developers Information

Code Style: PEP8.

Can be enforced/checked by using Pylint as an external program in PyCharm. Install it with pip and then install and set-up the Pylint plugin in PyCharm.

There are a lot of features which would be nice, for example a GUI. The architecture of the program should allow extension like that without too many issues, as the sending and telemetry listening are decoupled.