forked from moke/spaceapi-tuerpie-nix
Updated README
This commit is contained in:
parent
63044009c9
commit
5545372ca8
28
README.md
28
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=<your SpaceAPI server endpoint>
|
||||
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:
|
||||
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue