Temperature library can be initialized

This commit is contained in:
Ollo 2021-03-21 20:52:27 +01:00
parent 91ab8609b9
commit 9cd54da774

View File

@ -104,6 +104,8 @@ function registerMqtt()
mydofile("telnet") mydofile("telnet")
if (startTelnetServer ~= nil) then if (startTelnetServer ~= nil) then
startTelnetServer() startTelnetServer()
else
print("Cannost start Telnet Server!")
end end
else else
for i=1,10,1 do for i=1,10,1 do
@ -153,8 +155,8 @@ function startMqttClient()
if (mqttServer ~= nil and mqttPrefix ~= nil) then if (mqttServer ~= nil and mqttPrefix ~= nil) then
registerMqtt() registerMqtt()
print "Started MQTT client" print "Started MQTT client"
if (file.open("ds18b20.lc")) then if (file.open("ds18b20_diet.lua")) then
t=require("ds18b20") t=require("ds18b20_diet")
t.setup(2) -- GPIO4 t.setup(2) -- GPIO4
readTemp() -- read once, to setup chip readTemp() -- read once, to setup chip
print "Setup temperature" print "Setup temperature"