1
0
Fork 0

Updated README

This commit is contained in:
Alexander Böhm 2024-01-05 17:02:03 +01:00
parent 63044009c9
commit 5545372ca8
1 changed files with 13 additions and 15 deletions

View File

@ -1,15 +1,12 @@
# Spaceapi Tuerpi # 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` 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).
You need to provide the environment variables
`SPACEAPI_URL` and `API_KEY`.
## Build ## Build
@ -35,10 +32,10 @@ cargo build --target=armv7-unknown-linux-musleabihf
## Install ## 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 ```sh
install -m 755 -o root -g root \ sudo install -m 755 -o root -g root \
target/release/pi \ target/release/pi \
/usr/local/bin/spaceapi-tuerpi /usr/local/bin/spaceapi-tuerpi
``` ```
@ -65,19 +62,20 @@ Place the environment configuration with URL and API-Key under `/etc/spaceapi-tu
``` ```
SPACEAPI_URL=<your SpaceAPI server endpoint> SPACEAPI_URL=<your SpaceAPI server endpoint>
API_KEY=<your secret API key> API_KEY=<your secret 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: Ensure the `/etc/spaceapi-tuerpi.env` can be read only by root by executing:
``` ```sh
chmod 600 /etc/spaceapi-tuerpi.env sudo chmod 600 /etc/spaceapi-tuerpi.env
chown root:root /etc/spaceapi-tuerpi.env sudo chown root:root /etc/spaceapi-tuerpi.env
``` ```
Apply changes to systemd to enable and start the service Apply changes to systemd to enable and start the service
```sh ```sh
systemctl daemon-reload sudo systemctl daemon-reload
systemctl enable --now spaceapi sudo systemctl enable --now spaceapi
``` ```