16.09.2024, 11:57
Try this modified function and post what you get in Logs:
Code:
function lutron_login()
local tcp, tcp_err = lutron_connect()
if not tcp then
return nil, tcp_err
end
local res, err
res, err, partial = tcp:receive()
log(res, err, partial)
tcp:send(user..'\r\n')
res, err, partial = tcp:receive()
log(res, err, partial)
tcp:send(password..'\r\n')
res, err, partial = tcp:receive()
log(res, err, partial)
if res == nil or res == 'bad login' then
tcp:close()
return nil, res
end
return tcp
end