ops-sat-rs/README.md

111 lines
3.1 KiB
Markdown
Raw Normal View History

2024-04-08 16:47:31 +02:00
ESA OPS-SAT Rust experiment
========
This is the primary repository for the ESA OPS-SAT experiment.
2024-04-19 17:40:38 +02:00
The primary repository to generate packages for ESOC can be found [here](https://egit.irs.uni-stuttgart.de/rust/ops-sat-experiment).
You can also find some more general documentation about OPS-SAT there.
2024-04-08 19:23:46 +02:00
## Pre-Requisites
2024-04-09 14:25:51 +02:00
- Containerization provider like [docker](https://www.docker.com/) or
2024-04-08 19:26:09 +02:00
[podman](https://podman.io/) installed
2024-04-08 19:23:46 +02:00
- [`cross`](https://github.com/cross-rs/cross) package installed
2024-04-22 15:41:28 +02:00
## Build for Target Hardware
2024-04-08 19:23:46 +02:00
2024-04-09 14:24:51 +02:00
You might need to set the [`CROSS_CONTAINER_ENGINE`](https://github.com/cross-rs/cross/wiki/FAQ#explicitly-choose-the-container-engine)
and [`CROSS_ROOTLESS_CONTAINER_ENGINE`](https://github.com/cross-rs/cross/blob/main/docs/environment_variables.md#configuring-cross-with-environment-variables)
variables manually before calling cross.
2024-05-02 13:39:20 +02:00
The OPS-SAT software filesystem handling will determine a home path at the start of the software.
This home path is used for various mechanisms inside the OPS-SAT infrastructure.
Currently, there are 3 possible configurations:
1. If the software is built with the `host` feature, the HOME path will be the current path the
software is run at.
2. If the `host` feature is not set and the `/home/exp278` folder exists, that folder will be
the home directory.
3. Otherwise, the default OS home directory will be the home directory.
2024-04-09 15:59:22 +02:00
### Debug Build
2024-04-08 19:23:46 +02:00
```sh
cross build
```
2024-04-09 15:59:22 +02:00
### Release Build
```sh
cross build --release
```
2024-04-19 18:04:27 +02:00
2024-04-22 15:41:28 +02:00
## Build for Host
The software was designed to be runnable and testable on a host computer.
You can use the regular cargo workflow for this.
### Running
```sh
2024-04-26 19:18:37 +02:00
cargo run --features host
2024-04-22 15:41:28 +02:00
```
### Testing
```sh
cargo test
```
2024-04-19 18:04:27 +02:00
## Commanding Infrastructure
Commanding of the `ops-sat-rs` application is possible by different means.
2024-04-19 18:10:17 +02:00
<img src="docs/networking-structure.png" alt="Networking and Commanding Structure" width="500"/>
2024-04-19 18:04:27 +02:00
### Using the `pyclient` and `pyserver` applications
2024-04-19 18:09:52 +02:00
You can find both commanding application inside the `pytmtc` folder.
2024-04-24 20:35:59 +02:00
It is recommended to set up a virtual environment first, for example by running the following
code inside the `pytmtc` folder:
```sh
python3 -m venv venv
source venv/bin/activate
```
After that, you can install all requirements for both the client and server application
interactively using
```sh
pip install -e .
```
2024-04-19 18:09:52 +02:00
If you want to command the satellite using the OPS-SAT infrastrucute, start the `pyserver.py`
as a background application first, for example by simply running `pyserver.py` inside a
new terminal window.
After that, you can run `pyclient.py -p /test/ping -l` to send a ping telecommand and then
go into listener mode using the following `tmtc_conf.json` file:
```json
{
"com_if": "tcp",
"tcpip_tcp_ip_addr": "127.0.0.1",
"tcpip_tcp_port": 4097
}
```
2024-04-20 00:31:53 +02:00
You can command the TCP server in the OPS-SAT software directly by running the commands with
the following configuration:
```json
{
"com_if": "tcp",
"tcpip_tcp_ip_addr": "127.0.0.1",
"tcpip_tcp_port": 7031
}
```
2024-04-19 18:09:52 +02:00
You can run `pyclient.py -T` or `pyclient.py -h` for more information on the client application.