14.12.2023, 09:43
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