Chat freely about anything...

User avatar
By Ambro
#19354 I have the ds18b20.lua ( size 3362 ) working well since it is giving the right temperature on the console.
I am not able to get ds18b20-web.lua working at all.
What modification should i make in that program ?
Do I have to load both files on the ESP ? In what sequence ?
Please give me some direction.
Thanks in advance for any help.
regards,
Ambro
User avatar
By twaymouth
#19424 I am also fairly new at this stuff so I apploigise if this is not 100% clear. I will assume that you have already uploaded ds18b20.lua as you have the temperature sensor working in the console. If you have uploaded it but not compiled it then you will need to issue the following command: node.compile("ds18b20.lua") then reboot the ESP module. If it is not compiled then you will run out of memory when you try to start the web server.

Once ds18b20.lua is compiled edit ds18b20-web.lua (link in previous post) to match the GPIO port you are using and then upload it to the ESP module. Give the module a reboot to flush out the memory.

once the module has rebooted edit the below code to match your wifi network:

wifi.setmode(wifi.STATION)

--Change to match your network
wifi.sta.config("SSID","PASSWORD")

wifi.sta.connect()
tmr.alarm(1, 1000, 1, function()
if wifi.sta.getip()== nil then
print("IP unavaiable, Waiting...")
else
tmr.stop(1)
print("Connected, IP is "..wifi.sta.getip())
dofile("ds18b20-web.lua")
end
end)

Save the code as init.lua and upload it to the ESP. Once the upload is complete reboot the module and if all is well you should be able to visit the ip address printed in the console to view the temperature.
User avatar
By Ambro
#19472 Twaymouth,
Thanks a lot for helping me.
I read your message early this morning but today i was busy to have a try .
I would like to start tomorrow but I will like to use your complete set_up to avoid additional problems.
What lua loader are you using please ?
I hope to be operative tomorrow !
Thanks
Bye
Ambro