diff --git a/opcua2mqtt/MqttPublish.py b/opcua2mqtt/MqttPublish.py index 3714901..746383e 100644 --- a/opcua2mqtt/MqttPublish.py +++ b/opcua2mqtt/MqttPublish.py @@ -35,9 +35,8 @@ class MqttPublish(AbstractMqttPublisher): payload = { "count": cnt, "uptime": uptime } self.client.publish(self.statusTopic, json.dumps(payload), retain=True) except Empty: - if self.killBill: - logger.error("killbill received") - break + # just evaluate the killBill at the top of the loop again + pass except Exception as e: logger.error(f"Exception {type(e)} received in MQTT local loop: {e}") diff --git a/opcua2mqtt/OpcUaRequester.py b/opcua2mqtt/OpcUaRequester.py index d333652..49dd62f 100644 --- a/opcua2mqtt/OpcUaRequester.py +++ b/opcua2mqtt/OpcUaRequester.py @@ -38,8 +38,10 @@ class OpcUaRequester(threading.Thread): except ua.UaError as e: logger.error(f"UaError in inner OPC-UA loop: {type(e)} {e}") await asyncio.sleep(self.delay) - except TimeoutError as e: + except asyncio.exceptions.TimeoutError as e: logger.error(f"Timeout in inner OPC-UA loop") + except Exception as e: + logger.error(f"Exception in inner OPC-UA loop: {type(e)} {e}") def run(self): loop = asyncio.new_event_loop()