From df623f5d75f3a9d8c64b54cb9950c911a60d2134 Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Thu, 16 Jul 2020 15:44:31 +0200 Subject: [PATCH] Updated README: - updated setup instructions Added scripts directory with the systemd config files --- README.md | 29 +++++++++++++++++++++++++---- scripts/flashairup.service | 6 ++++++ scripts/flashairup.timer | 8 ++++++++ 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 scripts/flashairup.service create mode 100644 scripts/flashairup.timer diff --git a/README.md b/README.md index d48b909..424bd2a 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,35 @@ ## Installation requirements -python3, python3-setuptools -`sudo apt install python3-setuptools` -libcurl4-openssl-dev libssl-dev -`sudo apt install libcurl4-openssl-dev libssl-dev` + +* systemd (otherwise the timer have to be changed (crond is not able to operate at 7 second intervals) +* python3, python3-pip + `sudo apt install python3-pip` +* libcurl4-openssl-dev libssl-dev + `sudo apt install libcurl4-openssl-dev libssl-dev` +## Setup + +Get the code with +`git clone https://code.ungleich.ch/rouxdo/flashair-uploader.git` Move the `flashairup` directory to the desired place (e.g. `/home//`), referred now as WORKDIR +Install the required python packages: +``` + #In the WORKDIR + pip install -r requirements.txt +``` + +### Systemd setup + +Change the WORKDIR the `flashairup.systemd` file and +move the altered file with the `flashairup.timer` file to `/etc/systemd/system/`. +The files can be found in the `scripts` directory. + +### Configuration and Directory hierarchy + + Create the following directory structure inside the WORKDIR: ``` diff --git a/scripts/flashairup.service b/scripts/flashairup.service new file mode 100644 index 0000000..794d158 --- /dev/null +++ b/scripts/flashairup.service @@ -0,0 +1,6 @@ +[Unit] +Description=Flashair syncronisation program + +[Service] +WorkingDirectory=WORKDIR/flashairup/ +ExecStart=WORKDIR/flashairup/main.py --sync diff --git a/scripts/flashairup.timer b/scripts/flashairup.timer new file mode 100644 index 0000000..e4cb5c8 --- /dev/null +++ b/scripts/flashairup.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Start sync every 7 seconds +[Timer] +OnBootSec=20 +OnUnitActiveSec=7 +AccuracySec=1ms +[Install] +WantedBy=timers.target