The previous RESFET controller software kind of sucks. It's a whole load of spaghetti code. The goal for this project is to rewrite the controller to make it more configurable, easier to extend to support multiple engines, and generally just less of a pain to work with.
slonk
also includes a redesign for the API for communcations between the dashboard and controller.
For further details, refer to
api.md.
This documnent also explains the structure of configuration files.
slonk
is written in Rust, and uses Cargo, the main Rust build system, to build and test.
We recommend using rustup to set up the Rust build environment.
To build the release version of the code, navigate to the root directory of this repository and
enter cargo build --release
.
To run the controller, run ./target/release/slonk
after building.
slonk
must be run as root (via sudo
) in order to take ownership of GPIO.
The controller executable takes two arguments:
- A path to the configuration JSON file.
- A path to the directory where logs will be stored.
For example, the following command would run the engine controller for the Titan motor configuration
and store logs in ../slogs/my_test_logs
.
cargo build --release
sudo ./target/release/slonk config/titan.json ../slogs/my_test_logs
To run all tests, run cargo test
.
The main slonk
binary can only be run as root on a Raspberry Pi.
To make testing easier, we also provide a test binary that can be run as a non-privileged user on
any Linux computer.
To run it, first build with cargo build --release
and then run ./target/release/dummy
.
It takes the same arguments as the main controller executable.
cargo build --release
sudo .target/release/dummy config/titan.json ../slogs/my_dummy_slogs
To reduce chances of version control blunders, we've created standard git procedures. Refer to git_procedures.md for more details.