To use kplex to create "virtual" serial ports (do please let me know if this doesn't work for any particular application):
Your example is "in only" so we'll go with that.
Let's assume your "real" device is /dev/usbtty1 and you're happy with the default 4800 baud (see the
configuration guide for other settings)
Your stanza for this interface in kplex.conf might look like:
[serial]
filename=/dev/ttyusb1
direction=in
Now say you want to create a couple of "virtual" serial ports, /tmp/ocpnserial and /tmp/otherapp
[pty]
filename=/tmp/ocpnserial
direction=out
group=dialout
mode=640
[pty]
filename=/tmp/otherapp
direction=out
group=dialout
mode=640
See the
configuration section for more details. The "group" directive is the group to assign to the pty. and ability to use this assumes that kplex is running as root. "dialout" is the linux group which generally gives access to serial port, an assumption used in the opencpn documentation. mode 640 will give group read access, which is probably what you want. The user will then of course need to be in the "dialout" group. Note that we don't *actually* need to set a baud rate for ptys. You can: it just won't do anything because these aren't backed by real UARTs.
Now the above is fine if you have one instance of kplex whose only job is to fan out one serial input to two "pseudo terminals" ("fake serial ports"). If however kplex is doing other things and you only want data from your actual serial port to be distributed to the pseudo-ttys, first add a name directive to the serial port stanza, e.g.:
name=inputserial
Then add the following directive to each of the pty stanzas to only output data received on that input:
ofilter=+*****%inputserial:-all
It may of course just be easier to output data on a network interface (loopback if all on one host) if all applications you want to use support that: Let me know if you want more details.
Per this morning's post it's been years since I played with ESXi but assuming vmware has drivers and your serial port is recognised, google "ESXi serial port passthrough" or somesuch: there seems to be a few kb articles.