I have a serial/rs485 converter to read/write from a Modbus device.
I have the need to be able to read and write from 2 process.
How can i “copy” the real device /dev/ttyUSB0
to specify in my programm the virtual devices as i would with the physcial one? E.g. (/dev/ttyUSB0-1
, /dev/ttyUSB-2
).
I have tried it with socat:
socat -d -d pty,raw,echo=0,link=/dev/ttyUSB0-1 pty,raw,echo=0,link=/dev/ttyUSB0
socat -d -d pty,raw,echo=0,link=/dev/ttyUSB0-2 pty,raw,echo=0,link=/dev/ttyUSB0
But no program gets a response.
Not sure if the request even reaches the real serial device.