09.02.2020, 12:27
'\x0D\x0A' is the same as '\r\n' so extra '\r' is not needed
I think the problem might be with multiple connections which the gateway might not handle properly. Try sending two commands in the same connection:
I think the problem might be with multiple connections which the gateway might not handle properly. Try sending two commands in the same connection:
Code:
sock = require("socket").tcp()
sock:settimeout(5)
res, err = sock:connect('192.168.1.200', 4999)
if res then
sock:send('0113U\r\n')
os.sleep(1)
sock:send('0113S\r\n')
sock:close()
end