User Tools

Site Tools


owst:start

This is an old revision of the document!


OWST -- 1-Wire Switch Timer

Description

OWST is an Open Source project performing as a programmable timer for 1-Wire® switches such as DS2408 (8-Channel Addressable Switch) or DS2413 (Dual Channel Addressable Switch).

For features, technical details, installation instructions see OWST on GitHub

Screenshots

Switch list Timer program list Add new timer program Set mode for switch Immediate action on switch

Configuration

Prerequisites:

  • OWST uses the at-command to schedule the next call of the Timer Program Handler.
  • The webserver must be able to handle PHP files in order for the web interface to work.
  • PHP can either be run as module (e.g. mod_php in Apache), as CGI or FASTCGI (php running as a separate daemon).
  • The user/UID under which the code of the web interface is run must have access to the same at-queue as the user/UID who runs the timer program handler.
    • This can be accomplished by either using the same UID for both tasks (web interface and Timer Program Handler), or to grant the web-UID access to the at-queue of the UID which handles the timer programs by using sudo.

Using sudo: you need to add the following line to your /etc/sudoers file.

www-data ALL = (tph) NOPASSWD: /usr/bin/atq, /usr/bin/atrm, /usr/bin/at

Run at boot

The Timer Program Handler needs to be run at boot in order to reset the One Wire chip properly.

# File /etc/cron.d/owst
# adapt path names as required

# at reboot empty the at-queue and call tp.php to reprogram all the at-jobs (-r) and to reset the
# switches (-m) to their required states
@reboot   pi   [ -x <path>/tp.php ] && atq | cut -f1 | xargs -r atrm && <path>/tp.php -mr
  • To configure the single switches you need to edit the SQLite database table 'switch' manually. You can do this on the command line, you can use the SQLite web interface phpLiteAdmin or any other user interface to edit SQLite databases.

Nginx

Protect files from direct web access

location ~ /owst/(include|lib|smarty) {
   deny all;
}

Further notes

  • 1-Wire is a registered trademark of Maxim Integrated Products, Inc.
  • Linux is a registered trademark of Linus Torvalds.
owst/start.1586327971.txt.gz · Last modified: 2020/04/08 08:39 by admin