Hi, till now my flow has worked as expected without problem. Now, it's a couple of weeks I'm encountering this problem and I've not been able to solve it.
For what I've understood the problem is related to node-red-sontrib-s7 I use to reach a PLC via LAN node-red-contrib-s7 (node) - Node-RED
Until now even if the PLC was offline for a while, nothing happened, i just stopped receiving data till the PLC was back online again.
Now for some reason I'm starting have this problem: after a couple of minutes that node-red started, if the PLC is off line then node-red stops working with this log:
30 Jun 10:20:08 - [trace] [flow:84796f65f4434a57] 53806954b9c1899e | change |
30 Jun 10:20:08 - [trace] [flow:84796f65f4434a57] ------------------|--------------|-----------------
30 Jun 10:20:08 - [trace] runtime event: {"id":"runtime-state","payload":{"state":"start","deploy":true},"retain":true}
30 Jun 10:20:08 - [info] Started modified nodes
30 Jun 10:20:08 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"93d550ceef5199182f4b78793fade258"},"retain":true}
30 Jun 10:20:48 - [error] [s7 endpoint:SCADA] Error: Request timeout
30 Jun 10:21:03 - [error] [s7 endpoint:SCADA] Error: Timeout connecting to the transport
30 Jun 10:21:18 - [error] [s7 endpoint:SCADA] Error: Timeout connecting to the transport
30 Jun 10:21:33 - [error] [s7 endpoint:SCADA] Error: Timeout connecting to the transport
30 Jun 10:21:41 - [error] [s7 endpoint:SCADA] Error: Request timeout
30 Jun 10:21:56 - [error] [s7 endpoint:SCADA] Error: Timeout connecting to the transport
30 Jun 10:22:11 - [error] [s7 endpoint:SCADA] Error: Timeout connecting to the transport
30 Jun 10:22:29 - [red] Uncaught Exception:
30 Jun 10:22:29 - [error] Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
nodered.service: Main process exited, code=exited, status=1/FAILURE
Now I would like to catch this error and properly handle it. I've tried several approch without success.This is what I got on the debug sidebar
I have even tried to just ignore this error by simply putting this code within the function node following the catch node. But nothing, node-red get continuosly stopped.
if (msg.error.message.includes('ECONNRESET')) return [null];
Thanks to all