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.

Rs 485
#1
Hello admin, I have a device that operates on RS485. I would like to read data from it. It's not Modbus, but some other RS485. How can I 'listen' to what is coming on the port?
Reply
#2
This script will log every received character in hexadecimal form.
Code:
port = require('serial').open('/dev/RS485-1', {
  baudrate = 9600,
  parity = 'even',
  duplex = 'half',
})

while true do
  ch = port:read(1, 1)
  if ch then
    loghex(ch)
  end
end
Reply
#3
I needed something similar for rs232 too. There was one example on the site for rs 232 but it is gone.
Thank you!
Reply
#4
For RS232 change /dev/RS485-1 to /dev/RS232 and duplex from half to full
Reply


Forum Jump: