From: Nathaniel Wesley Filardo Date: Wed, 20 Dec 2017 02:16:18 +0000 (-0500) Subject: Bring last heater under DMX control X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=c7611d30c81ec07159876a7c85c3b0234d32312f;p=acmetensortoys-snakecontrol Bring last heater under DMX control --- diff --git a/bin/lcdproc-monitor.expect b/bin/lcdproc-monitor.expect index 84618aa..c6bcfc8 100755 --- a/bin/lcdproc-monitor.expect +++ b/bin/lcdproc-monitor.expect @@ -55,7 +55,7 @@ set sid [::lcdproclib::spawnlcd "localhost" "13666"] ::lcdproclib::cmd ${sid} "widget_set 1 v_dmxl 14 3 @" ::lcdproclib::cmd ${sid} "widget_add 1 v_ldmx string" ::lcdproclib::cmd ${sid} "widget_add 1 v_hdmx string" -::lcdproclib::cmd ${sid} "widget_add 1 v_mdmx string" +::lcdproclib::cmd ${sid} "widget_add 1 v_fdmx string" ::lcdproclib::cmd ${sid} "widget_add 1 v_doorl icon" ::lcdproclib::cmd ${sid} "widget_set 1 v_doorl 19 3 CHECKBOX_OFF" @@ -98,6 +98,7 @@ while { true } { "tank-mid humid=${datare}" { drawtemp ${sid} 1 "v_mh" 9 3 [lindex ${m} 1] } \ "dmx-tanknear dmx=${datare}" { drawdmx ${sid} 1 "v_ldmx" 15 3 [lindex ${m} 1] } \ "dmx-hidenear dmx=${datare}" { drawdmx ${sid} 1 "v_hdmx" 16 3 [lindex ${m} 1] } \ + "dmx-hidefar dmx=${datare}" { drawdmx ${sid} 1 "v_fdmx" 17 3 [lindex ${m} 1] } \ } -i ${logsid} -re "\[^ :\]*:..:..\.\[^ \]* check temps fini${dskip}\n" { ::lcdproclib::cmd ${sid} "widget_set 1 v_tickl 20 2 ${loopctr}" diff --git a/bin/monitor-graph-cgi.sh b/bin/monitor-graph-cgi.sh index d10b9a4..8cf0943 100755 --- a/bin/monitor-graph-cgi.sh +++ b/bin/monitor-graph-cgi.sh @@ -21,8 +21,10 @@ DMX_ARGS=( --right-axis-label "DMX" --right-axis 1:0 DEF:dmxTN=${DATA_DIR}/tank-near-dmx.rrd:dmx:AVERAGE DEF:dmxHN=${DATA_DIR}/hide-near-dmx.rrd:dmx:AVERAGE + DEF:dmxHF=${DATA_DIR}/hide-far-dmx.rrd:dmx:AVERAGE LINE:dmxTN\#800000:"left side" LINE:dmxHN\#008000:"left hide" + LINE:dmxHF\#000080:"right hide" ) NEAR_ARGS=( @@ -39,6 +41,7 @@ NEAR_ARGS=( LINE2:tempHN\#808000:"hide left" LINE2:tempTN\#00FF00:"tank left" HRULE:30#800000 + HRULE:25#000080 ) HUMID_SCALE=$(( 100.0/(TEMP_SCALE_UPPER-TEMP_SCALE_LOWER) )) @@ -64,6 +67,7 @@ FAR_ARGS=( DEF:tempTF=${DATA_DIR}/tank-far-temp.rrd:temp:AVERAGE LINE2:tempHF\#FF8000:"hide right" LINE2:tempTF\#00FFFF:"tank right" + HRULE:23#800000 ) diff --git a/bin/pidmonitor.py b/bin/pidmonitor.py index d01b9cf..f106ed8 100755 --- a/bin/pidmonitor.py +++ b/bin/pidmonitor.py @@ -30,6 +30,14 @@ loop_tanknear.setKP(60.0) # XXX These are un-tuned loop_tanknear.setKI(0.004) loop_tanknear.setKD(1000.0,0.95) +loop_hidefar = pidloop.PIDThresh(128,19,21,0,24,25,-128) +loop_hidefar.setPoint(23) +loop_hidefar.setHardMax(128) +loop_hidefar.setHardMin(-128) +loop_hidefar.setKP(60.0) # XXX These are un-tuned +loop_hidefar.setKI(0.004) +loop_hidefar.setKD(1000.0,0.95) + bmemid = BME280.BME280(port=1, address=0x77) def log(devfn, temp, logname, rrd, kw="temp"): @@ -136,6 +144,9 @@ def check_temps(sc): s = with_ow_temp(cache, "/sys/bus/w1/devices/28-0416526de6ff/w1_slave", checkpid, with_ow_temp_fk_id3, loop_tanknear, s, 6, "/home/pi/sc/data/tank-near-dmx.rrd", "dmx-tanknear") + s = with_ow_temp(cache, "/sys/bus/w1/devices/28-011620c718ee/w1_slave", + checkpid, with_ow_temp_fk_id3, loop_hidefar, s, 7, "/home/pi/sc/data/hide-far-dmx.rrd", "dmx-hidefar") + print ("check temps fini: out=%r lhn=(%s) ltn=(%s)" % (s, loop_hidenear, loop_tanknear)) assert(dmxdev.write(s) == len(s)) diff --git a/bin/rrdtool-creates.sh b/bin/rrdtool-creates.sh index c9b4a31..4377a69 100755 --- a/bin/rrdtool-creates.sh +++ b/bin/rrdtool-creates.sh @@ -27,6 +27,7 @@ done RRDS=( hide-near-dmx tank-near-dmx + hide-far-dmx ) ARGS=(