From 5545372ca804768d9142a542313d731d28a9fb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20B=C3=B6hm?= Date: Fri, 5 Jan 2024 17:02:03 +0100 Subject: [PATCH] Updated README --- README.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 98eb4be..995be24 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,12 @@ # Spaceapi Tuerpi -Feeding our SpaceAPI with Data from our entrance door. +Feeding our SpaceAPI with data from our entrance door. -## Setup +## Usage -Please change `DOOR_PIN` accordingly. +To run the client, please change `DOOR_PIN` accordingly to your setup. `DOOR_PIN` defaults to a closed door, when `HIGH`. -`DOOR_PIN` defaults to a closed door, when HIGH. - -You need to provide the environment variables -`SPACEAPI_URL` and `API_KEY`. +You need to provide the environment variables `SPACEAPI_URL` and `API_KEY` to send the status to the SpaceAPI server. Details of the server can be found on the [project page](https://github.com/dezentrale/spaceapi-rs). ## Build @@ -35,10 +32,10 @@ cargo build --target=armv7-unknown-linux-musleabihf ## Install -Place the build `pi` binary under `/usr/local/bin/spaceapi-dezentrale-pi-client` +Build the project as release and place `pi` binary under `/usr/local/bin/spaceapi-tuerpi` ```sh -install -m 755 -o root -g root \ +sudo install -m 755 -o root -g root \ target/release/pi \ /usr/local/bin/spaceapi-tuerpi ``` @@ -65,19 +62,20 @@ Place the environment configuration with URL and API-Key under `/etc/spaceapi-tu ``` SPACEAPI_URL= API_KEY= +#DOOR_PIN=27 # Set the door pin +#RUST_LOG=ERROR # Set debug level ``` Ensure the `/etc/spaceapi-tuerpi.env` can be read only by root by executing: -``` -chmod 600 /etc/spaceapi-tuerpi.env -chown root:root /etc/spaceapi-tuerpi.env +```sh +sudo chmod 600 /etc/spaceapi-tuerpi.env +sudo chown root:root /etc/spaceapi-tuerpi.env ``` Apply changes to systemd to enable and start the service ```sh -systemctl daemon-reload -systemctl enable --now spaceapi +sudo systemctl daemon-reload +sudo systemctl enable --now spaceapi ``` -