Let me show you this small code
uart.setup(0, 9600, 8, 0, 1, 0)
srv=net.createServer(net.TCP)
srv:listen(4466,function(conn)
conn:on("receive",function(conn,payload)
-- print(payload)
uart.write(0, payload)
conn:send("<h1> Hello, NodeMcu.</h1>")
end)
end)
It just forward to an Arduino the command, for example, HELLO http://192.168.0.152:4466/HELLO
However, after more or less 10 commands, the ESP8266 resets or hangs.
I had the same problem doing the same task with AT commands. So it seems a hardware related issue.
Any idea?
Thanks in advance.