i wrote a little lua which reads a state of a button and notifys me when the button is pushed :
pin = 4
gpio.mode(pin,gpio.INPUT)
if gpio.read(pin)== 1 then
conn=net.createConnection(net.TCP, false)
conn:on("receive", function(conn, pl) print(pl) end)
conn:connect(80,"50.116.34.97")
conn:send("GET /publicapi/notify?apikey=apikey&application=ESP8266&event=START&description=Der%20Schalter%20wurde%20gedrückt\r\n"
.."Connection: keep-alive\r\nAccept: */*\r\n\r\n")
end
What do I've to do, that it starts at the boot of the esp8266 and repeats so often as possible?