collect Sharp's GP2Y1010AU0F
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 20 Feb 2021 15:46:41 +0000 (16:46 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 20 Feb 2021 15:46:41 +0000 (16:46 +0100)
dust.sh [new file with mode: 0755]
system/dust.service [new file with mode: 0644]

diff --git a/dust.sh b/dust.sh
new file mode 100755 (executable)
index 0000000..47c9b28
--- /dev/null
+++ b/dust.sh
@@ -0,0 +1,4 @@
+#!/bin/sh -xe
+
+cd /nuc/air-quality/
+MEASUREMENT=dust ./dsm501.pl /dev/ttyACM0
diff --git a/system/dust.service b/system/dust.service
new file mode 100644 (file)
index 0000000..2744a77
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=dust sensor
+
+[Service]
+User=dpavlin
+ExecStart=/nuc/air-quality/dust.sh
+Restart=always
+RestartSec=2s
+
+[Install]
+WantedBy=multi-user.target