sat-rs/satrs-example/README.md

73 lines
2.6 KiB
Markdown
Raw Normal View History

2022-11-20 19:29:50 +01:00
sat-rs example
======
2022-11-20 20:12:35 +01:00
2022-11-20 20:42:29 +01:00
This crate contains an example application which simulates an on-board software.
It uses various components provided by the sat-rs framework to do this. As such, it shows how
2024-02-07 18:07:21 +01:00
a more complex real on-board software could be built from these components. It is recommended to
read the dedicated
[example chapters](https://absatsw.irs.uni-stuttgart.de/projects/sat-rs/book/example.html) inside
the sat-rs book.
The application opens a UDP and a TCP server on port 7301 to receive telecommands.
2022-11-20 20:12:35 +01:00
2022-11-20 20:42:29 +01:00
You can run the application using `cargo run`. The `simpleclient` binary target sends a
ping telecommand and then verifies the telemetry generated by the example application.
It can be run like this:
```rs
cargo run --bin simpleclient
```
This repository also contains a more complex client using the
[Python tmtccmd](https://github.com/robamu-org/tmtccmd) module.
2024-02-07 18:07:21 +01:00
# Features
The example has the `dyn_tmtc` feature which is enabled by default. With this feature enabled,
TMTC packets are exchanged using the heap as the backing memory instead of pre-allocated static
stores.
You can run the application without this feature using
```sh
cargo run --no-default-features
```
2023-09-27 14:28:42 +02:00
# <a id="tmtccmd"></a> Using the tmtccmd Python client
2022-11-20 20:42:29 +01:00
The python client requires a valid installation of the
[tmtccmd package](https://github.com/robamu-org/tmtccmd).
It is recommended to use a virtual environment to do this. To set up one in the command line,
you can use `python3 -m venv venv` on Unix systems or `py -m venv venv` on Windows systems.
After doing this, you can check the [venv tutorial](https://docs.python.org/3/tutorial/venv.html)
on how to activate the environment and then use the following command to install the required
dependency:
```sh
pip install -r requirements.txt
```
Alternatively, if you would like to use the GUI functionality provided by `tmtccmd`, you can also
install it manually with
```sh
pip install tmtccmd[gui]
```
After setting up the dependencies, you can simply run the `main.py` script to send commands
to the OBSW example and to view and handle incoming telemetry. The script and the `tmtccmd`
framework it uses allow to easily add and expose additional telecommand and telemetry handling
2022-11-20 20:48:34 +01:00
as Python code. For example, you can use the following command to send a ping like done with
the `simpleclient`:
```sh
2024-02-07 17:58:51 +01:00
./main.py -p /test/ping
2022-11-20 20:48:34 +01:00
```
2024-02-07 17:58:51 +01:00
You can also simply call the script without any arguments to view the command tree.
2023-09-27 14:28:42 +02:00
2024-02-07 17:58:51 +01:00
# High-level information about the example project
2023-09-27 14:28:42 +02:00
2024-02-07 17:58:51 +01:00
You can read more high-level information inside the [dedicated chapter]() of the sat-rs book.