Cannot connect to OPC server
See original GitHub issueHello,
Apologies for the noob question, I have setup an OPC server on a Rasberry Pi, and I’m trying to get the TB Gateway to connect to it, without success. The connector.log shows error
''2020-02-06 13:22:50' - INFO - opcua_connector - 86 - Starting OPC-UA Connector' ''2020-02-06 13:22:50' - DEBUG - opcua_connector - 97 - error on connection to OPC-UA server.' ''2020-02-06 13:22:50' - ERROR - opcua_connector - 98 - 'Client' object has no attribute 'load_type_definitions''
I have updated the opcua python package to the latest version (0.98.9). My TB installation runs on a Ubuntu VM, otherwise working without problems. I have setup the gateway as a device and configured the tb_gateway.yaml correctly. On the Raspberry Pi, I am running the server_example.py of the python-opcua package from https://github.com/FreeOpcUa/python-opcua/blob/master/examples/server-example.py. Using the ProSys OPC browser I can connect and retrieve the data successfully. Same applies when running the client_example.py code (from python-opcua). I have also tried running the Open62541 server, again I can connect successfully with the ProSys browser and the client_example.py script, but not with the gateway.
Any ideas what might be causing this? Thanks in advance!
[edit: just updated to the latest release, but the problem persists (error lines 99 and 100)]
Issue Analytics
- State:
- Created 4 years ago
- Comments:30 (13 by maintainers)
hi @zbeacon I just tried the latest pre-release (2.1.0.5). Thank you for fixing the subscriptions bug, I see where you have made the replacement in the code. The timeseries values are now updated regularly as should be.
The attributes are still not changing. The change event is picked up, but the uplink converter still only tries to update telemetry data - of course, the path is different, so no change is effected. I believe this is because the uplink converter is set to work with telemetry data after the initial load (since this is the last bit of information that is picked up by it). Therefore I think the fix should be something like an additional parameter in the uplink converter to say that we want to work with attribute or telemetry data types.
More specifically, in the uplink converter code, in line 33
this loop executes only once - the value of self.__config[information_type] is only “telemetry”.
—Edit— OK I found it. In opcua_connector.py, remove line 237 - after that, it works fine, updating both attributes and timeseries.
@ki-do @zbeacon Here is a fix, applied to opcua_connector.py (line 109). Basically just add the little for loop to the code and restart the gateway service.
Still not a perfect fix, as it’s picking up attribute changes but not sending them to Thingsboard. Need to look into that. It’s working for telemetry data though.