15.03.2023, 14:45
nil means no error. You don't need to change anything in Modbus, it is not related to using serial ports in scripts. Check that projector has the same baud rate as the script. Check if you get any reply before closing the port:
Do this with reversed RX/TX as well. Make sure that GND is connected between the projector and LM.
Code:
res, err = port:read(-1, 2)
log(res, err)
-- close port
port:close()