Good day, dear Habra community! Today, you guessed it, we’ll talk about the so-called “forwarding” of the
good old COM port from Linux to Windows.
We have a Windows-based computer from which we need to get remote access to one or more physical COM ports (RS-232) on a Linux computer. About this and talk.
Linux
Here we will use the ser2net package. In my distribution (ubuntu) it is available from the standard repository, and I used this version. Installation is trivial and looks like this:
sudo apt-get install ser2net
After installing the package in the configuration file, you must add the device of interest and describe the connection parameters.
')
This is how the settings file looks like before making changes (comments from the author)
/etc/ser2net.conf:
# Banner - this line is issued to the TCP port of the client upon connection and may contain the port, the speed
# works with the current port and the device name in the system. Banner output is more relevant for the telnet method.
# connect to the port, we do not need it. You can comment out the line so as not to mazol eyes.
BANNER: banner: \ r \ nser2net port \ p device \ d [ \ s ] ( Debian GNU / Linux ) \ r \ n \ r \ n
# Parameters for connecting to ports / dev / ttyS0 and / dev / ttyS1
# The config below has the following format:
# TCP port: state: timeout: device: options (option1 option2 - space separated)
# TCP port - everything is clear here, this is the port that our server will listen to.
# State - can be raw or rawlp or telnet. It can also be off.
# Timeout - time (in seconds) after which the client will be
# disconnected when inactive. A value of 0 disables the feature.
Device is the device that we want to "hang" outside. We write here something like:
# / dev / ttyS0 or / dev / ttyUSB0
# Options - sets additional parameters for working with the port. I will not give all the parameters
# in the config, everything is fine set out.
# Default settings:
2000 : telnet: 600 : / dev / ttyS0: 9600 8DATABITS NONE 1STOPBIT banner
2001 : telnet: 600 : / dev / ttyS1: 9600 8DATABITS NONE 1STOPBIT banner
3000 : telnet: 600 : / dev / ttyS0: 19200 8DATABITS NONE 1STOPBIT banner
3001 : telnet: 600 : / dev / ttyS1: 19200 8DATABITS NONE 1STOPBIT banner
# As we can see, 2 physical COM ports are configured here.
# And 4 types of connections to them at different speeds and ports, respectively.
And so the settings look at me
/etc/ser2net.conf:
2222 : raw: 0 : / dev / ttyUSB0: 9600 NONE 1STOPBIT 8DATABITS -XONXOFF -RTSCTS LOCAL
In our case, the type of connection to the port will be RAW. Timeout 0. The speed required by my device is 9600. Parity is not checked. Stop bit one. Data bits are 8 bits. XON / XOFF off. Hardware flow control is disabled. Monitoring of DTR modem lines - as I understand it. The config is small, in case of problems we look in the syslog.
After making the necessary changes, save the settings file and reboot the daemon:
sudo service ser2net restart
Check the logs - make sure that the demon is running and listening to the port. Then we put the terminal aside in front of Windows ...
Windows
HW Virtual Serial Port
On the ser2net project page, this program is listed as compatible, it’s a pity that I didn’t start it for the first time. It interests us HW VSP Singleport - since the multiport version only supports devices from the HW Group and is not suitable for our purposes. The program supports Windows 7 and x64 bit platforms. The only limitation is that with its help we will be able to “forward” only 1 COM port. For those wishing to the site can be purchased HW VSP3 Source codes.

During installation, we are interested in installing the service and the GUI to it. After installation, run the program from the start menu or desktop and press login. The password will already be entered and you will only have to click on OK. First, go to the Settings tab and tick the Create VSP Port when HW VSP Start-up checkbox (of course, if you wish, but it is often necessary). The program itself can be closed, the work is performed by the service that can be detected in the Windows hardware (Start-Run: services.msc).
Next, go to the Virtual Serial Port tab. Assign the virtual COM port number to which our remote port will be connected. Next, enter the IP and Port of our server with the ser2net daemon (see the map above). And click Create COM. In the LAN status, it should soon be Connected, and in the VSP status, Created. The port is connected and ready to connect.
DownloadMCSI2000
During the installation, an error message was popped up in the registry, I sin on a virtual environment. because put on a real gland was not possible. No credentials need to be set during installation.

When the installation is completed, the Add Virtual Port dialog will appear. Specify the virtual port number in the system. We select Direct (Direct connection, without autodiscovery) we drive in IP of our server. The type of connection is RAW, the port corresponds to your settings in ser2net and click Add. The installer will prompt you to add another port. When all ports are added, click Done, after which the installation program will offer to reboot the computer. Of the potential disadvantages - the lack of support for x64 and Windows 7. Of the benefits - you can add a considerable number of ports.
DownloadTibbo Device Server Toolkit
Fundamentally, the setting is no different from the previous ones. After installation, start the Tibbo VSP Manager from the start menu and click Add. One of the advantages of this program is the ability to save a connection profile. Including compare with the user, which is very convenient. Set the virtual port number, Connection mode: immediatly, On-the-fly-commands: disabled, as well as the IP address and port of the server.

Unfortunately, this program did not work for me. This is what I saw when I looked at Device Manager.

Check on something else, as I wrote - I do not have the opportunity.
Download (registration required)
All of the above programs do not allow the use of COM RTS output in this configuration. To obtain this functionality, you need to install fully compatible software on both Windows host and Linux. Or use specialized hardware aka Serial to Ethernet. If something is not written - correct. It is possible in a personal, and it is possible and in comments, I do not bite =)
Useful links:
WTPRO thin client COM port redirectionMy question is in Q & AThanks to
max_rip for a tip in Q & A and to all who this post was interesting. Successes!