I am working with the Node-RED OPCUA library and h...
# umh-support
a
I am working with the Node-RED OPCUA library and having a hard time getting the client to connect. I am researching the Node-RED forums to see what I can find
d
we split this to a tread instead..
a
Thanks
d
do you get a connection to the opc in node-red ?
a
No, I get a client node error
Copy code
[31mClient node error on:  error: ["Cannot create client, check connection options: [{\"securityPolicy\":\"1\",\"securityMode\":3,\"clientCertificateManager\":\"2\",\"certificateFile\":\"3\",\"privateKeyFile\":\"4\",\"requestedSessionTimeout\":300000,\"clientName\":\"4\",\"endpointMustExist\":false,\"defaultSecureTokenLifetime\":200000,\"connectionStrategy\":\"5\",\"keepSessionAlive\":true},\"http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256\",{\"untrustUnknownCertificate\":true,\"state\":2,\"folderPoolingInterval\":5000,\"_watchers\":\"6\",\"_readCertificatesCalled\":true,\"_filenameToHash\":\"7\",\"_thumbs\":\"8\",\"_pending_crl_to_process\":0,\"queue\":\"9\",\"location\":\"10\",\"keySize\":2048,\"referenceCounter\":0,\"automaticallyAcceptUnknownCertificate\":true},\"NodeOPCUA-Client@d7e82f8da5cc[f6b532fe2815756f979be4222725f7f2c0db7bdf].pem\",\"\",{\"maxRetry\":10512000,\"initialDelay\":5000,\"maxDelay\":30000},[\"11\",\"12\",\"13\",\"14\",\"15\"],{\"/usr/src/node-red/.conf...
d
what kind of security do you use?
a
With UA Expert the certificate showed up in the Quarantine section of Codesys Security and I moved it to trusted. I was thinking the same should happen with Node-RED. I am using Basic256Sha256
I just copied the folder path that was in that error into the Client Node and have different errors now:
d
try remove the folder path and see if you get errors
a
I get that same message:
d
oh, but the endpoint is pointing to localhost, is that where you run the opc-ua server ?
a
This could be an issue but I have codesys Linux running on Linux server and node-red in a docker container on the same Linux server
d
yes, but localhost will point to the pod and not the host
a
okay, I see. I will need to configure the Docker Container to have access to the host or create a new VM for docker?
d
it should work if you point the node-red-opcua to the ip-adress for your opc-ua server
a
Okay, I will do some more testing. Heading out with the family for the day and will test in the afternoon. Thanks for your help @DanielH
d
sure. no problem..
a
The other method I was testing out was using the MQTT functions in Codesys. That has been working somewhat well for me. Just figuring out the best way to subscribe to multiple topics. Trying two paths hopping to get some good results with one of them.
d
Both methods should work. Using OPC-UA is a bit more industry standard for pushing data in to PLCs..
a
Sounds good. I’ll keep working on the Node-RED method. I’ll let you know how my further testing goes
d
👍
a
It's working
I set the IP Address in the endpoint and pasted the PKI folder path then checked my Codesys Security and saw the NodeOPCUA certificate in the quarantine folder. I guess rebooting it and changing the IP address worked.
d
ah.. nice.. so the ip you have now is it the host-ip or is it a pod-ip ?
j
looping in @alexkrueger and @krgrsebastian as we had that node-red error previously, but were not able to fix it. our solution was to use then our benthos-umh docker container.
what did you do exactly to fix the problem?
just changed the IP address and rebooted?
a
I also added the PKI Certificate folder path that was displayed in the error. See highlighted field in image above.
Below is an image with folder path highlighted in the error message:
Host IP
j
intersting, we'll try it out the next time we encounter it. thank you!
a
Were you trying to connect to a Codesys PLC as well? Or Siemens?
j
@alexkrueger do you know which PLC you used?
d
We have a siemens connected with no problems... i have a codesys at home i could try to replicate the error with.
a
Sounds good. Let me know how that goes
4 Views