Re: stdin:1: attempt to index global 'senddata' (a nil value
Posted: Sun Jan 18, 2015 7:02 am
Came to update and you had answered it for me
When the code is in a function it runs all the code pretty much instantaneously. When I past it via my LuaLoader its sent line by line which slows it down significantly.
This code works perfectly and is moved into a timer now.
now just waiting for an 03 so I can make the thing sleep between sending temps.
When the code is in a function it runs all the code pretty much instantaneously. When I past it via my LuaLoader its sent line by line which slows it down significantly.
This code works perfectly and is moved into a timer now.
Code: Select all
tmr.alarm(0, 15000, 1, function()
conn=net.createConnection(net.TCP, 0)
conn:connect(5050,'192.168.1.8')
conn:send("add|"..t.read().."|ceiling\n")
print('sending temp data')
conn:on("sent",function(conn)
print("Closing connection")
conn:close()
end)
conn:on("disconnection", function(conn)
print("Got disconnection...")
end)
end)
now just waiting for an 03 so I can make the thing sleep between sending temps.