This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Lutron send command
#6
(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>
Reply


Messages In This Thread
Lutron send command - by Hadeel - 31.05.2024, 08:17
RE: Lutron send command - by admin - 31.05.2024, 09:21
RE: Lutron send command - by Hadeel - 05.06.2024, 04:08
RE: Lutron send command - by Andrea Becagli - 16.09.2024, 11:43
RE: Lutron send command - by admin - 16.09.2024, 11:57
RE: Lutron send command - by Andrea Becagli - 16.09.2024, 12:28
RE: Lutron send command - by admin - 16.09.2024, 12:31
RE: Lutron send command - by Andrea Becagli - 16.09.2024, 12:35

Forum Jump: