Temperature library can be initialized
This commit is contained in:
parent
91ab8609b9
commit
9cd54da774
6
mqtt.lua
6
mqtt.lua
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user