nauful / LibUA

Open-source OPC UA client and server library
Apache License 2.0
253 stars 90 forks source link

Call with BadTypeMismatch #186

Closed VitorKawao closed 2 weeks ago

VitorKawao commented 1 month ago

Hello Nauful,

My client asked me to implement call/methods. As I don't have his opc server, I tried to find one for free. So I found Prosys (https://prosysopc.com/products/opc-ua-simulation-server/) I could Read its InputArguments and OutputArguments, but when I try the call, its execute the method at the server

image

But the StatusCode returns BadTypeMismatch

image

image

Do you know what can be?

Best Regards, Vítor Guedes

nauful commented 3 weeks ago

Hello Vitor,

The server returns that error, not the client. Is the server able to read all of the input arguments passed? Would you be able to get an unsecured wireshark capture?

Regards, Nauful

VitorKawao commented 3 weeks ago

Hello,

I think the server received the arguments, at least the "pow" and 15.0 and executed correctly the method image

I attached the wireshark zipped. call_wireshark.zip

Thank you, Vítor Guedes

nauful commented 3 weeks ago

There might be an issue with the return type but I can't find it in the wireshark capture. Can you trim the wireshark to only that part of the timeline, or tell me which ports are used for opcua?

Regards, Nauful

VitorKawao commented 3 weeks ago

Hello, I don't know if I understand correctly what to do with trim the wireshark. But it this one:

image

I attached another zip with the new wireshark, and I included a wireshark with uaexpert (it works with it, I don't know if it helps)

I am using 53530 port. wireshark.zip

Best Regards, Vítor Guedes

nauful commented 2 weeks ago

I see the UA traffic in call_uaexpert but not in call_api. Can you show me the body for call request and response via api?

This is the one for call_uaexpert: image

image

VitorKawao commented 2 weeks ago

Hello,

The call request image

The call response image

I zipped again the wireshark call_api.zip

Maybe I am doing something wrong at the code. image

Best Regards, Vítor Guedes

nauful commented 2 weeks ago

Found and fixed a bug, please try with the latest.

VitorKawao commented 2 weeks ago

Hello,

The BadTypeMismatch error was fixed, but unfortunately I have another problem. Now it is returning BadDecodingError

image

The problem seems to be at numOutputs

image

Because it only have two and succeeded became false

image

I attached again the wireshark call_api.zip

Best regards, Vítor Guedes

nauful commented 2 weeks ago

Hmm, pushed another update. Please try that and let me know if it works.

Thanks, Nauful

VitorKawao commented 2 weeks ago

Now it is working!!

Thank you so much Vítor Guedes

nauful commented 2 weeks ago

Great! I'll push a new package in a bit.

Thanks, Nauful