FreeOpcUa / python-opcua

LGPL Pure Python OPC-UA Client and Server
http://freeopcua.github.io/
GNU Lesser General Public License v3.0
1.32k stars 661 forks source link

My simple python server error #1529

Open KodKarls opened 8 months ago

KodKarls commented 8 months ago

Hello guys :)

I work on Linux and test opcua module and UaExpert app. I write simple code in python:

from opcua import Server, ua

if __name__ == '__main__':
    server = Server()
    url = 'opc.tcp://localhost:62541'
    server.set_endpoint(url)
    server.set_server_name('Tango Simulation Server')
    server.set_security_policy([ua.SecurityPolicyType.NoSecurity])

    namespace = 'TANGO_SIMULATION_SERVER'
    idx = server.register_namespace(namespace)

    node = server.get_objects_node()

    upack_process_folder = node.add_folder(idx, 'GVL.UnpackProcess')
    device_node = upack_process_folder.add_object(idx, 'MccStd_001')
    device_node.add_variable(idx, 'bForwardButton', False)
    device_node.add_variable(idx, 'bAutoButton', False)
    device_node.add_variable(idx, 'bTermFuse', False)
    device_node.add_variable(idx, 'bSupply', False)
    device_node.add_variable(idx, 'udHours', 0)
    device_node.add_variable(idx, 'uMinutes', 0)
    device_node.add_variable(idx, 'uSeconds', 0)
    device_node.add_variable(idx, 'sStatus', '')
    device_node.add_variable(idx, 'sState', '')

    server.start()
    print(f'Server started at {url}')

When I run this script everything is allright and get output:

Server started at opc.tcp://localhost:62541
Listening on localhost:62541

But when I connect to the server via UaExpert my console output throw this:

Tried to read attribute '14' in TwoByteNodeId(i=35), but the attribute is missing
Tried to read attribute '15' in TwoByteNodeId(i=35), but the attribute is missing
Tried to read attribute '16' in TwoByteNodeId(i=35), but the attribute is missing
Tried to read attribute '17' in TwoByteNodeId(i=35), but the attribute is missing
Tried to read attribute '27' in TwoByteNodeId(i=35), but the attribute is missing
Tried to read attribute '14' in TwoByteNodeId(i=33), but the attribute is missing
Tried to read attribute '15' in TwoByteNodeId(i=33), but the attribute is missing
Tried to read attribute '16' in TwoByteNodeId(i=33), but the attribute is missing
Tried to read attribute '17' in TwoByteNodeId(i=33), but the attribute is missing
Tried to read attribute '27' in TwoByteNodeId(i=33), but the attribute is missing
Tried to read attribute '14' in TwoByteNodeId(i=31), but the attribute is missing
Tried to read attribute '15' in TwoByteNodeId(i=31), but the attribute is missing
Tried to read attribute '16' in TwoByteNodeId(i=31), but the attribute is missing
Tried to read attribute '17' in TwoByteNodeId(i=31), but the attribute is missing
Tried to read attribute '27' in TwoByteNodeId(i=31), but the attribute is missing
Tried to read attribute '14' in FourByteNodeId(i=2004), but the attribute is missing
Tried to read attribute '15' in FourByteNodeId(i=2004), but the attribute is missing
Tried to read attribute '16' in FourByteNodeId(i=2004), but the attribute is missing
Tried to read attribute '17' in FourByteNodeId(i=2004), but the attribute is missing
Tried to read attribute '27' in FourByteNodeId(i=2004), but the attribute is missing
Tried to read attribute '10' in FourByteNodeId(i=2004), but the attribute is missing
Tried to read attribute '14' in TwoByteNodeId(i=58), but the attribute is missing
Tried to read attribute '15' in TwoByteNodeId(i=58), but the attribute is missing
Tried to read attribute '16' in TwoByteNodeId(i=58), but the attribute is missing
Tried to read attribute '17' in TwoByteNodeId(i=58), but the attribute is missing
Tried to read attribute '27' in TwoByteNodeId(i=58), but the attribute is missing
Tried to read attribute '10' in TwoByteNodeId(i=58), but the attribute is missing

I do not understand those errors and why...?