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.

Script to control an Epson projector via RS-232
#1
Today I created a small script in a KNX object to turn my Epson projector on off via a serial link. 

Code:
123456789101112131415161718192021222324
require('serial') -- device on the LogicMachine connected to the Epson projector -- ttyUSB0 is typical for a USB RS-232C -- tested with adapter based on FT232 or CP210x chip. device = '/dev/ttyUSB0' -- opens a serial port using the sugested values of Epson manual -- https://support.math.unipd.it/sites/default/files/epson_emp_835.pdf port = serial.open(device, { baudrate = 9600, parity = 'none', stopbits = 1  }) -- get value of KNX object value = event.getvalue() if (value == true) then  -- send power on command with returns to make them stick  char = "PWR ON\r\n"    port:write(char) else  -- send power off command  char = "PWR OFF\r\n"    port:write(char) end -- close port port:close()
Reply


Forum Jump: