16.09.2024, 12:28
(16.09.2024, 11:57)admin Wrote: 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
So here is the log:
Code:
Event for prova lutron cmd (1/1/1) 16.09.2024 14:21:15
* arg: 1
* nil
* arg: 2
* string: timeout
* arg: 3
* string: login:
Event for prova lutron cmd (1/1/1) 16.09.2024 14:21:25
* arg: 1
* nil
* arg: 2
* string: timeout
* arg: 3
* string: password:
Event for prova lutron cmd (1/1/1) 16.09.2024 14:21:35
* arg: 1
* nil
* arg: 2
* string: timeout
* arg: 3
* string: GNET>