Skip to content

Instantly share code, notes, and snippets.

@topic2k
Forked from DraTeots/ComPort over Network.md
Created February 26, 2024 11:29
Show Gist options
  • Select an option

  • Save topic2k/d3016c581d2daae129099f6d54b9cca5 to your computer and use it in GitHub Desktop.

Select an option

Save topic2k/d3016c581d2daae129099f6d54b9cca5 to your computer and use it in GitHub Desktop.

Revisions

  1. Dmitry Romanov revised this gist Jan 10, 2021. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,6 @@

    <br>

    > Before we start, **comport** = **serial port**. More on the terms here: [What's the difference between “COM”, “USB”, “Serial Port”](https://stackoverflow.com/questions/27937916/whats-the-difference-between-com-usb-serial-port).

    ## The problem

    Suppose we have an application that works with some device using serial port (com port or comport - the same thing). It could be GPS reader, IRDA, whatever. So it looks like this:
  2. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 13 additions and 2 deletions.
    15 changes: 13 additions & 2 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -7,11 +7,12 @@
    - [WINDOWS](#windows)
    * [Server](#server)
    * [Client](#client)
    * [Driver Signature](#driver-signature)
    - [LINUX](#linux):
    * [Server](#linux-server)
    * [Client](#linux-client)
    - [Connect over the internet](#connect-over-the-internet)
    - [Driver Signature (deprecated)](#driver-signature)


    <br>

    @@ -164,7 +165,17 @@ So, the more detailed client diagram looks like this now:

    ### Driver Signature

    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you: according to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) on Windows 8x64 you may get problem with driver installation if you don't have the driver signature verification turned off. To enable driver test mode and sign a driver for windows, one may download [DSEO](https://www.ngohq.com/driver-signature-enforcement-overrider.html)
    **Deprecated part** - com0com 3.0.0 comes with driver signarure. Unfortunately on newer windows (since 2018) this doesn't help.

    > According to Windows Driver Signing Policy "Starting with Windows 10, version 1607, Windows will not load any new kernel-mode drivers which are not signed by the Dev Portal." (link)[https://sourceforge.net/p/com0com/discussion/440109/thread/c4d52f1b/?limit=25]
    There are 3 solutions:

    - Disable driver signature verification (bad)
    - Use version 2.2 (it works)
    - Use [DSEO](https://www.ngohq.com/driver-signature-enforcement-overrider.html)

    (older problem) According to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) on Windows 8x64 you may get problem with driver installation if you don't have the driver signature verification turned off. To enable driver test mode and sign a driver for windows, one may download [DSEO](https://www.ngohq.com/driver-signature-enforcement-overrider.html)

    <br>
    <br>
  3. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -164,7 +164,7 @@ So, the more detailed client diagram looks like this now:

    ### Driver Signature

    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you: according to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) on Windows 8x64 you may get problem with driver installation if you don't have the driver signature verification turned off. To enable driver test mode and sign a driver for windows, one may download [DSEO](http://www.ngohq.com/?page=dseo)
    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you: according to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) on Windows 8x64 you may get problem with driver installation if you don't have the driver signature verification turned off. To enable driver test mode and sign a driver for windows, one may download [DSEO](https://www.ngohq.com/driver-signature-enforcement-overrider.html)

    <br>
    <br>
  4. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 2 additions and 23 deletions.
    25 changes: 2 additions & 23 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -164,7 +164,7 @@ So, the more detailed client diagram looks like this now:

    ### Driver Signature

    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you. But look in the end of the document if it bugs you.
    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you: according to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) on Windows 8x64 you may get problem with driver installation if you don't have the driver signature verification turned off. To enable driver test mode and sign a driver for windows, one may download [DSEO](http://www.ngohq.com/?page=dseo)

    <br>
    <br>
    @@ -232,25 +232,4 @@ All the above solutions basically describe how to forward data from com-port (se
    For me one of the versatile easy to configure ways was to use [ZeroTier VPN](https://www.zerotier.com/) services. It is [free for up to 100 devices](https://www.zerotier.com/pricing/) and have a good interface for easy configuration, good manuals, etc. In the end you have a network interface on each of the machines which acts as a single local network (basically what VPN is).

    > I'm NOT connected anyhow with Zerotier co. Just share the solution which was optimal for me. "As is".

    ## [Deprecated] driver signature
    This shouldn't be an issue today. But... According to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) on Windows 8x64 you may get problem with driver installation if you don't have the driver signature verification turned off.

    To enable driver test mode and sign a driver for windows, one may download
    [DSEO](http://www.ngohq.com/?page=dseo)

    Then run it

    Enable Test Mode (if you hasn't done it before)
    Sign a system file

    ```
    c:\Windows\System32\drivers\com0com.sys
    ```

    ```d:\Tools\ComOverNetwork\com0com\``` - is where I installed com0com

    Restart the system


  5. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -7,12 +7,11 @@
    - [WINDOWS](#windows)
    * [Server](#server)
    * [Client](#client)
    * [Driver Signature (deprecated)](#driver-signature)
    - [LINUX](#linux):
    * [Server](#linux-server)
    * [Client ?](#linux-client)
    * [Client](#linux-client)
    - [Connect over the internet](#connect-over-the-internet)

    - [Driver Signature (deprecated)](#driver-signature)

    <br>

  6. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 19 additions and 19 deletions.
    38 changes: 19 additions & 19 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -165,25 +165,7 @@ So, the more detailed client diagram looks like this now:

    ### Driver Signature

    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you...

    According to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) and my own experience, on Windows 8x64 you probably will get problem with driver installation if you don't have the driver signature verification turned off.

    To enable driver test mode and sign a driver for windows, one may download
    [DSEO](http://www.ngohq.com/?page=dseo)

    Then run it

    Enable Test Mode (if you hasn't done it before)
    Sign a system file

    ```
    c:\Windows\System32\drivers\com0com.sys
    ```

    ```d:\Tools\ComOverNetwork\com0com\``` - is where I installed com0com

    Restart the system
    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you. But look in the end of the document if it bugs you.

    <br>
    <br>
    @@ -252,6 +234,24 @@ For me one of the versatile easy to configure ways was to use [ZeroTier VPN](htt

    > I'm NOT connected anyhow with Zerotier co. Just share the solution which was optimal for me. "As is".

    ## [Deprecated] driver signature
    This shouldn't be an issue today. But... According to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) on Windows 8x64 you may get problem with driver installation if you don't have the driver signature verification turned off.

    To enable driver test mode and sign a driver for windows, one may download
    [DSEO](http://www.ngohq.com/?page=dseo)

    Then run it

    Enable Test Mode (if you hasn't done it before)
    Sign a system file

    ```
    c:\Windows\System32\drivers\com0com.sys
    ```

    ```d:\Tools\ComOverNetwork\com0com\``` - is where I installed com0com

    Restart the system


  7. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -55,7 +55,7 @@ So now the application just works with serial port on the client machine, and do

    ## The solution in theory

    One of the solutions is using telnet with [RFC2217 - Telnet Com Port Control Option](https://tools.ietf.org/html/rfc2217). Is solves exactly the problem above. There are a lot of software that supports telnet+RFC2217 serial port forwarding. It allows you to run the server and the client on linux or windows machines (and MACs I suppose, but haven't tested it). Thus can, as example, run linux server and windows client, both using completely different packages, but because of RFC2217 they 'know' how to communicate.
    One of the solutions is using telnet with [RFC2217 - Telnet Com Port Control Option](https://tools.ietf.org/html/rfc2217). Is solves exactly the problem above. There are a lot of software that supports telnet+RFC2217 serial port forwarding. It allows you to run the server and the client on linux or windows machines (and MACs I suppose, but haven't tested it). This allows one to run linux server and windows client. Both would use completely different software, but because of RFC2217 standard they 'know' how to communicate.


    More over you can multiplex the com ports and encrypt the data. Whatever you want.
    @@ -235,8 +235,12 @@ That is it. Read ser2net docs for more
    socat /dev/ttyS2,b115200,raw,echo=0 TCP:192.168.123.30:7000
    ```

    [socat man](https://linux.die.net/man/1/socat)
    - 192.168.123.30 - your server IP
    - 7000 server port
    - your app should connect to /dev/ttyS2
    - 115200 - port baud rate

    [socat man](https://linux.die.net/man/1/socat)

    <br>

  8. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -86,11 +86,9 @@ For the server you need only hub4com.

    *Configuration (I just cite the documentation)*:


    You have a server computer with phisical COM1 port and you'd like to share it
    through the network by the RFC 2217 "Telnet Com Port Control Option" protocol:


    Start the com2tcp-rfc2217.bat on COM1 port. For example:

    ```cmd
    @@ -127,35 +125,37 @@ COM port pair (see com0com's ReadMe.txt for more info). For example:
    command> install PortName=COM19,EmuBR=yes PortName=COM20
    ```

    > Start the com2tcp-rfc2217.bat on COM19 port. For example:
    Example. Start the com2tcp-rfc2217.bat on COM19 port:

    ```
    com2tcp-rfc2217 \\.\COM19 192.168.123.30 7000
    ```

    It will redirect virtual serial port COM20 on the second computer to the physical serial port on the first computer.

    > (!) it is important using this example. Your Application should connect to COM20. We have a virtual serial port pair, we connect com2tcp to one of the ports and your application connects to the other

    > (!) TL;DR; Your Application should connect to COM20.

    <br>
    <br>

    **Explanation**

    > TL;DR; We have a virtual serial port pair COM19<->COM20, we connect com2tcp to one of the ports (COM19) and your application connects to the other (COM20)
    It is bit counter intuitive why a virtual pair is created.
    To explain what happens, imagine we create a virtual comport pair: COM5<->CNCB0 as in the example above.
    To explain what happens, imagine we create a virtual comport pair: COM19<->COM20 as in the example above.
    The reason one needs a pair is that only one thing can be connected to a COM port. If hub4com binds network data
    to CNCB0, then the port is taken and your application can't connect to it. So virtual comport pair mirrors everything
    from CNCB0 to COM5, which is free and your application can connect to it.
    to COM19, then the port is taken and your application can't connect to it. So virtual comport pair mirrors everything
    from COM19 to COM20, which is free and your application can connect to it.

    So, the more detailed client diagram looks like this now:


    ```
    network +---------+ +-------+------+ +---+
    ....==========| hub4com |~~~| CNCB0 = COM5 |~~~~~~~~~~~~|APP|
    +---------+ +-------+------+ +---+
    network +---------+ +-------+-------+ +---+
    ....==========| hub4com |~~~| COM19 = COM20 |~~~~~~~~~~~~|APP|
    +---------+ +-------+-------+ +---+
    virtual pair
    ```

  9. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 10 additions and 7 deletions.
    17 changes: 10 additions & 7 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -68,7 +68,7 @@ More over you can multiplex the com ports and encrypt the data. Whatever you wan

    ## WINDOWS

    There is an absolutely brilliant free opensoure solution that can be used for comport forwarding, client and server for windows. It is called com0com.
    There is an absolutely brilliant free opensoure solution that can be used for comport forwarding, client and server for windows. It is called com0com. It actually consists of two parts a HUB (hub4com) and kernel-mode virtual serial port driver (com0com) - explained further.

    http://sourceforge.net/projects/com0com

    @@ -77,7 +77,7 @@ http://sourceforge.net/projects/com0com

    ### Server

    For the server you need only hub4com part of it.
    For the server you need only hub4com.

    [Source forge hub4com download link](https://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)

    @@ -119,22 +119,25 @@ You have a server computer your.comport.server with physical serial port
    shared through the network by the RFC 2217 protocol (see above example) and
    you'd like to use it on the client computer like a virtual serial port.

    With the com0com's Setup Command Prompt create COM5<->CNCB0 virtual
    With the com0com's Setup Command Prompt create COM19<->COM20 virtual
    COM port pair (see com0com's ReadMe.txt for more info). For example:

    ```
    >setupc.exe
    command> install 0 PortName=COM5,EmuBR=yes -
    command> install PortName=COM19,EmuBR=yes PortName=COM20
    ```

    > Start the com2tcp-rfc2217.bat on CNCB0 port. For example:
    > Start the com2tcp-rfc2217.bat on COM19 port. For example:
    ```
    com2tcp-rfc2217 \\.\CNCB0 192.168.123.30 7000
    com2tcp-rfc2217 \\.\COM19 192.168.123.30 7000
    ```

    It will redirect virtual serial port COM20 on the second computer to the physical serial port on the first computer.

    > (!) it is important using this example. Your Application should connect to COM20. We have a virtual serial port pair, we connect com2tcp to one of the ports and your application connects to the other

    > It will redirect virtual serial port COM5 on the second computer to the physical serial port on the first computer.



  10. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ Suppose we have an application that works with some device using serial port (co
    Now what we want, is to have the device connected to one machine (server), and run the application on the remote machine (client) over the network. Real life example: a device is connected to raspberry pi (very small single-board machine) that is connected to a local network, and read the data on a desktop.


    Since the application (APP on diagrams) knows only how to communicate with the device by serial port (we suppose), the client machine has to have some virtual serial port that is used by the application. We call it "virtual serial port" or "virtual comport" as it is software emulated. So the diagram is:
    Since the application (APP on diagrams) knows only how to communicate with the device by serial port (we suppose), the client machine has to have some virtual serial port that is used by the application. It is called "virtual serial port" or "virtual comport" as this is a software emulated bridge between a client and your application. So the diagram is:

    ```
    +--------+ comport +--------+ network +--------+ virtual comport +---+
  11. Dmitry Romanov revised this gist Jan 9, 2021. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,12 @@

    <br>

    > Before we start, **comport** = **serial port**. More on the terms here: [What's the difference between “COM”, “USB”, “Serial Port”](https://stackoverflow.com/questions/27937916/whats-the-difference-between-com-usb-serial-port).

    ## The problem

    Suppose we have an application that works with some device using serial port (com port). It could be GPS reader, IRDA, whatever. So it looks like this:
    Suppose we have an application that works with some device using serial port (com port or comport - the same thing). It could be GPS reader, IRDA, whatever. So it looks like this:


    ```
    @@ -30,14 +33,20 @@ Suppose we have an application that works with some device using serial port (co
    Now what we want, is to have the device connected to one machine (server), and run the application on the remote machine (client) over the network. Real life example: a device is connected to raspberry pi (very small single-board machine) that is connected to a local network, and read the data on a desktop.


    Since the application (APP on diagrams) knows only how to communicate with the device by serial port (we suppose), the client machine has to have some virtual serial port that is used by the application:
    Since the application (APP on diagrams) knows only how to communicate with the device by serial port (we suppose), the client machine has to have some virtual serial port that is used by the application. We call it "virtual serial port" or "virtual comport" as it is software emulated. So the diagram is:

    ```
    +--------+ comport +--------+ network +--------+ virtual comport +---+
    | DEVICE | ~~~~~~~~~~ | SERVER |========....==========| CLIENT |~~~~~~~~~~~~~~~~~~|APP|
    +--------+ +--------+ +--------+ +---+
    ```

    Thus we need:

    - SERVER that communicates with the DEVICE through physical serial port and then serves the data over network
    - Client that connects to the server
    - Virtual comport that mimics physical serial port and interface with the APP

    So now the application just works with serial port on the client machine, and doesn't even know that data is actually transmitted over the network.


  12. Dmitry Romanov revised this gist Sep 30, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -217,12 +217,14 @@ That is it. Read ser2net docs for more

    ### Linux Client

    `socat` can be used as a linux client.
    `socat` can be used as a linux client. Socat is a command line based utility that establishes two bidirectional byte streams and transfers data between them.

    ```bash
    socat /dev/ttyS2,b115200,raw,echo=0 TCP:192.168.123.30:7000
    ```

    [socat man](https://linux.die.net/man/1/socat)


    <br>

  13. Dmitry Romanov revised this gist Sep 30, 2020. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -217,7 +217,11 @@ That is it. Read ser2net docs for more

    ### Linux Client

    Mmmm... Can you write it here, please?
    `socat` can be used as a linux client.

    ```bash
    socat /dev/ttyS2,b115200,raw,echo=0 TCP:192.168.123.30:7000
    ```


    <br>
  14. Dmitry Romanov revised this gist May 10, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -96,7 +96,7 @@ It will listen TCP/IP port 7000 for incaming connections and redirect them to C

    ### Client

    To be a windows client you have to install com0com virtual comport driver and hub4com.
    To be a windows client you have to install com0com virtual comport driver and hub4com (provided as 2 separate files).

    [Source forge com0com download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)
    [Source forge hub4com download link](https://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)
  15. Dmitry Romanov revised this gist May 10, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -98,7 +98,7 @@ It will listen TCP/IP port 7000 for incaming connections and redirect them to C

    To be a windows client you have to install com0com virtual comport driver and hub4com.

    [Source forge download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)
    [Source forge com0com download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)
    [Source forge hub4com download link](https://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)

    Create ***a PAIR*** of virtual comports where one is used for RFC2217 and the other is the port for your application will use.
  16. Dmitry Romanov revised this gist May 10, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -98,7 +98,7 @@ It will listen TCP/IP port 7000 for incaming connections and redirect them to C

    To be a windows client you have to install com0com virtual comport driver and hub4com.

    [Source forge download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)
    [Source forge download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)
    [Source forge hub4com download link](https://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)

    Create ***a PAIR*** of virtual comports where one is used for RFC2217 and the other is the port for your application will use.
  17. Dmitry Romanov revised this gist May 10, 2020. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -128,12 +128,13 @@ com2tcp-rfc2217 \\.\CNCB0 192.168.123.30 7000
    > It will redirect virtual serial port COM5 on the second computer to the physical serial port on the first computer.

    ** Explanation **

    **Explanation**

    It is bit counter intuitive why a virtual pair is created.
    To explain what happens, imagine we create a virtual comport pair of COM5<->CNCB0 as in the example above.
    What happens: Only one thing can be connected to a COM port. If hub4com takes data from network and bind it
    to CNCB0, then this port is taken and your application can't connect to it. So virtual comport pair mirrors everything
    To explain what happens, imagine we create a virtual comport pair: COM5<->CNCB0 as in the example above.
    The reason one needs a pair is that only one thing can be connected to a COM port. If hub4com binds network data
    to CNCB0, then the port is taken and your application can't connect to it. So virtual comport pair mirrors everything
    from CNCB0 to COM5, which is free and your application can connect to it.

    So, the more detailed client diagram looks like this now:
  18. Dmitry Romanov revised this gist May 10, 2020. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -136,14 +136,14 @@ What happens: Only one thing can be connected to a COM port. If hub4com takes da
    to CNCB0, then this port is taken and your application can't connect to it. So virtual comport pair mirrors everything
    from CNCB0 to COM5, which is free and your application can connect to it.

    So the more detailed client diagram looks like this now:
    So, the more detailed client diagram looks like this now:


    ```
    network +---------+ +-------+------+ +---+
    ....==========| hub4com |~~| CNCB0 = COM5 |~~~~~~~~~~~~|APP|
    +---------+ +-------+------+ +---+
    virtual pair
    network +---------+ +-------+------+ +---+
    ....==========| hub4com |~~~| CNCB0 = COM5 |~~~~~~~~~~~~|APP|
    +---------+ +-------+------+ +---+
    virtual pair
    ```


  19. Dmitry Romanov revised this gist May 10, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -140,9 +140,9 @@ So the more detailed client diagram looks like this now:


    ```
    network +---------+ +-------+------+ +---+
    ....==========| hub4com |~| CNCB0 = COM5 |~~~~~~~~~~~~|APP|
    +---------+ +-------+------+ +---+
    network +---------+ +-------+------+ +---+
    ....==========| hub4com |~~| CNCB0 = COM5 |~~~~~~~~~~~~|APP|
    +---------+ +-------+------+ +---+
    virtual pair
    ```

  20. Dmitry Romanov revised this gist May 10, 2020. 1 changed file with 22 additions and 2 deletions.
    24 changes: 22 additions & 2 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -96,13 +96,13 @@ It will listen TCP/IP port 7000 for incaming connections and redirect them to C

    ### Client

    To be a windows client you have to install com0com virtual comport driver.
    To be a windows client you have to install com0com virtual comport driver and hub4com.

    [Source forge download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)
    [Source forge hub4com download link](https://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)

    Create ***a PAIR*** of virtual comports where one is used for RFC2217 and the other is the port for your application will use.


    (*documentation citation*) for RFC 2217 client :


    @@ -128,6 +128,26 @@ com2tcp-rfc2217 \\.\CNCB0 192.168.123.30 7000
    > It will redirect virtual serial port COM5 on the second computer to the physical serial port on the first computer.

    ** Explanation **

    It is bit counter intuitive why a virtual pair is created.
    To explain what happens, imagine we create a virtual comport pair of COM5<->CNCB0 as in the example above.
    What happens: Only one thing can be connected to a COM port. If hub4com takes data from network and bind it
    to CNCB0, then this port is taken and your application can't connect to it. So virtual comport pair mirrors everything
    from CNCB0 to COM5, which is free and your application can connect to it.

    So the more detailed client diagram looks like this now:


    ```
    network +---------+ +-------+------+ +---+
    ....==========| hub4com |~| CNCB0 = COM5 |~~~~~~~~~~~~|APP|
    +---------+ +-------+------+ +---+
    virtual pair
    ```



    <br>

    ### Driver Signature
  21. Dmitry Romanov revised this gist May 9, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -203,7 +203,7 @@ Mmmm... Can you write it here, please?

    ## Connect over the internet

    All the above solutions basically describe how to forward data from com-port (serial port) to network port and then how to bind a network IP with port to a virtual com-port. It is streight forward for a local network but how to connect the devices over the internet? If you are an experiecned IT person, you may think of tons of solutions here, starting from fixed IPs an counting up to infinity.
    All the above solutions basically describe how to forward data from com-port (serial port) to network port and then how to bind a network IP with port to a virtual com-port. It is streight forward for a local network but how to connect the devices over the internet? If you are an experiecned IT person, you may think of tons of solutions here, starting from fixed IPs and counting up to infinity.

    For me one of the versatile easy to configure ways was to use [ZeroTier VPN](https://www.zerotier.com/) services. It is [free for up to 100 devices](https://www.zerotier.com/pricing/) and have a good interface for easy configuration, good manuals, etc. In the end you have a network interface on each of the machines which acts as a single local network (basically what VPN is).

  22. Dmitry Romanov revised this gist May 9, 2020. 1 changed file with 19 additions and 8 deletions.
    27 changes: 19 additions & 8 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@
    - [LINUX](#linux):
    * [Server](#linux-server)
    * [Client ?](#linux-client)

    - [Connect over the internet](#connect-over-the-internet)


    <br>
    @@ -57,7 +57,7 @@ More over you can multiplex the com ports and encrypt the data. Whatever you wan

    ## The solution in practice

    ### WINDOWS
    ## WINDOWS

    There is an absolutely brilliant free opensoure solution that can be used for comport forwarding, client and server for windows. It is called com0com.

    @@ -66,7 +66,7 @@ http://sourceforge.net/projects/com0com

    <br>

    ##### Server
    ### Server

    For the server you need only hub4com part of it.

    @@ -94,7 +94,7 @@ It will listen TCP/IP port 7000 for incaming connections and redirect them to C
    <br>
    <br>

    ##### Client
    ### Client

    To be a windows client you have to install com0com virtual comport driver.

    @@ -130,7 +130,7 @@ com2tcp-rfc2217 \\.\CNCB0 192.168.123.30 7000

    <br>

    #### Driver Signature
    ### Driver Signature

    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you...

    @@ -155,7 +155,7 @@ Restart the system
    <br>
    <br>

    ### LINUX:
    ## LINUX:

    The linux app I've got working pretty easy is ser2net

    @@ -171,7 +171,7 @@ sudo vim /etc/ser2net.conf #configure
    ser2net #run service
    ```

    #### Linux Server
    ### Linux Server


    The configuration line (for /etc/ser2net.conf) that corresponds to windows setup above
    @@ -194,10 +194,21 @@ That is it. Read ser2net docs for more

    <br>

    #### Linux Client
    ### Linux Client

    Mmmm... Can you write it here, please?


    <br>

    ## Connect over the internet

    All the above solutions basically describe how to forward data from com-port (serial port) to network port and then how to bind a network IP with port to a virtual com-port. It is streight forward for a local network but how to connect the devices over the internet? If you are an experiecned IT person, you may think of tons of solutions here, starting from fixed IPs an counting up to infinity.

    For me one of the versatile easy to configure ways was to use [ZeroTier VPN](https://www.zerotier.com/) services. It is [free for up to 100 devices](https://www.zerotier.com/pricing/) and have a good interface for easy configuration, good manuals, etc. In the end you have a network interface on each of the machines which acts as a single local network (basically what VPN is).

    > I'm NOT connected anyhow with Zerotier co. Just share the solution which was optimal for me. "As is".



  23. Dmitry Romanov revised this gist May 9, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -63,13 +63,14 @@ There is an absolutely brilliant free opensoure solution that can be used for co

    http://sourceforge.net/projects/com0com


    <br>

    ##### Server

    For the server you need only hub4com part of it.

    [Source forge hub4com download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)
    [Source forge hub4com download link](https://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)


    <br>
  24. Dmitry Romanov revised this gist May 9, 2020. 1 changed file with 9 additions and 11 deletions.
    20 changes: 9 additions & 11 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -2,17 +2,15 @@
    (Serial port or com port? - Serial ports are often refered as COM ports. It is the same to be short. You can read abut it in [the Wiki article](https://en.wikipedia.org/wiki/Serial_port) )


    - The problem
    - The solution in theory
    - The solution in practice
    - WINDOWS
    * Server
    * Client
    * Driver Signature (deprecated)

    - LINUX:
    * Server
    * Client ?
    - [The problem](#the-problem)
    - [The solution in theory](#the-solution-in-theory)
    - [WINDOWS](#windows)
    * [Server](#server)
    * [Client](#client)
    * [Driver Signature (deprecated)](#driver-signature)
    - [LINUX](#linux):
    * [Server](#linux-server)
    * [Client ?](#linux-client)



  25. Dmitry Romanov revised this gist May 9, 2020. 1 changed file with 11 additions and 17 deletions.
    28 changes: 11 additions & 17 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -2,23 +2,17 @@
    (Serial port or com port? - Serial ports are often refered as COM ports. It is the same to be short. You can read abut it in [the Wiki article](https://en.wikipedia.org/wiki/Serial_port) )


    ## The problem

    ## The solution in theory


    ## The solution in practice
    ### WINDOWS

    ##### Server
    ##### Client

    #### Driver Signature (deprecated)

    ### LINUX:

    #### Server
    #### Client ?
    - The problem
    - The solution in theory
    - The solution in practice
    - WINDOWS
    * Server
    * Client
    * Driver Signature (deprecated)

    - LINUX:
    * Server
    * Client ?



  26. Dmitry Romanov revised this gist May 9, 2020. 1 changed file with 33 additions and 10 deletions.
    43 changes: 33 additions & 10 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,26 @@
    (Serial port or com port? - Serial ports are often refered as COM ports. It is the same to be short. You can read abut it in [the Wiki article](https://en.wikipedia.org/wiki/Serial_port) )


    ## The problem

    ## The solution in theory


    ## The solution in practice
    ### WINDOWS

    ##### Server
    ##### Client

    #### Driver Signature (deprecated)

    ### LINUX:

    #### Server
    #### Client ?



    <br>

    ## The problem
    @@ -144,13 +164,23 @@ Restart the system

    ### LINUX:

    #### Server

    The linux app I've got working pretty easy is ser2net

    http://linux.die.net/man/8/ser2net

    It has configuration file located at /etc/ser2net.conf.

    **Ubuntu installation**

    ```bash
    sudo apt-get ser2net #install
    sudo vim /etc/ser2net.conf #configure
    ser2net #run service
    ```

    #### Linux Server


    The configuration line (for /etc/ser2net.conf) that corresponds to windows setup above

    ```
    @@ -167,18 +197,11 @@ Here:
    That is it. Read ser2net docs for more


    **Ubuntu installation**

    ```bash
    sudo apt-get ser2net #install
    sudo vim /etc/ser2net.conf #configure
    ser2net #run service
    ```


    <br>

    #### Client
    #### Linux Client

    Mmmm... Can you write it here, please?

  27. Dmitry Romanov revised this gist Oct 5, 2019. 1 changed file with 13 additions and 9 deletions.
    22 changes: 13 additions & 9 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -15,10 +15,10 @@ Suppose we have an application that works with some device using serial port (co
    +--------+ +--------------+
    ```

    Now what we want, is to have the device connected to one machine (server), and run the application on the remote machine (client) over the network. Real life example: a device is connected to ODROID - very small single-board PC that is connected to a local network, and read the data on a desktop.
    Now what we want, is to have the device connected to one machine (server), and run the application on the remote machine (client) over the network. Real life example: a device is connected to raspberry pi (very small single-board machine) that is connected to a local network, and read the data on a desktop.


    Since the application knows only how to communicate with the device by serial port (we suppose), the client machine has to have some virtual serial port that is used by the application:
    Since the application (APP on diagrams) knows only how to communicate with the device by serial port (we suppose), the client machine has to have some virtual serial port that is used by the application:

    ```
    +--------+ comport +--------+ network +--------+ virtual comport +---+
    @@ -47,22 +47,21 @@ More over you can multiplex the com ports and encrypt the data. Whatever you wan

    ### WINDOWS

    There are absolutely brilliant free opensoure solution that can be used for comport forwarding, client and server for windows. It is called com0com.
    There is an absolutely brilliant free opensoure solution that can be used for comport forwarding, client and server for windows. It is called com0com.

    http://sourceforge.net/projects/com0com

    There is a version with signed drivers available from GitHub here:
    https://github.com/Raggles/com0com/releases

    <br>

    ##### Server

    For the server you need only hub4com part of it.
    [Source forge hub4com download link](http://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)

    [Source forge hub4com download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)


    <br>

    *Configuration (I just cite the documentation)*:


    @@ -85,8 +84,10 @@ It will listen TCP/IP port 7000 for incaming connections and redirect them to C
    ##### Client

    To be a windows client you have to install com0com virtual comport driver.
    [Source forge download link](http://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-unsigned.zip/download)
    Create ***a PAIR*** of virtual comports where one is used for RFC2217 and the other is the port for your application to use.

    [Source forge download link](https://sourceforge.net/projects/com0com/files/com0com/3.0.0.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download)

    Create ***a PAIR*** of virtual comports where one is used for RFC2217 and the other is the port for your application will use.


    (*documentation citation*) for RFC 2217 client :
    @@ -117,6 +118,9 @@ com2tcp-rfc2217 \\.\CNCB0 192.168.123.30 7000
    <br>

    #### Driver Signature

    **Deprecated part** - com0com 3.0.0 comes with driver signarure. But if driver signature bugs you...

    According to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) and my own experience, on Windows 8x64 you probably will get problem with driver installation if you don't have the driver signature verification turned off.

    To enable driver test mode and sign a driver for windows, one may download
  28. Dmitry Romanov revised this gist Oct 5, 2019. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,9 @@


    <br>

    ## The problem

    Suppose we have an application that works with some device using serial port (com port). It could be GPS reader, IRDA, whatever. So it looks like this:


    @@ -29,6 +31,7 @@ So now the application just works with serial port on the client machine, and do


    <br>

    ## The solution in theory

    One of the solutions is using telnet with [RFC2217 - Telnet Com Port Control Option](https://tools.ietf.org/html/rfc2217). Is solves exactly the problem above. There are a lot of software that supports telnet+RFC2217 serial port forwarding. It allows you to run the server and the client on linux or windows machines (and MACs I suppose, but haven't tested it). Thus can, as example, run linux server and windows client, both using completely different packages, but because of RFC2217 they 'know' how to communicate.
    @@ -39,6 +42,7 @@ More over you can multiplex the com ports and encrypt the data. Whatever you wan


    <br>

    ## The solution in practice

    ### WINDOWS
    @@ -51,6 +55,7 @@ There is a version with signed drivers available from GitHub here:
    https://github.com/Raggles/com0com/releases

    <br>

    ##### Server

    For the server you need only hub4com part of it.
    @@ -76,6 +81,7 @@ It will listen TCP/IP port 7000 for incaming connections and redirect them to C

    <br>
    <br>

    ##### Client

    To be a windows client you have to install com0com virtual comport driver.
    @@ -109,6 +115,7 @@ com2tcp-rfc2217 \\.\CNCB0 192.168.123.30 7000

    <br>

    #### Driver Signature
    According to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) and my own experience, on Windows 8x64 you probably will get problem with driver installation if you don't have the driver signature verification turned off.

    @@ -130,6 +137,7 @@ Restart the system

    <br>
    <br>

    ### LINUX:

    #### Server
    @@ -144,6 +152,7 @@ The configuration line (for /etc/ser2net.conf) that corresponds to windows setup
    ```
    7000:telnet:0:/dev/ttyUSB0:1000000 8DATABITS NONE 1STOPBIT remctl
    ```

    Here:

    1. 7000 - port
    @@ -164,7 +173,9 @@ ser2net #run service


    <br>

    #### Client

    Mmmm... Can you write it here, please?


  29. Dmitry Romanov renamed this gist Jun 22, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.md → ComPort over Network.md
    Original file line number Diff line number Diff line change
    @@ -47,12 +47,14 @@ There are absolutely brilliant free opensoure solution that can be used for comp

    http://sourceforge.net/projects/com0com

    There is a version with signed drivers available from GitHub here:
    https://github.com/Raggles/com0com/releases

    <br>
    ##### Server

    For the server you need only hub4com part of it.
    [Source forge download link](http://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)
    [Source forge hub4com download link](http://sourceforge.net/projects/com0com/files/hub4com/2.1.0.0/hub4com-2.1.0.0-386.zip/download)


    <br>
  30. Dmitry Romanov revised this gist Jun 17, 2016. 1 changed file with 2 additions and 19 deletions.
    21 changes: 2 additions & 19 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -108,26 +108,9 @@ com2tcp-rfc2217 \\.\CNCB0 192.168.123.30 7000

    <br>
    #### Driver Signature
    According to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) and my own experience, on Windows 8x64 you probably will get problem with driver installation if you don't have the driver signature verification turned off. The error during installation of com0com looks then like this:
    According to [this bug report](http://sourceforge.net/p/com0com/discussion/440108/thread/13d56079/?limit=25) and my own experience, on Windows 8x64 you probably will get problem with driver installation if you don't have the driver signature verification turned off.


    > (SetupCopyOEMInf(C:\Program Files (x86)\com0com\com0com.inf) ERROR: 0xE000022F)

    There are two ways around it: A) bypass/disable driver signature verification, and/or B) sign the com0com driver (c) bugreport.


    As a lazy person I prefer to TEMPORARILY disable driver signature verification. There are several ways to do it, and as a lazy person I prefer just to [follow this article](http://thephuck.com/end-user-computing/how-to-disable-driver-signing-requirement-in-windows-8/):


    The idea is to reboot with -o option by running cmd from an elevated command prompt (Win + x is nice for this):

    ```cmd
    shutdown -r -o -f -t 0
    ```
    Then click "Troubleshoot", then reboot once again and choose to disable driver verification. Read the article above it has all pictures.

    To remove driver signature for windows download and run
    To enable driver test mode and sign a driver for windows, one may download
    [DSEO](http://www.ngohq.com/?page=dseo)

    Then run it