Open andrewdutoit1978 opened 8 years ago
I would imagine that would be the case, how are you getting that value? If you are using PHP try trimming the result.
Hi,
Ok created simple HTML Body with hardcoded value "1" and still doesnt work, I still get the message in the console: "Light Received power http://192.168.2.151/test.html state is currently NaN
I dont even see this in the code for the status check,
any ideas?
What are you putting in your config json file?
Hello, I have a problem too.
when I told siri to turn on the light the light turns on but siri told me "sorry I couldn't" (in Japanese) the same when turning off the light.
hope you can help me Thank you.
[ライト] Setting power state to on [ライト] HTTP set power function failed: Parse Error [ライト] Setting power state to on [ライト] HTTP set power function failed: Parse Error
here is the source for ESP-01
wifi.setmode(wifi.STATION) wifi.sta.config("xxx","xxx") print(wifi.sta.getip()) led1 = 3 led2 = 4 gpio.mode(led1, gpio.OUTPUT) gpio.mode(led2, gpio.OUTPUT) buf1 = "0" srv=net.createServer(net.TCP) 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 buf = '
'; local _on,_off = "","" if(_GET.pin == "ON1")then gpio.write(led1, gpio.HIGH); elseif(_GET.pin == "OFF1")then gpio.write(led1, gpio.LOW); elseif(_GET.pin == "ON2")then gpio.write(led2, gpio.HIGH); buf1 = "1"; buf = buf..buf1..""; elseif(_GET.pin == "OFF2")then gpio.write(led2, gpio.LOW); buf1 = "0"; buf = buf..buf1.."
Hi,
I have built a test.html that returns the following body (see below) (1 for on, 0 for off) but it does not seem to work any ideas, could it be the spaces in the body that causes it to fail?
Thanks Andrew
--snip---snip----
1--snip---snip----