So, I have the lastest nodemcu master firmware with http module.
My code has a 15sec timer just for http get on my site that returns detetime stamp.
The logical is simple, if success store the time stamp in a variable, if network fail ,set fail in var and in every next attempt to do "get" include an flag, my server stores this fail.
The problem is return code "-1" that I dont know what means and appears that request is sent to my server anyway.
I Don't know if http stores the request in a buffer or something like that....so, anybody can help me?
http.get("http://httpbin.org/exemple.php" .. set_error, nil, function(code, data)
if (code < 0) then
print("HTTP request failed")
set_error = "?id=error"
else
print(code, data)
set_error = ""
end
end)