Last August I posted using Python for Remote Serial Port Access. In fact, there is many other way to do the same, without the need to run a script. The widely used is opening pseudo-ttys via SSH connection, as mentioned https://github.com/npat-efault/picocom:
$ ssh -t user@termbox picocom -b 115200 /dev/ttyS0
Picocom is a terminal emulator, similar like minicom, PuTTy and Teraterm, with very small footprint. One problem is that it is tty based, and Windows does not expose Serial Port/UART as TTY devices. Cygwin does not provide picocom package. Even we can compile picocom from source for Cygwin, it is worthless as it cannot open Windows native serial port device.
The solution is WSL. With WSL, it is possible to access native device from the Linux environment running as Windows Sub-System. Nowadays, model PC/Laptop does not have RS-232 port, mostly, external device with UART output will be connected to PC with a Uart-over-USB (FTDI chip). Unfortuenately, as of today, WSL2 still does not support USB device. As I mentioned here, may need to stick with WSL1 for this feature at this moment.
Two things need to be done on WSL: install picocom and setup SSH server.
Install picocom
CPPFLAGS=-DNO_CUSTOM_BAUD make
or run picocom with env setting: NO_CUSTOM_BAUD=1
. If taking the env setting way, need to make sure the setting is taking effect for SSH session. So better use the build option. CPPFLAGS=-DNO_CUSTOM_BAUD make
Setup SSH server
Open UART remotely
ssh -t user@wsl_host picocom -b 115200 /dev/ttyS10
Above will try to open the COM10 on the wsl_host pc remotely. Note picocom is a terminal emulator, just like minicom, there is no GUI interface. To quit, press C-a, then C-x. Looking for help? Press C-a, then C-h.