diff options
| author | st33v <github@f3rr3t.com> | 2016-02-23 18:03:53 +1100 |
|---|---|---|
| committer | st33v <github@f3rr3t.com> | 2016-02-23 18:03:53 +1100 |
| commit | 1e68c6dec5b07670441ddea1f83732fa8f19995f (patch) | |
| tree | d124bec343466e3be571cbbc59c9b0516b2bf383 | |
First commit. Basic working state but not very smart yet
| -rw-r--r-- | takepix.service | 12 | ||||
| -rwxr-xr-x | takepix.sh | 6 | ||||
| -rw-r--r-- | takepix.timer | 12 |
3 files changed, 30 insertions, 0 deletions
diff --git a/takepix.service b/takepix.service new file mode 100644 index 0000000..d7e73b5 --- /dev/null +++ b/takepix.service @@ -0,0 +1,12 @@ +[Unit] +Description=Take a photo and store it ready for uplift to STAN + +[Service] +Type=oneshot +User=st33v +# need double quotes to evaluate contents of variable +# Environment="picdate=date +%Y-%m-%d_%H%M" +WorkingDirectory=/home/st33v/pix/ +# ExecStart=/bin/echo +# ExecStart=/opt/vc/bin/raspistill -o /home/st33v/pix/$(eval "echo $(picdate)").jpg +ExecStart=/usr/local/bin/takepix.sh diff --git a/takepix.sh b/takepix.sh new file mode 100755 index 0000000..63f3082 --- /dev/null +++ b/takepix.sh @@ -0,0 +1,6 @@ +#!/bin/bash + + +picdate=$(date +%Y-%m-%d_%H%M) +/opt/vc/bin/raspistill -x IFD1.Artist=neatherd -o /home/st33v/pix/${picdate}.jpg + diff --git a/takepix.timer b/takepix.timer new file mode 100644 index 0000000..1dda309 --- /dev/null +++ b/takepix.timer @@ -0,0 +1,12 @@ +[Unit] +Description= Take a photo each half hour + +[Timer] +Persistent=true +OnBootSec=1min +#OnCalendar=30m +OnUnitActiveSec=30m +Unit=takepix.service + +[Install] +WantedBy=timers.target |
