Open wz2b opened 4 years ago
What causes this is network delay. You launch a poll, you don't get a response within some timeout, and so you launch a second poll, then the response to the first one comes in. At that point, this connection is ruined forever as this driver is currently written, it will always be one transaction out of step.
You can somewhat mitigate this by making the timeout longer, but you don't want long timeouts that wait forever before retrying. So that's a workaround for now but it's definitely NOT a long-term solution.
Is this project still being maintained? If it's not, I'll fork it and fix this myself. The telegraf modbus plugin uses this, which is why I want it fixed.
This is resolved by #65 (if accepted)
If you leave this driver running long enough, you get this:
forever. I have seen this type of thing before... I think the normal fix is to make sure that if you get a transaction with a transaction ID earlier than the one you requested, recognize that it's old and throw it away.