Hi Erwin,
That still didn't work either .. the first command executes however the second one does not.
Even in a really simple example, the second command doesn't execute with the added \r. For example
If I split this into two separate scripts and run the first one, then the second one a second later the commands execute as expected - however if I call sendCommand twice from the same script, the second calls fails (and I never see 'Sleep 2' in the logs.
Any idea why this would be happening?
Kind Regards
James
That still didn't work either .. the first command executes however the second one does not.
Even in a really simple example, the second command doesn't execute with the added \r. For example
Code:
function sendCommand(command)
local socket = require("socket").tcp()
data, err = socket:connect('192.168.1.200', 4999)
data, err = socket:send(command .. '\x0D\x0A' .. '\r')
end
sendCommand('0113U');
os.sleep(1)
log('Sleep 1')
sendCommand( '0113S');
log('Sleep 2')
If I split this into two separate scripts and run the first one, then the second one a second later the commands execute as expected - however if I call sendCommand twice from the same script, the second calls fails (and I never see 'Sleep 2' in the logs.
Any idea why this would be happening?
Kind Regards
James