Skip to content

Monitor

Dr. Takeyuki Ueda edited this page Nov 25, 2017 · 6 revisions

This page is for Monitor version 1.

Water Monitor "Monitor" is a Web application which show current data and pictures posted from the "Slider".

install

dependency

  • php
  • composer

steps

  1. git clone https://github.com/UedaTakeyuki/monitor.git
  2. sudo chown -R www-data monitor
    (or appropriate user running as Web server process)
  3. cd monitor
  4. composer install
  5. ./setup.js.sh

prepare data folder for "Slider"

make data folder of your slider with same name of your slider's serial_id.

steps

  1. get your slider's serial_id. on slider as:
$ python -m piserialnumber
000000000abcdefgh

in this case, serial_id is 000000000abcdefgh.

  1. return back to monitor, then
cd uploads
  1. cp -rf org YOUR-SERIAL-ID
    for example:
cp -rf org 000000000abcdefgh
  1. grant write permission to the Web Server on this folder, for example:
sudo chmod -R www-data 000000000abcdefgh

remark: DON'T grant write permission to "USER", like sudo chmod a+w because the file with USER write permission is cause of taking over!

  1. at slider set monitor url.

  2. et voila!

sensor and image setting files.

.dini file

Sensor and image settings is in the .dini files. monitor read all .dini file and make a views, get data and draw it on the view. View is cleated in order of the .dini filename alphabetically, for example, in case there are 1_temp.dini 2_humidity.dini 500_video0.dini, view is cleated in order temp, humidity, video0. So, you can change view order by changing name of .dini file.

syntax of .dini file for sensor

for example:

pname=気温
fname=temp
dname=temp
unit=℃
  • pname:
    print name of this sensor on the view.
  • fname: base file name (without expansion) of this sensor's logging data. With above example, data file is temp.csv.
  • dname:
    device name of this sensor, should be same as the device name on the slider.
  • unit:
    The unit of this data.

syntax of .dini file for image

pname=video0
dname=video0
image_type=jpeg
  • pname: print name of this sensor on the view.
  • device name of this sensor, should be same as the device name on the slider.
  • image_type:
    This element should be jpeg. Other settings (like movie) is reserved for the next version of monitor2 & slider2.