Clear Memory, and try next time again

This commit is contained in:
Ollo 2021-12-02 22:53:38 +01:00
parent 8bc3b0cb66
commit b8f037d61c

View File

@ -206,7 +206,7 @@ function startMqttClient()
dstimer:register(123, tmr.ALARM_SINGLE, function (kTemp)
if (file.open("ds18b20_diet.lc")) then
t=true
print "Setup temperature"
print "Setup temperatur"
end
end)
dstimer:start()
@ -226,10 +226,12 @@ function startMqttClient()
ds18b20.setup(2) -- GPIO4
readTemp(ds18b20) -- read once, to setup chip
temperatur=readTemp(ds18b20)
if (temperatur == 85) then
if (temperatur == 8500) then
temperatur=nil
end
ds18b20=nil
else
collectgarbage()
end
if (temperatur ~= nil and temperatur ~= oldTemp) then
oldTemp = temperatur