OPC-UA stop node-red process

Hello!
I'm having this problem.
I've created a flow with OPC-UA READ node.
After deploying it start with these warning in the console:

client_session_keepalive_manag:114 warning : ClientSessionKeepAliveManager#ping_server Connection Break

after restarting it says:
client_session_keepalive_manag:114 warning : ClientSessionKeepAliveManager#ping_server Session has been closed and should not be used to perform a transaction anymore

If I insert some UPC-UA READ/WRITE node more and try to use them with HTTP endpoint, it happen that node red stop process with this error:

15:34:06.636Z :client_base_impl              :349   the server certificate has changed,  we need to retrieve server certificate again:  ClientSecureChannelLayer => Socket is closed !
20 Jul 08:34:06 - [red] Uncaught Exception:
20 Jul 08:34:06 - TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at Hash.update (internal/crypto/hash.js:84:11)
    at Object.makeSHA1Thumbprint (C:\Users\m.torricelli\.node-red\node_modules\node-opcua-crypto\dist\source\crypto_utils.js:139:38)
    at C:\Users\m.torricelli\.node-red\node_modules\node-opcua-client\dist\private\client_base_impl.js:350:83
    at C:\Users\m.torricelli\.node-red\node_modules\node-opcua-client\dist\private\client_base_impl.js:454:17
    at C:\Users\m.torricelli\.node-red\node_modules\async\dist\async.js:2955:19
    at wrapper (C:\Users\m.torricelli\.node-red\node_modules\async\dist\async.js:268:20)
    at iterateeCallback (C:\Users\m.torricelli\.node-red\node_modules\async\dist\async.js:413:21)
    at C:\Users\m.torricelli\.node-red\node_modules\async\dist\async.js:321:20
    at C:\Users\m.torricelli\.node-red\node_modules\async\dist\async.js:2953:17
    at C:\Users\m.torricelli\.node-red\node_modules\node-opcua-client\dist\private\client_base_impl.js:426:21

I can't understand if the problem is

  • my flow
  • configuration of OPC-UA node
  • OPC-UA server

Could someone help me?

This is the complete flow that give node-red error and kill process:

[{"id":"6e48ec59.743384","type":"tab","label":"UP - GET DATA","disabled":false,"info":""},{"id":"5cc7c35e.eee5ac","type":"http in","z":"6e48ec59.743384","name":"","url":"/getData","method":"get","upload":false,"swaggerDoc":"","x":1070,"y":320,"wires":[["ac12b33d.8ef82","6538852c.75e18c","a6af05c8.81edb8","14b03392.27c27c","ce594af8.bdf208","cfe9aa2a.319258","48ac4092.f0951","45397d85.b46f94","82b9131e.d5989","25fb8dc5.d105e2","9eaf5e23.78a75","a8d1d6f0.6a2e38","a0276efd.58d22","69aa2441.1e642c","32a7d304.84a55c"]]},{"id":"ac12b33d.8ef82","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_i_MachineState","datatype":"Int16","value":"","name":"OPCOut_i_MachineState","x":1470,"y":320,"wires":[["834ca80d.a2a6c8"]]},{"id":"6538852c.75e18c","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_str_ActualRecipeName","datatype":"Int16","value":"","name":"OPCOut_str_ActualRecipeName","x":1500,"y":360,"wires":[["c9f77f56.cb5ce"]]},{"id":"b7326cfc.794a5","type":"function","z":"6e48ec59.743384","name":"","func":"switch(msg.payload) {\n  case 1:\n    msg.payload = 'Ferma ma pronta alla marcia';\n    break;\n  case 2:\n    msg.payload = 'In marcia automatica';\n    break;\n  case 3:\n    msg.payload = 'Ferma per marcia impedita (allarme attivo)';\n    break;\n  case 4:\n    msg.payload = 'In marcia per manutenziona';\n    break;\n  case 6:\n    msg.payload = 'Rifasamento in corso';\n    break;\n  case 7:\n    msg.payload = 'In marcia, ferma in standby';\n    break;\n  case 11:\n    msg.payload = 'Manutenzione in sicurezza pronta alla marcia';\n    break;\n  case 12:\n    msg.payload = 'Manutenzione in sicurezza in marcia';\n    break;\n  default:\n    msg.payload = '?';\n}\n\nmsg.topic = msg.browseName\n\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1920,"y":320,"wires":[["c6639290.650d8"]]},{"id":"394401d7.63be4e","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":360,"wires":[["c6639290.650d8"]]},{"id":"c6639290.650d8","type":"join","z":"6e48ec59.743384","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":2230,"y":260,"wires":[["e328d076.b33b3","6c024e8c.57186"]]},{"id":"a2206a83.da0db8","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":400,"wires":[["c6639290.650d8"]]},{"id":"4a9e85c1.1da20c","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":440,"wires":[["c6639290.650d8"]]},{"id":"41a6ff52.ef21b","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":480,"wires":[["c6639290.650d8"]]},{"id":"ba56e363.22e21","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":520,"wires":[["c6639290.650d8"]]},{"id":"e7e03c38.38db7","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":560,"wires":[["c6639290.650d8"]]},{"id":"9cfd9982.f9d2d8","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":600,"wires":[["c6639290.650d8"]]},{"id":"70771a17.648ce4","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":640,"wires":[["c6639290.650d8"]]},{"id":"10568ffa.a89dd","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":760,"wires":[["c6639290.650d8"]]},{"id":"fbcb2e0.2a718d","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":800,"wires":[["c6639290.650d8"]]},{"id":"dcb67d86.dbe82","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":840,"wires":[["c6639290.650d8"]]},{"id":"383a0bd7.292064","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"browseName","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":880,"wires":[["c6639290.650d8"]]},{"id":"a6af05c8.81edb8","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_b_ImmediateStop","datatype":"Int16","value":"","name":"OPCOut_b_ImmediateStop","x":1480,"y":400,"wires":[["f3d79b56.e51158"]]},{"id":"14b03392.27c27c","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_b_PhaseStop","datatype":"Int16","value":"","name":"OPCOut_b_PhaseStop","x":1470,"y":440,"wires":[["a6ff9f3a.17cc8"]]},{"id":"ce594af8.bdf208","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_b_WarningActive","datatype":"Int16","value":"","name":"OPCOut_b_WarningActive","x":1480,"y":480,"wires":[["a1fefbea.0bab78"]]},{"id":"cfe9aa2a.319258","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_di_DosedSachetsCounter","datatype":"Int16","value":"","name":"OPCOut_di_DosedSachetsCounter","x":1500,"y":520,"wires":[["8914151c.a1d0a8"]]},{"id":"48ac4092.f0951","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_di_ProducedSachetsCounter","datatype":"Int16","value":"","name":"OPCOut_di_ProducedSachetsCounter","x":1510,"y":560,"wires":[["d05ff7f1.99baa8"]]},{"id":"45397d85.b46f94","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_di_VoidSachetsCounter","datatype":"Int16","value":"","name":"OPCOut_di_VoidSachetsCounter","x":1500,"y":600,"wires":[["b57a66e1.b94c68"]]},{"id":"82b9131e.d5989","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_di_GoodQualitySachets","datatype":"Int16","value":"","name":"OPCOut_di_GoodQualitySachets","x":1500,"y":640,"wires":[["23819f07.aef0a"]]},{"id":"25fb8dc5.d105e2","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_di_ReadyToRunHours","datatype":"Int16","value":"","name":"OPCOut_di_ReadyToRunHours","x":1490,"y":760,"wires":[["59ceff9f.10cb1"]]},{"id":"9eaf5e23.78a75","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_di_AutoProdRunningHours","datatype":"Int16","value":"","name":"OPCOut_di_AutoProdRunningHours","x":1510,"y":800,"wires":[["6e5d1c28.b625e4"]]},{"id":"a8d1d6f0.6a2e38","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_di_SetupRunningHours","datatype":"Int16","value":"","name":"OPCOut_di_SetupRunningHours","x":1500,"y":840,"wires":[["5798e66.cf72718"]]},{"id":"a0276efd.58d22","type":"OpcUa-Item","z":"6e48ec59.743384","item":"ns=2;s=Application.GlobalVariables_OPC_INOUT.OPCOut_di_AlarmStateHours","datatype":"Int16","value":"","name":"OPCOut_di_AlarmStateHours","x":1490,"y":880,"wires":[["4f582a36.05c834","7de3162e.1180c8"]]},{"id":"4f582a36.05c834","type":"function","z":"6e48ec59.743384","name":"","func":"msg.topic = msg.topic.split('.');\n\n//console.log(msg.topic);\n\n\nswitch(msg.payload) {\n  case 1:\n    msg.payload = 'Ferma ma pronta alla marcia';\n    break;\n  case 2:\n    msg.payload = 'In marcia automatica';\n    break;\n  case 3:\n    msg.payload = 'Ferma per marcia impedita (allarme attivo)';\n    break;\n  case 4:\n    msg.payload = 'In marcia per manutenziona';\n    break;\n  case 6:\n    msg.payload = 'Rifasamento in corso';\n    break;\n  case 7:\n    msg.payload = 'In marcia, ferma in standby';\n    break;\n  case 11:\n    msg.payload = 'Manutenzione in sicurezza pronta alla marcia';\n    break;\n  case 12:\n    msg.payload = 'Manutenzione in sicurezza in marcia';\n    break;\n  default:\n    msg.payload = '?';\n}\n\nmsg.topic = 'stato_macchina'\n\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1920,"y":1060,"wires":[["2c4a0550.84112a"]]},{"id":"f927621f.7fb9","type":"inject","z":"6e48ec59.743384","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1130,"y":920,"wires":[["a0276efd.58d22"]]},{"id":"2c4a0550.84112a","type":"debug","z":"6e48ec59.743384","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2220,"y":920,"wires":[]},{"id":"834ca80d.a2a6c8","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":320,"wires":[["b7326cfc.794a5"]]},{"id":"c9f77f56.cb5ce","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":360,"wires":[["394401d7.63be4e"]]},{"id":"f3d79b56.e51158","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":400,"wires":[["a2206a83.da0db8"]]},{"id":"a6ff9f3a.17cc8","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":440,"wires":[["4a9e85c1.1da20c"]]},{"id":"a1fefbea.0bab78","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":480,"wires":[["41a6ff52.ef21b"]]},{"id":"8914151c.a1d0a8","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":520,"wires":[["ba56e363.22e21"]]},{"id":"d05ff7f1.99baa8","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":560,"wires":[["e7e03c38.38db7"]]},{"id":"b57a66e1.b94c68","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":600,"wires":[["9cfd9982.f9d2d8"]]},{"id":"23819f07.aef0a","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":640,"wires":[["70771a17.648ce4"]]},{"id":"59ceff9f.10cb1","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":760,"wires":[["10568ffa.a89dd"]]},{"id":"6e5d1c28.b625e4","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":800,"wires":[["fbcb2e0.2a718d"]]},{"id":"5798e66.cf72718","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":840,"wires":[["dcb67d86.dbe82"]]},{"id":"7de3162e.1180c8","type":"OpcUa-Client","z":"6e48ec59.743384","endpoint":"9c9a6f0c.e68f7","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","localkeyfile":"","securitymode":"None","securitypolicy":"None","name":"","x":1760,"y":880,"wires":[["383a0bd7.292064"]]},{"id":"e2a3c85f.1a19f8","type":"change","z":"6e48ec59.743384","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2390,"y":100,"wires":[["ab4dcfed.2229c"]]},{"id":"ab4dcfed.2229c","type":"http response","z":"6e48ec59.743384","name":"","statusCode":"","headers":{},"x":2550,"y":100,"wires":[]},{"id":"69aa2441.1e642c","type":"delay","z":"6e48ec59.743384","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1670,"y":100,"wires":[["d4c3761b.7eab28"]]},{"id":"d4c3761b.7eab28","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"data","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":2050,"y":120,"wires":[["e2a3c85f.1a19f8"]]},{"id":"e328d076.b33b3","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"data","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2370,"y":260,"wires":[[]]},{"id":"32a7d304.84a55c","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":280,"wires":[["6e04af94.c96a"]]},{"id":"6e04af94.c96a","type":"change","z":"6e48ec59.743384","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"data_request","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1930,"y":280,"wires":[["c6639290.650d8"]]},{"id":"6c024e8c.57186","type":"debug","z":"6e48ec59.743384","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2470,"y":180,"wires":[]},{"id":"9c9a6f0c.e68f7","type":"OpcUa-Endpoint","endpoint":"opc.tcp:\\\\169.254.1.200:4840","secpol":"None","secmode":"None","login":false}]```

Actually your endpoint is written with backslashes, change them to normal opc.tcp:// and try again.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.