-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Hi,
I'm using pymodbus over RS485 with RtuFramer and AsyncModbusProtocol based on the twisted serialport. (Python 2.7)
Whenever there are multiple slaves attached and one of them is disabled, there is a reponse/transaction mismatch. The request of the disabled slave never return any response and any further requests with any other slaves too. No timeout is ever reached and I have to call the errorCallback manually.
I figured out that, after the errorCallback is called, the TransactionManager (RtuFramer uses FifoTransactionManager) still contains the failed deferred. Any future request with valid response tries to match with that failed deferred and therefore discard the response. The FifoTransactionManager tries always to match the first element of the list and not the x element based on the Transaction-ID.
def getTransaction(self, tid):
_logger.debug("getting transaction %s" % str(tid))
return self.transactions.pop(0) if self.transactions else None
Workaround: Delete the failed transaction in my errorCallback method.
Solution: Add handling for failed requests.