General Process Controller
Control inputs and outputs on a development board.
This project is meant to run on an Onion Omega2+, but should in theory work on a RaspberryPi. The node.js scripts were written for v4.3.1.
Copy the files to the Device. If not in /root/controller, you may need to change some paths.
If using 1-wire devices, follow setup instructions at: https://wiki.onion.io/Tutorials/Reading-1Wire-Sensor-Data
Make a symbolic link for web display: ln -s /root/webkeezer/ /www/console/controller
Plots for the web interface require Chart.min.js and utils.js from the chart.js library. http://www.chartjs.org/
The setup.html page allows dragging to re-order table rows with: https://github.com/RubaXa/Sortable copy the Sortable.min.js file to the folder with everything else.
The included libraries will aid in controlling 1-wire temperature devices (ds.js), io pin commands (pinio.js), and the omega relay expansion card (relayexp.js). This are wrapper functions for command line utilities that get data and execute on/off commands. It should be fairly easy to incorporate wrappers for other types of devices.
The control.js scripts updates values and executes actions once a minute but can be changed in that file. Reading 1-wire temperature devices happens serially and can take some time. With my tests using two temperature sensors I occasionally miss a reading.
The webserver is used to update values and look at logged data. It is accessed on the local network at: http://omega-ip-address:8182/setup.html. The status.html page uses status.js and should be updated to suit your needs.
The plots generated at status.html and loghistory.html still need some changes to be flexible to work with other data. The time MyClock device and Time variable defined at setup.html are needed for graphing.
Start the webserver: node server.js &
Start the controller: node control.js &
Navigate to: http://omega-ip-address:8182/setup.html