I am working on a project that requires sending data to a webserver from a esp8266 running
nodemcu (branch: dev140).
At some point on my code I call this function:
sendData = function()
sk = net.createConnection(net.TCP, 0)
sk:on("receive", function(data)
print("receive: " .. data)
end)
sk:on("connection", function(lsocket)
payload = tempStatus()
print("sending... " .. payload)
lsocket:send("POST /proxy HTTP/1.1\r\n")
end)
-- sk:on("sent", function() sk.close() end)
sk:connect(5000, "192.168.1.212")
end
I can see the payload (json) in the console, right before calling the method
send on the socket. The problem is that the server does not receive any
request.
I can also see the wifi setup has been done correctly and I have an IP
address assigned.
Any feedback on what may be wrong here would be appreciate it.
Thanks,
-drd