Skip to content

Conversation

@danielpeintner
Copy link
Member

@danielpeintner danielpeintner commented Apr 10, 2025

I started to look into. Unfortunately, OPC UA protocol is blocked on my machine at the moment and I need to fix that issue first. I just coded what I think should work...

TODO: Update readme, see https://github.com/eclipse-thingweb/node-wot/tree/master/packages/binding-opcua#form-extensions b912d32

fixes #1367

@danielpeintner danielpeintner requested a review from relu91 as a code owner April 10, 2025 08:55
@danielpeintner danielpeintner added the binding-opcua Issues related to opc ua protocol binding label Apr 10, 2025
@danielpeintner danielpeintner marked this pull request as draft April 10, 2025 08:55

export interface FormPartialNodeDescription {
"opcua:nodeId": NodeIdLike | NodeByBrowsePath;
"opcua:nodeId"?: NodeIdLike | NodeByBrowsePath;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General question/comment:
Why do we have interface FormPartialNodeDescription and OPCUAFormInvoke.
It is somewhat similar without extending (OPCUA)Form.

Moreover, OPCUAForm extends FormPartialNodeDescription again !?
Some dependencies I don't understand, and I wonder whether we can simplify it.

@erossignon

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified it, and we do not see any problems when testing via unit tests nor when testing with real devices


export interface OPCUAFormInvoke extends OPCUAForm {
"opcua:method": NodeIdLike | NodeByBrowsePath;
"opcua:method"?: NodeIdLike | NodeByBrowsePath;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this line addition is needed. OPCUAForm has already the same?
OPCUAForm extends FormPartialNodeDescription which contains it...

@relu91
Copy link
Member

relu91 commented Apr 22, 2025

Are there any blockers here?

@danielpeintner
Copy link
Member Author

Are there any blockers here?

Not really from my side. Unfortunately, I cannot really test the changes myself since on my windows box OPCUA is blocked. Need to find another machine.

@egekorkan you mentioned you can (want) to test it. Would be great if you can provide feedback!

@danielpeintner danielpeintner marked this pull request as ready for review April 22, 2025 10:14
@relu91
Copy link
Member

relu91 commented Apr 22, 2025

Can't we add some additional tests alongside the existing ones (eg. remove the old opcua:method and use the url instead) to test this properly?

@codecov
Copy link

codecov bot commented Apr 22, 2025

Codecov Report

Attention: Patch coverage is 85.29412% with 5 lines in your changes missing coverage. Please review.

Project coverage is 78.14%. Comparing base (53a9c66) to head (bec5765).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
...ackages/binding-opcua/src/opcua-protocol-client.ts 85.29% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1368      +/-   ##
==========================================
+ Coverage   77.63%   78.14%   +0.51%     
==========================================
  Files          83       79       -4     
  Lines       16603    15270    -1333     
  Branches     1611     1445     -166     
==========================================
- Hits        12890    11933     -957     
+ Misses       3682     3320     -362     
+ Partials       31       17      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danielpeintner
Copy link
Member Author

an't we add some additional tests alongside the existing ones (eg. remove the old opcua:method and use the url instead) to test this properly?

I added some counter tests next to the existing ones ... some tests require special syntax w.r.t. to the server which the href approach doesn't offer

@danielpeintner
Copy link
Member Author

Note: the ECA check seems to be broken

@egekorkan
Copy link
Member

@egekorkan you mentioned you can (want) to test it. Would be great if you can provide feedback!

I can try with some real OPC UA device on Thursday morning :)

@egekorkan
Copy link
Member

@egekorkan
Copy link
Member

Happy to confirm that the PR works with real devices. I have tried a TD with base and without base and both worked, meaning the URL arithmetic from the core package cause no issue. Of course, and as expected, one cannot split the query parameter and put a part of it into the base as we are not doing simple string concat.

Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can improve the doc a little bit, other than that it's good to go.

@danielpeintner
Copy link
Member Author

I will update the readme before integrating the PR.

@danielpeintner
Copy link
Member Author

The PR seems to be ready to merge. README has been updated.

Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@relu91 relu91 merged commit 5491801 into eclipse-thingweb:master Apr 29, 2025
17 of 26 checks passed
@erossignon
Copy link
Contributor

erossignon commented Sep 2, 2025

Not really from my side. Unfortunately, I cannot really test the changes myself since on my windows box OPCUA is blocked. Need to find another machine.

Daniel, If you don't have a PLC OPCUA server at hand, you can still start in a standalone mode, the small test server that we use in the unit tests.

>cd packages\binding-opcua
packages\binding-opcua> DEBUG=node-wot*  npx tsx test\fixture\basic-opcua-server.ts

 node-wot:binding-opcua:basic-opcua-server:info Server started: opc.tcp://yourmachine:7890 +0ms

@danielpeintner
Copy link
Member Author

The problem was/is that the protocol is blocked on my company device, but meanwhile I found a detour to make it work..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

binding-opcua Issues related to opc ua protocol binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OPC UA for WoT Binding

5 participants