Skip to content
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

OPC UA Discover #1477

Open
eriktavares opened this issue Jul 24, 2022 · 1 comment
Open

OPC UA Discover #1477

eriktavares opened this issue Jul 24, 2022 · 1 comment

Comments

@eriktavares
Copy link

eriktavares commented Jul 24, 2022

OPC UA Discover runtime error

**In Tools folder, i starded uadiscover, but an exception has occurred **

Open python-opcua project in Pycharm, exe tools>uadiscover in pycharm with python 10.

#!/usr/bin/env python

import sys
import os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(file)), ".."))

from opcua.tools import uadiscover

if name == "main":
uadiscover()

Traceback (most recent call last):
File "C:\Users\Erik\Documents\MachineLearning\FreeOpcUa\python-opcua\tools\uadiscover", line 11, in
uadiscover()
File "C:\Users\Erik\Documents\MachineLearning\FreeOpcUa\python-opcua\opcua\tools.py", line 599, in uadiscover
for i, server in enumerate(client.connect_and_find_servers(), start=1):
File "C:\Users\Erik\Documents\MachineLearning\FreeOpcUa\python-opcua\opcua\client\client.py", line 243, in connect_and_find_servers
self.connect_socket()
File "C:\Users\Erik\Documents\MachineLearning\FreeOpcUa\python-opcua\opcua\client\client.py", line 307, in connect_socket
self.uaclient.connect_socket(self.server_url.hostname, self.server_url.port)
File "C:\Users\Erik\Documents\MachineLearning\FreeOpcUa\python-opcua\opcua\client\ua_client.py", line 266, in connect_socket
return self._uasocket.connect_socket(host, port)
File "C:\Users\Erik\Documents\MachineLearning\FreeOpcUa\python-opcua\opcua\client\ua_client.py", line 155, in connect_socket
sock = socket.create_connection((host, port), timeout=self.timeout)
File "C:\Users\Erik\AppData\Local\Programs\Python\Python310\lib\socket.py", line 845, in create_connection
raise err
File "C:\Users\Erik\AppData\Local\Programs\Python\Python310\lib\socket.py", line 833, in create_connection
sock.connect(sa)
TimeoutError: timed out

Process finished with exit code 1

printPython

Version

Python-Version: 3.10

python-opcua Version (e.g. master branch, 0.9): 1.0

@swamper123
Copy link
Contributor

Hi,

first things first: This library is deprecated. You should switch to opcua-asyncio.
Second thing: There was never a 1.0 version.
Third: The TimeoutError is a legit error, if the socket connection never happened. Did your discovery server run on localhost?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants