node red – ECONNRESET when PLC connection drops

I have a problem with Node-RED:
continuously communicates with PLCs Siemens S7-1200 using node-red-contrib-s7, running on a machine with Windows Server 2012 r2, sometimes i get the following error:

16 Mar 10:33:01 - Error: read ECONNRESET
at TCP.onStreamRead (node: internal / stream_base_commons: 211: 20)

I noticed that the problem occurs when the connection with a PLC is missing for more than a few minutes.

Last part of the logs:

7 Apr 11:30:39 - [error] [s7 endpoint:PLC - Pozzi Vasca Vecchia] Error: Timeout connecting to the transport
7 Apr 11:30:40 - [error] [s7 endpoint:PLC - Pozzi Vasca Nuova] Error: Timeout connecting to the transport
7 Apr 11:30:54 - [error] [s7 endpoint:PLC - Pozzi Vasca Vecchia] Error: Timeout connecting to the transport
7 Apr 11:30:55 - [error] [s7 endpoint:PLC - Pozzi Vasca Nuova] Error: Timeout connecting to the transport
7 Apr 11:31:10 - [error] [s7 endpoint:PLC - Pozzi Vasca Nuova] Error: Timeout connecting to the transport
7 Apr 11:31:13 - [red] Uncaught Exception:
7 Apr 11:31:13 - Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:209:20)

Read more here: Source link