diff --git a/CHANGELOG.md b/CHANGELOG.md index 0712696..4405439 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +- fix exception in MODBUS timeout callback + ## [0.9.0-RC1] - 2024-06-29 - add asyncio log and debug mode diff --git a/app/src/modbus.py b/app/src/modbus.py index 57eb272..7425b56 100644 --- a/app/src/modbus.py +++ b/app/src/modbus.py @@ -108,6 +108,7 @@ class Modbus(): def close(self): """free the queue and erase the callback handlers""" logging.debug('Modbus close:') + self.__stop_timer() self.rsp_handler = None self.snd_handler = None while not self.que.empty: @@ -252,6 +253,7 @@ class Modbus(): # logging.debug(f'Modbus stop timer {self}') if self.tim: self.tim.cancel() + self.tim = None def __timeout_cb(self) -> None: '''Rsponse timeout handler retransmit pdu or send next pdu'''