Data Sheet

40
print ("ChecksumTest: "..ChecksumTest)
end
--- Get temp and send data to thingspeak.com
function sendData()
getTemp()
tmr.stop(2)
-- conection to thingspeak.com
print("Sending data to TCP Server")
conn=net.createConnection(net.TCP, 0)
conn:on("receive", function(conn, payload) print(payload) end)
-- api.thingspeak.com 184.106.153.149
conn:connect(80,'192.168.4.1')
conn:send("T="..Temperature.."."..TemperatureDec.." H="..Humidity.."."..HumidityDec.."\r\n")
conn:on("sent",function(conn)
print("Closing connection")
conn:close()
end)
conn:on("disconnection", function(conn)
print("Got disconnection...")
end)
end
-- send data every X ms to thing speak
tmr.alarm(2, 300, 1, function() sendData() end ) --60000
Lesson19: Wireless Toliet Led Indicator
When we sit on the seat of office, sometimes want to go the toilet, but do not know the toilet