New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BadWriteNotSupported error with latest version (0.98.5) only #708
Comments
you are probably using some crappy server that require ServerTimestamp or SourceTimestamp. to do that you need to write a DataValue dv = DataValue(whaterver, ua.VariantType.Int64) |
Hi, I tried doing:
But I get exactly the same error as before:
Is my code correct? |
Try different combinations
…On Wed, Sep 26, 2018, 15:46 Francesco Cepparo ***@***.***> wrote:
Hi, I tried doing:
dv = ua.DataValue(ua.Variant([True], ua.VariantType.Boolean))
dv.ServerTimestamp = datetime.now()
dv.SourceTimestamp = datetime.now()
var.set_data_value(dv)
But I get exactly the same error as before:
Traceback (most recent call last):
File "./client_example_minimal.py", line 29, in <module>
var.set_data_value(dv) # set node value using implicit data type
File "/usr/lib/python3.7/site-packages/opcua/common/node.py", line 211, in set_value
self.set_attribute(ua.AttributeIds.Value, datavalue)
File "/usr/lib/python3.7/site-packages/opcua/common/node.py", line 257, in set_attribute
result[0].check()
File "/usr/lib/python3.7/site-packages/opcua/ua/uatypes.py", line 233, in check
raise UaStatusCodeError(self.value)
opcua.ua.uaerrors._auto.BadWriteNotSupported: The server does not support writing the combination of value, status and timestamps provided.(BadWriteNotSupported)
Is my code correct?
Thank you.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#708 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACcfzgi_hY8ALrUYi7P-4mGMA_-RMuSdks5ue4U8gaJpZM4W4ce_>
.
|
I tried, but nothing seems to work. But I need the code to work inside a Python script. |
Unfortunately on my machine I cannot even run the old versions of the software anymore, as with every version except the latest it says
|
The CLI isn't going anything special. You can look here. https://github.com/FreeOpcUa/python-opcua/blob/master/opcua/tools.py#L234 However it is using |
I managed to run version 0.98.3 by applying:
Please note that while doing
(with or without ServerTimestamp and/or SourceTimestamp), it yields the same error as the latest version:
I'd like to find the commit that is causing the new code to fail, so I'll try git bisecting the sources. I hope it can be reverted or fixed without having me modify all my Python scripts. |
The only recent change is that we do not force ServerTimestamp... It is a performance/memory optimization that any good server should support |
Ok, I'll try to adjust my code to whatever uawrite is doing. Thank you. I'll keep you posted. |
Dear all, I managed to make my code work by using the following:
Thank you all for your help. |
Hi, I am also working on implementing a client-server model using the OPC-UA protocol. I have a server with two Boolean parameters which I want to modify from a client. The server is as given below: model randTest
input Boolean x;
Boolean y;
equation
y = x;
end randTest; Now, to change the values, I have a Python OPC-UA client. A part of this client is as given below: var = client.get_node("ns=1;i=200000000")
var1 = client.get_node("ns=1;i=250000000")
print(var)
print(var1)
var.set_attribute(ua.AttributeIds.Value, ua.DataValue(True))
var1.set_attribute(ua.AttributeIds.Value, ua.DataValue(True))
myVal = client.get_values([client.get_node('ns=1;i=200000000'), client.get_node("ns=1;i=250000000")])
print(myVal) Upon executing the client, the values at the server end are not being changed. Could you please provide some insights into this? |
Sorry, it's been a long while since I worked on this. I don't remember much, but I don't think I could've helped you anyway. I am by no means an expert on this. Sorry. |
@SudhakarKuma the way its been written from python-opcua is correct! as shown in your screenshot: it looks like the server does not handle useracesslevel and writemask the right way... if he writes the value with only CurrentRead the server should respond with "BadNotWritable, but he does not... the server just dont return an error... and for sure the server dont change the value! if you dont believe me than simply download the Prosys Server or Unified Automation Cpp Demo Server or take on of our Example-Servers, and try it hands on. you can also use wireshark to investigate the requests and responses. please contact the modelica guys for support! |
@AndreasHeine Thanks for your explanation. I have also realized that there is some issue with the OPC-UA implementation at the Modelica server side. I will raise this issue with Modelica developers. As suggested, I will use Prosys Server to substantiate the point. |
If you would read your error message you would know that your node id is wrong. |
opcua.ua.uaerrors._auto.BadNodeIdUnknown: "The node id refers to a node that does not exist in the server address space."(BadNodeIdUnknown) The node id is 100% sure wrong |
the error is a response of the opcua server and not an error on clientside you could check the nodeid by browsing to the node with ua expert and then have a look in the attributes tab the first line shows the nodeid of that node! its one of the most common mistakes ... |
This is the error- QualifiedName(3:Test_Bulb_Position) |
always specify the correct VariantType! Example for a Double: double_node = client.get_node("ns=2;s=Demo.Static.Scalar.Double") # returns a Node-Class
dv = ua.DataValue(ua.Variant(200.0, ua.VariantType.Double))
double_node.set_value(dv) |
Okay, I'll try this. |
Thanks a lot, this was a great help. |
Yep,
Ditto |
Dear all, I have an issue with the latest version of python-opcua. All versions up to 0.98.3 work fine, but with version 0.98.5 I get the following error:
This is the code that generates the error (taken by the client-minimal example):
I hope you can help me run the latest version of the software.
Thank you.
The text was updated successfully, but these errors were encountered: