I am sending data between two ESP8266 modules via TCP connection every 10 seconds in Lua:
string="abc"
cl=net.createConnection(net.TCP, 0)
cl:connect(80,"192.168.4.1")
tmr.alarm(2, 10000, 1, function()
cl.send("The string variable is: "..string.."")end)
However, if I want to send string variable as in the code above, I keep getting error message:
PANIC: unprotected error in call to Lua API (init.lua:26: bad argument #1 to 'send' (net.socket expected, got string))
PANIC: unprotected error in call to Lua API (bad argument #1 (Server/Socket expected))
It works for me just when sending numerical variables. Is there any way to send string variable?
Thanks, Kaki