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.

RS232 serial read
#1
Hello,

I have a code which logs every char received be serial port:
Code:
if not port then
 require('serial')
 port = serial.open('/dev/RS232', { baudrate = 9600, parity = 'none', duplex = 'full' })
 port:flush()
end

-- port ready
if port then
  char = port:read(1, 1)
 if char then
   alert(char)
 end
end

What I need is to find specific string in received data. For example "OUT1ON" or "OUT1OFF" and based on it control KNX object. Maybe someone can help me with that?
Reply


Messages In This Thread
RS232 serial read - by leonidas - 20.04.2017, 10:45
RE: RS232 serial read - by admin - 20.04.2017, 10:52
RE: RS232 serial read - by leonidas - 20.04.2017, 11:08
RE: RS232 serial read - by admin - 20.04.2017, 12:10
RE: RS232 serial read - by Gadjoken - 16.03.2018, 17:08
RE: RS232 serial read - by leonidas - 20.04.2017, 12:21
RE: RS232 serial read - by admin - 16.03.2018, 17:17
RE: RS232 serial read - by Gadjoken - 19.03.2018, 07:27
RE: RS232 serial read - by admin - 19.03.2018, 07:36
RE: RS232 serial read - by Gadjoken - 19.03.2018, 13:39
RE: RS232 serial read - by admin - 20.03.2018, 09:12
RE: RS232 serial read - by Gadjoken - 20.03.2018, 10:35

Forum Jump: