FreeOpcUa / python-opcua

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

debug #1160

Open godassasiom opened 3 years ago

godassasiom commented 3 years ago

edp.SecurityPolicyUri = policy.URI

godassasiom commented 3 years ago

whta‘s problem?

godassasiom commented 3 years ago

from opcua import ua, Server server=Server() server._set_endpoints("opc.tcp://192.168.2.100:48400/freeopcua/server/") uri = "http://examples.freeopcua.github.io" idx = server.register_namespace(uri) server.start()

godassasiom commented 3 years ago

then debug tell me D:\python3.7\python.exe D:/verp_python/opcua_test/opcua_client.py cryptography is not installed, use of crypto disabled cryptography is not installed, use of crypto disabled Traceback (most recent call last): File "D:/verp_python/opcua_test/opcua_client.py", line 2, in opcua-client.exe NameError: name 'client' is not defined

godassasiom commented 3 years ago

please help me

AndreasHeine commented 3 years ago

do not user underscore methods if you dont know what you are doing ( internal methods ) use "server.set_endpoint(" like in the examples 😉

AndreasHeine commented 3 years ago

Examples: https://github.com/FreeOpcUa/python-opcua/tree/master/examples

Undescore: https://www.datacamp.com/community/tutorials/role-underscore-python#SLU Single Pre Underscore is used for internal use. Most of us don't use it because of that reason.