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
#2
Modify lutron_login() in the user library to log the data that is sent to LM.
Code:
function lutron_login()
  local tcp, tcp_err = lutron_connect()

  if not tcp then
    return nil, tcp_err
  end

  local res, err

  res, err = tcp:receive(7)
  log(res, err)
  
  tcp:send(user..'\r\n')
  
  res, err = tcp:receive(10)
  log(res, err)

  tcp:send(password..'\r\n')
  
  res, err = tcp:receive(9)
  log(res, err)

  if res == nil or res == 'bad login' then
    tcp:close()
    return nil, res
  end

  return tcp
end

Add log(lutron_receive(tcp)) at the end of your script to check the reply.
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

Forum Jump: