Classic Ladder and RS 485 Relay Switch - Hortensie/CNC_x_axis_linuxcnc_mesa_5i25_7i76 GitHub Wiki
lsusb
Bus 002 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
sudo dmesg | awk '/tty/ && /USB/ {print "/dev/"$10}'|tail -1
udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0)
Lastly in my case i was still facing communication problems and I needed to change permissions to my port:
sudo chmod 777 /dev/ttyUSB0
NOTE: AFTER PC reboot above command might be disabled so you might set it permanently.
Modbus communication setup, just example - works in my case. You might change speed or other params - depends on end device:
MODBUS_MASTER_SERIAL_PORT=/dev/ttyUSB0
MODBUS_MASTER_SERIAL_SPEED=115200
MODBUS_MASTER_SERIAL_DATABITS=8
MODBUS_MASTER_SERIAL_STOPBITS=1
MODBUS_MASTER_SERIAL_PARITY=0
MODBUS_ELEMENT_OFFSET=0
MODBUS_MASTER_SERIAL_USE_RTS_TO_SEND=0