streampipes icon indicating copy to clipboard operation
streampipes copied to clipboard

Improve OPC UA Schema Detection to Support All Identifier Types

Open tenthe opened this issue 1 year ago • 6 comments

Issue:

The current implementation of OPC UA schema detection in our GitHub repository only supports numbers as Identifier Types. However, as discussed in issue #1567 and according to the OPC UA specification Link, the schema detection should be enhanced to support all Identifier Types defined by OPC UA.

Open question:

We need to clarify whether the identification of Identifier Types can be inferred automatically or if users need to provide this information manually.

Proposed Solution:

To optimize the current implementation, the following steps are suggested:

  1. Review the OPC UA specification Link thoroughly to understand the complete list of Identifier Types defined.
  2. Update the schema detection logic to support all the identified Identifier Types.
  3. Consider implementing an automatic inference mechanism that detects the Identifier Type based on the data provided by the OPC UA server. This can include analyzing metadata, examining naming conventions, or utilizing specific OPC UA server features.
  4. If automatic inference is not feasible or reliable, provide clear instructions to users on how to manually provide the Identifier Types information for their OPC UA server. This can be in the form of user input during the connection process.

By implementing these changes, we can enhance the OPC UA schema detection capabilities, making it more versatile and accommodating for a wider range of OPC UA servers and Identifier Types.

Discussed in https://github.com/apache/streampipes/discussions/1567

Originally posted by curichan May 11, 2023 Hi there, after Streampipes has connected to an OPC UA server and a node has been selected, I get the error "Could not guess schema for opc node: class java.lang.String cannot be cast to class org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger (java.lang.String is in module java.base of loader 'bootstrap'; org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger is in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader" when progressing to the "Configure fields" dialogue. It's not clear to me why Streampipes is trying to cast a string to an integer at this stage. Can someone help or is this a bug?

tenthe avatar May 22 '23 12:05 tenthe

Automatic detection of identifier type should be easy to accomplish since each node comes with the field "IdentifierType" as part of its metadata in OPC UA.

curichan avatar May 22 '23 13:05 curichan

thanks a lot for the great issue description @tenthe Do we even want to make it a good-first-issue?

bossenti avatar May 22 '23 18:05 bossenti

I am not sure if this is a good candidate for a good-first-issue, as the OPC UA Adapter will need further refactoring once the new API is merged. Also, we want to add more functionality to the OPC UA Adapter, I think it makes sense to do that in the same move.

tenthe avatar May 22 '23 18:05 tenthe

Hi all, sorry to be a pain! But can you provide a very rough estimate when this issue might be available in a new release? I'm currently building up a new explorative analysis infrastructure, but this contains OPC UA servers providing many non-integer nodes. I'd love to use Streampipes for this, but may need to come up with a different solution, if Streampipes can't handle non-integer nodes. Sorry again for being pushy!

Actually, I did some more testing. I think I might have put you on the wrong track! I find that Streampipes is able to read nodes of types Int, Float, String and Boolean. It fails, however, when reading a node with a custom data type defined in the server itself. The custom type in my example is defined, see attached screenshot, as a variant of the String type in a subfolder of 'Types/DataTypes/OPC Binary/'. Could it be that Streampipes does not read and integrate custom types from the 'Types' folder and therefore fails when it encounters a node with this custom data type? image

curichan avatar May 24 '23 13:05 curichan

Hey @curichan,

please take for granted that you don't bother us. We highly appreciate all the feedback and insights you share with us, we are gaining a lot of value from them. So please keep that spirit and help us to improve StreamPipes 🙂 It would be really great if you could StreamPipes for your use case, and it's very nice to see that you seem to like StreamPipes despite some issues you encountered.

From our side, improving the OPC-UA adapter is the next topic we want to address, as we have already received some feedback where we should improve (your feedback counts massively here). Currently, there is a huge big PR (https://github.com/apache/streampipes/pull/1290) that we need to complete first. But after that, OPC-UA will be definitely a focus topic.

As for the time until a possible release, it's quite hard to put a number on as we can't really plan how many time we can invest in StreamPipes besides our everyday life. I can understand that this is probably not helpful for you... But if you could share a rough time window by when you would need the changes in a release, then we could at least roughly estimate whether this is realistic for us or not. Would that be sufficient for you?

bossenti avatar May 25 '23 11:05 bossenti

Hi @bossenti , many thanks for your kind words and explanations. I found a workaround for my specific problem for now. However, allowing for custom data types would certainly be a major improvement to the OPC UA adapter. Given this backrground, a solution by the end of June would be great!

curichan avatar May 25 '23 12:05 curichan