No description
Find a file
Blizzard Finnegan c0d13009a4
All checks were successful
Basic Cargo Checks / docker-build (push) Successful in 1m26s
Basic Cargo Checks / docker-check (push) Successful in 4m5s
Update documentation re: cross-compilation
2023-06-21 16:11:41 -04:00
.forgejo/workflows revert previous change 2023-06-14 15:31:37 -04:00
src Fix saving so that data can be re-imported 2023-06-21 13:24:23 -04:00
.gitignore Start writing rust 2023-05-05 15:47:53 -04:00
Cargo.lock remove dependencies, version bump 2023-06-21 10:32:44 -04:00
Cargo.toml Update documentation re: cross-compilation 2023-06-21 16:11:41 -04:00
LICENSE Create LICENSE 2023-05-04 18:22:57 -04:00
log-containing-uboot-prompt.txt Remove some logging for storage purposes 2023-06-16 14:00:43 -04:00
README.md Update documentation re: cross-compilation 2023-06-21 16:11:41 -04:00
shell.nix Update documentation re: dependencies 2023-06-21 10:41:07 -04:00

Seymour Life

This is a personal/professional project, which makes use of serial communications (tty over USB via UART) and Raspberry Pi GPIO to simulate long term use of a Seymour device.

Note that this project will ONLY run properly on a Raspberry Pi. It is developed on, and tested for, the Raspberry Pi 400. This should also be compatible with the Raspberry Pi 4, and Raspberry Pi 3, although they have not been explicitly tested. Older models of Raspberry Pi may work properly, however as this project is originally intended for the aarch64/ARM64 architecture, and older compatibility will not be tested.

Install

Precompiled Binary

Pre-compiled binaries can be found in the releases tab. Download the preferred version to your preferred directory, then run the following command to make the code executable:

sudo chmod u+x ./seymour_life

To run the binary, simply run:

sudo ./seymour_life

Note that this command MUST be run as sudo/root, due to the way it interacts with GPIO. For more information, please see the GPIO documentation.

Build From Source

To build this project from source ON A RASPBERRY PI, first, download the repository. This can be done by using the Download ZIP button, or running the following command in a terminal where git is installed:

git clone https://git.blizzard.systems/blizzardfinnegan/seymourLifeRust

Once the repository has been downloaded, the project can be built with cargo. This can be done using any of the listed install methods on the Rust install website.

Once cargo has been installed, run the following to build the project:

cargo build --release

The runnable command can then be run by the following:

sudo ./target/release/seymour_life

You can also build without the --release flag, which wil take less time, but will be less optimised for the hardware. If you do this, substitue ./target/release/seymour_life for ./target/debug/seymour_life in the above command.

Cross-Compilation

Cross compilation is possible with this project, if you do not have a Raspberry Pi available specifically for compilation. Compilation directly on the Pi is rather intensive, and takes significantly longer than cross-compiling. However, cross-compiling by default will fail, due to a bad linker.

To resolve this issue, find the .cargo folder. For Windows users, it is located in C:\Users\[username], and for Linux users it is located in ~ or $HOME. If you are on Linux, you will need to be sure to show hidden files.

In this .cargo folder, create a new file, named config. In it, add the following lines in the relevant sections below.

Once this file is added, you can then run one of the following commands to create the executable. Note that the final executable will be in target/aarch64-unknown-linux-musl, rather than target.

cargo build --target aarch64-unknown-linux-musl
# OR
cargo build --release --target aarch64-unknown-linux-musl

Windows

[target.aarch64-unknown-linux-musl]
linker = rust-lld

Linux

[target.aarch64-unknown-linux-musl]
linker = lld

Make sure lld is installed as well. This can be found in your distribution's package manager, or directly distributed by LLVM.