Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Integration of EasyOpc to AWS lambda

More
19 Dec 2020 10:58 #9298 by support
QuickOPC Standard does not have .NET Core support, therefore you need QuickOPC Professional at least.

On the other hand, it is unlikely that you need Enterprise or Ultimate, unless you have a need for advanced features such as OPC UA Global Discovery, or OPC UA COmplex data (custom structures).

Best regards
The following user(s) said Thank You: tangelo

Please Log in or Create an account to join the conversation.

More
18 Dec 2020 14:06 #9296 by tangelo
Could you please help me to understand what Product Edition from the link will be enough to perform operation described in this topic?
www.opclabs.com/files/onlinedocs/QuickOpc/Latest/User%27s%20...e.html#Product%20Editions.html

Please Log in or Create an account to join the conversation.

More
13 Nov 2020 17:48 #9145 by support
I am glad it works!
If you will have any interesting experiences or recommendations from using QuickOPC with AWS Lambda, I would be grateful if you share them with us.

Best regards

Please Log in or Create an account to join the conversation.

More
13 Nov 2020 15:20 #9144 by tangelo
Thank you very much for your help! It works!
Very appreciated.

Best regards
The following user(s) said Thank You: support

Please Log in or Create an account to join the conversation.

More
13 Nov 2020 09:00 - 13 Nov 2020 17:37 #9141 by support
Hello,
the UA Configuration Tool isn't of much use for this.

You need the following directory structure at least:
OPC Foundation
    CertificateStores
        MachineDefault
            certs
                <name and thumbprint>.der
            private
                <name and thumbprint>.pfx
        UA Applications
            certs
                <name and thumbprint>.der

(the two .der files are identical)
Currently I leave it as open question, what happens if the client rejects the server's certificate, because in such case it will attempt to store a copy of the rejected certificate into the RejectedCertificate, which would need to be writeable. Hopefully such problems will be ignored, but let's see.

I was now about to start explaining how you actually create the .der and .pfx using the UA Certificate Generator tool, but I think I have a better trick for you, which would not only generate the certificates, but also give you the right directory structure and be less prone to issues with improper certificate names (for lookup).

Here it is:

1. Using .NET Core (not .NET Framework), create a console application similar to opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...he%20client%20certificate.html , and in it, set the ApplicationName as you need.
2. Run the application. This will generate the certificate and create the above described directory structure, next to your your application's main assembly in the output folder.
3. Modify your AWS lambda to contain the same application name as used in Step 1 (include the statement "EasyUAClient.SharedParameters.EngineParameters.ApplicationParameters.ApplicationName = ..." at the beginning of your code).
4. Deploy the directories and files from Step 2 with your AWS lambda.

I hope this helps
Best regards
Last edit: 13 Nov 2020 17:37 by support.
The following user(s) said Thank You: tangelo

Please Log in or Create an account to join the conversation.

More
12 Nov 2020 14:53 #9138 by tangelo
Thank you for reply!
You absolutely right. I can publish the lambda to AWS together with all required certificates, I'm sure that they will be readable. Could you please help me to understand how to create these certificates in correct way, how to fill those fields etc?

Best regards
Attachments:

Please Log in or Create an account to join the conversation.

More
11 Nov 2020 16:33 #9130 by support
Hello,
thanks for the details.

Well, it is a bold attempt to try to run this under AWS Lambda. I hope we will get it working!

From the call stack, the problem is not related to the licensing registration (as I expected). If you want to verify that, simply remove the license registration statement and see if there is any difference in behavior.

Most likely cause for the problem is related to the creation of OPC UA (client) application certificate. Some more info:
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...ry%20Certificate%20Stores.html
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...%20Instance%20Certificate.html

QuickOPC attempts to create the OPC UA client application certificate on the first run of application (more precisely, when it does not find the existing certificate). In the case of .NET Standard target, the "certificate stores" will be directories next to the main application assembly. And, I suppose that under AWS, none of that will be writeable, is that correct?

If so, are they at least readable? That is, are you able to deploy, together with your assembly, also a "file system" with directories and files of your choice? If so, I can then instruct you on how to create such structure and what to put there (a manually pre-created certificate), so that QuickOPC wouldn't have to try to create a new certificate file in there. This might be a somewhat tedious/complicated/lengthy process, but it is worth going through it and possibly document what was/needs to be done.

Kind regards

Please Log in or Create an account to join the conversation.

More
11 Nov 2020 15:21 #9128 by tangelo
Hi,
Thank you for help!
When AWS lambda tries to execute following part:
var endpointDescriptor = ((UAEndpointDescriptor)<ServerUrl>)
                    .WithUserNameIdentity(<UserName>, <Password>);
var client = new EasyUAClient();
var node = client.Read(endpointDescriptor, new UANodeElement(new UANodeId(<nodeId>)));
it crashes with error message "Read-only file system"
and stack trace:
SdkApplicationInstance(ApplicationInstance& sdkApplicationInstance)
   at OpcLabs.EasyOpc.UA.Toolkit.ClientServer.UAClientEngineBase.MakeSdkApplicationInstance(ApplicationInstance& sdkApplicationInstance)
   at OpcLabs.EasyOpc.UA.Toolkit.ClientServer.UAClientEngineBase.MakeEngineRecord(Object& engineRecord)
   at OpcLabs.EasyOpc.UA.Toolkit.UAEngineBase.InternalConnect()
   at OpcLabs.EasyOpc.UA.Toolkit.UAEngineBase.Connect()
   at OpcLabs.EasyOpc.UA.Implementation.NetSdk.ClientServer.EasyUAClientEngine.ReadAttributes(UAReadArguments[] readArgumentsArray, EasyUAAdaptableParameters adaptableParameters)
   at OpcLabs.EasyOpc.UA.Implementation.NetSdk.ClientServer.NetSdkEasyUAClient.<>c__DisplayClass34_0.<ReadMultiple>b__0()
   at OpcLabs.BaseLib.DisposableObject.DisposeGuard[TResult](Func`1 func)
   at OpcLabs.BaseLib.DisposableObject.DisposeGuardNotNull[TResult](Func`1 func)
   at OpcLabs.EasyOpc.UA.Implementation.NetSdk.ClientServer.NetSdkEasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.Implementation.DataConvertingEasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.Implementation.ForwardingEasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.Implementation.LicensingEasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.Implementation.MultiplexingEasyUAClient.<>c.<ReadMultiple>b__10_0(IEasyUAClient client, IReadOnlyList`1 list)
   at OpcLabs.BaseLib.Collections.Generic.Extensions.IReadOnlyListExtension.SwitchCase[TInput,TOutput,TKey](IReadOnlyList`1 readOnlyList, Func`2 keySelector, IEqualityComparer`1 keyComparer, Func`3 outputSelector)
   at OpcLabs.EasyOpc.UA.Implementation.MultiplexingEasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.Implementation.ForwardingEasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.Implementation.ExceptionProcessingEasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.Implementation.ForwardingEasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.EasyUAClient.ReadMultiple(UAReadArguments[] readArgumentsArray)
   at OpcLabs.EasyOpc.UA.IEasyUAClientExtension.Read(IEasyUAClient client, UAReadArguments readArguments)
   at OpcLabs.EasyOpc.UA.IEasyUAClientExtension.Read(IEasyUAClient client, UAEndpointDescriptor endpointDescriptor, UANodeDescriptor nodeDescriptor)
Do you have any ideas why it happens?

Thanks,
Best regards

Please Log in or Create an account to join the conversation.

More
11 Nov 2020 12:07 #9126 by support
[Hello,

I have redacted the code statement provided (instead of removing) - it now does not contain anything more than it is in our own examples and documentation - I hope this satisfies your request.

Kind regards]
The following user(s) said Thank You: tangelo

Please Log in or Create an account to join the conversation.

More
11 Nov 2020 09:29 #9125 by support
Hello,

the code you provided should not be attempting to modify the assembly. if it attempts to something like that, it would be something we need to look at.
Can you provide a details of the error you are getting (a call stack)?

And, independent of that, I am quite excited about the fact that somebody wants to use our product in AWS lambda. Would you be willing to provide steps for a complete beginner (like me) to get started there?

Best regards

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.062 seconds