Chat freely about anything...

User avatar
By Ambro
#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
User avatar
By Ambro
#20041 Jairos2015:

Thanks for the message.
I am trying to get the temperature of the ds18b20 displayed with two decimal places , on my mobile phone through the web.
I am not interested in solutions that requires ThingSpeak or similar account / registration.
Happy if you could help .
Ambro
User avatar
By Ambro
#20078 Hi to everybody !

the problem is the .bin file loaded with the flasher:
This bin file works well: nodemcu_float_0.9.6-dev_20150406
This bin file does NOT work : nodemcu_float_0.9.5_20150318

ESP8266
Temperature : 26.13
Node ChipID : 10550237
Node MAC : 18-FE-34-A0-FB-DD
Node Heap : 7152
Timer Ticks : 166089752

I really do not understand the reason: any clarificatione is welcome !

Thanks to all for the great assistance,
Ambro