- Wed Jun 10, 2015 7:44 am
#20040
the point is in the ds18b20-web.lua.
It is relevant to the "temperature " lines: the following is working well ( ne decimal places displayed ( eg : 26 ):
function(conn)
conn:send("HTTP/1.1 200 OK\nContent-Type: text/html\nRefresh: 5\n\n" ..
"<!DOCTYPE HTML>" ..
"<html><body>" ..
"<b>ESP8266</b></br>" ..
"Temperature : " .. ds18b20.read() .. "<br>" ..
-- "Temperature : " .. string.format("%02.1f",ds18b20.read()) .. "<br>" ..
"Node ChipID : " .. node.chipid() .. "<br>" ..
"Node MAC : " .. wifi.sta.getmac() .. "<br>" ..
"Node Heap : " .. node.heap() .. "<br>" ..
"Timer Ticks : " .. tmr.now() .. "<br>" ..
"</html></body>")
conn:on("sent",function(conn) conn:close() end)
end
The following does not work at all : I do not have any reply on my browser ( all the suggestions appliied )
function(conn)
conn:send("HTTP/1.1 200 OK\nContent-Type: text/html\nRefresh: 5\n\n" ..
"<!DOCTYPE HTML>" ..
"<html><body>" ..
"<b>ESP8266</b></br>" ..
-- "Temperature : " .. ds18b20.read() .. "<br>" ..
"Temperature : " .. string.format("%02.1f",ds18b20.read()) .. "<br>" ..
"Node ChipID : " .. node.chipid() .. "<br>" ..
"Node MAC : " .. wifi.sta.getmac() .. "<br>" ..
"Node Heap : " .. node.heap() .. "<br>" ..
"Timer Ticks : " .. tmr.now() .. "<br>" ..
"</html></body>")
conn:on("sent",function(conn) conn:close() end)
end
Could be a problem in the ds18b20.lua in which t=t/10000 !! ?
Is it working with your setup ?
Ambro