--init.lua -- Check every 600000 10 minutes - 15000 - 15sec -900.000 15 min --tempout = 0 -- Initialize value that holds temp wifi.setmode(wifi.STATION) --modify according your wireless router settings wifi.sta.config("wlan-id","passwort") wifi.sta.connect() tmr.alarm(1, 1000, 1, function() if wifi.sta.getip()== nil then print("IP unavaiable, Waiting...") print("Setting up WIFI...") else tmr.stop(1) print("Config done, IP is "..wifi.sta.getip()) tempout = 0 ipadress = wifi.sta.getip() dofile('ds.lua') dofile('send.lua') tmr.alarm(2, 300000, 1, function() -- Do every 15 minutes print("Config done, IP is "..wifi.sta.getip()) tempout = 0 dofile('ds.lua') dofile('send.lua') -- node.dsleep(400000000) tmr.wdclr(2) end) end end) srv = net.createServer(net.TCP) srv:listen(80, function(conn) conn:on("receive", function(conn, payload) print(payload) conn:send('HTTP/1.1 200 OK\r\nConnection: keep-alive\r\nCache-Control: private, no-store\r\n\r\n') conn:send('') conn:send('') conn:send('') conn:send('') conn:send('') conn:send('') conn:send('(2_ESP8266 & DS18B20)') conn:send('') conn:send('') conn:send('

(2_ESP8266 & DS18B20)

') conn:send('

') conn:send(' C

') conn:send('IP-Adresse=') conn:send('

') conn:send('

') conn:send('') conn:close() collectgarbage() end) conn:on("sent", function(conn) conn:close() end) end)