SACDaq Data Logging Suite

Introduction

Setup for Automated Logging

  • Create user account

# useradd -m -s /bin/bash sacdaq
# gpasswd -a sacdaq i2c
# gpasswd -a sacdaq spi
# gpasswd -a sacdaq gpio

  • Create working directory

# mkdir /opt/sacdaq
# chown sacdaq:sacdaq /opt/sacdaq

  • Check out code

# sudo -u sacdaq -s
$ cd /opt/sacdaq
$ git clone https://github.com/kc2zgu/sacdaq .
$ mkdir logs

  • Install Perl dependencies

(Debian)
# apt-get install libdatetime-perl libyaml-perl libipc-run-perl libfile-slurp-perl libuuid-tiny-perl libdbix-class-perl libdbd-sqlite3-perl libsql-translator-perl libdatetime-format-sqlite-perl
# cpan Device::I2C

  • Configure sensors

  • Create systemd service

/etc/systemd/system/sacdaq.service:

[Unit]
Description=SACDaq Agent

[Service]
Type=simple
ExecStart=/opt/sacdaq/agent.pl
WorkingDirectory=/opt/sacdaq
User=sacdaq
Group=sacdaq
# only on systemd >=236
#StandardOutput="file:/opt/sacdaq/logs/agent.log"
#StandardError="file:/opt/sacdaq/logs/agent.err"

* Sync reports with cron

$ crontab -e
*/15 * * * *    cd /opt/sacdaq && perl sendreports-v2.pl



-- StephenCavilia - 06 Nov 2018

This topic: Computers/Linux > WebHome > SacDaq
Topic revision: 07 Dec 2019, StephenCavilia
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CodenamePending? Send feedback