I have 2 esp8266, one with relay and another with temperature sensor. I would like to enter temperature when relay triggers - and I want to this data to be captured from http web server page.
Is this possible somehow?
Explore... Chat... Share...
zhivko wrote:Is it possible to fetch a text that user entered in textbox to lua variable?
I have 2 esp8266, one with relay and another with temperature sensor. I would like to enter temperature when relay triggers - and I want to this data to be captured from http web server page.
Is this possible somehow?
srv:listen(80,function(conn)
conn:on("receive", function(client,request)
local buf = "";
local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");
if(method == nil)then
_, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP");
end
local _GET = {}
if (vars ~= nil)then
for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do
_GET[k] = v
end
end
for i = 1, 16, 1 do
if (bitStream[i] > 3) then
humidity = humidity + 2 ^ (16 - i)
end
if (bitStream[i + 16] > 3) then
temperature = temperature + 2 ^ (16 - i)
end
end
--DHT data acquired, process.
for i = 1, 16, 1 do
if (bitStream[i + 0] > 2) then
humidity = humidity + 2 ^ (16 - i)
end
if (bitStream[i + 16] > 2) then
temperature = temperature + 2 ^ (16 - i)
end
end
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]