system daemon with a timer for relay activation

Talk about the project itself, the community, where we are and what we need. Great place to introduce yourself and make friends as well.

system daemon with a timer for relay activation

Postby tomasm » Thu Jun 22, 2017 6:05 pm

Hey,

Ive wrote for myself a system daemon that updates the status of 3 independent outputs depending on a given time.

i use it with this HAT for the RPI2 i.o to activate a few things i want running only at night.
https://www.amazon.com/gp/product/B01G05KLIE/ref=s9u_simh_gw_i2?ie=UTF8&fpl=fresh&pd_rd_i=B01G05KLIE&pd_rd_r=RCT1JV12MFETQ893B6T1&pd_rd_w=1Idt2&pd_rd_wg=tghNR&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=&pf_rd_r=K553QNRHX47HV9PJKAFP&pf_rd_t=36701&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_i=desktop

i thought someone might find it useful.

All gpio actions are done through the wiringpi library and configuration using the iniparser library.

daemon code and systemd unit available through github.

heres a PKGBUILD to build this package for anyone interested.

comments are appreciated. keep in mind code might be a bit rough. but it works (tm).

Code: Select all
pkgname=auto-rele
pkgver=0.1
pkgrel=1
pkgdesc="A simple daemon to automatically switch the relays on and off every day"
arch=('armv7h')
license=('GPL')
depends=('wiringpi' 'iniparser')
source=('git+https://github.com/tomasmez/auto-rele.git'
        )
md5sums=('SKIP')

 build() {
        cd $srcdir/auto-rele
        make auto-rele

 }
 package() {
         cd $srcdir/auto-rele
         make DESTDIR=$pkgdir install
         install -Dm 644 "auto-rele.service" "$pkgdir/usr/lib/systemd/system/auto-rele.service"
         install -Dm 644 "auto-rele.conf" "$pkgdir/etc/auto-rele/auto-rele.conf"
         }
tomasm
 
Posts: 1
Joined: Thu Jun 22, 2017 5:59 pm

Return to Community

Who is online

Users browsing this forum: tarmiste and 1 guest