Open decadenza opened 10 months ago
Added error value err = fmt.Errorf("modbus: response timeout")
@frzifus Yes, that is what I was doing as a sub-optimal measure. But I think it would be preferable to actually follow the specifications. The problem arises when the traffic is high. Any thoughts?
Due to noise/interference on the serial line (separate problem), I was having errors like:
And so on.
My system has only one slave with id 1. I came across this issue on a different repository.
As I understand it, Modbus protocol specifies that master should manage the "unexpected slave" and wait for the correct one for the specified timeout setting.
Checking the code I realised that the client was not waiting for the correct timeout before throwing the error.
With this simple change my error rate has reduced, and when it happens the correct "timeout" error is given.