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.
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.