From dc2cd1cc9efff9c5ba77814106b75cbdf82b4d12 Mon Sep 17 00:00:00 2001 From: mvoelkel Date: Wed, 9 Sep 2015 19:08:06 +0200 Subject: [PATCH] fan control update Checks fpga id to enable fan on power connector 1 or 2 --- octoserve/var/monitor/fancontrol.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/octoserve/var/monitor/fancontrol.lua b/octoserve/var/monitor/fancontrol.lua index e9a7db7..52c473d 100755 --- a/octoserve/var/monitor/fancontrol.lua +++ b/octoserve/var/monitor/fancontrol.lua @@ -51,7 +51,16 @@ local Sensor = {} local TempList = {} local StartIndex = 1 local count = interval -local fanstate = 1 +local fanstate = -1 + +local ddbridge = io.open("/sys/class/ddbridge/ddbridge0/devid0","r"); +if ddbridge then + local devid = ddbridge:read("*l") + ddbridge:close() + if devid == "0307dd01" then + fanstate = 1 + end +end --~ sleep(30) @@ -66,8 +75,6 @@ if NumSensors == 0 then return end -SetFan(0) - while true do sleep(1) temps = ""