self.error_stream("Communication with the OPC-UA server %s:%d failed. Reconnecting. Trace: %s"%(self.OPC_Server_Name,self.OPC_Server_Port,traceback.format_exc()))
self.error_stream("Communication with the OPC-UA server %s:%d failed. Reconnecting. Trace: %s"%(self.OPC_Server_Name,self.OPC_Server_Port,traceback.format_exc()))
self.Fault()
self.Fault()
self.opcua_connector.reconnect()
returnNone
returnNone
returnopcua_error_wrapper
returnopcua_error_wrapper
...
@@ -93,14 +91,15 @@ class BackgroundConnector(Thread):
...
@@ -93,14 +91,15 @@ class BackgroundConnector(Thread):
self.connected=True
self.connected=True
exceptsocket.errorase:
exceptsocket.errorase:
self.debug_stream("Could not connect: %s"%(e,))
self.debug_stream("Could not connect: %s"%(e,))
finally:
self.connecting=False
defrun(self):
defrun(self):
whilenotself.connectedandnotself.stopping:
try:
self.try_connect()
whilenotself.connectedandnotself.stopping:
ifnotself.connected:
self.try_connect()
time.sleep(self.try_interval)
ifnotself.connected:
time.sleep(self.try_interval)
finally:
self.connecting=False
defstop(self):
defstop(self):
self.stopping=True
self.stopping=True
...
@@ -358,6 +357,7 @@ class RCUSCC(Device):
...
@@ -358,6 +357,7 @@ class RCUSCC(Device):
definit_device(self):
definit_device(self):
"""Initialises the attributes and properties of the RCUSCC."""
"""Initialises the attributes and properties of the RCUSCC."""
Device.init_device(self)
Device.init_device(self)
# PROTECTED REGION ID(RCUSCC.init_device) ENABLED START #
# PROTECTED REGION ID(RCUSCC.init_device) ENABLED START #
self.set_state(DevState.INIT)
self.set_state(DevState.INIT)
...
@@ -400,17 +400,11 @@ class RCUSCC(Device):
...
@@ -400,17 +400,11 @@ class RCUSCC(Device):
self.attribute_mapping["Temperature_R"]={}
self.attribute_mapping["Temperature_R"]={}
# Set defaults to property values.
# Connect to OPC-UA -- will set ON state on success