volkszaehler / mbmd

ModBus Measurement Daemon - simple reading of data from ModBus meters and grid inverters
BSD 3-Clause "New" or "Revised" License
229 stars 81 forks source link

Add parameter to define timeout for Modbus RTU operations #265

Closed tobima closed 2 years ago

tobima commented 2 years ago

I run into the issue mentioned in pull request #258 with an ORNO 3 phase meter. These changes add a command line parameter -t timeout to change to default timeout for Modbus RTU operations.

fix https://github.com/volkszaehler/mbmd/issues/266

andig commented 2 years ago

Thank you for the PR. Could you please make the timeout a time.Duration instead of an int?

tobima commented 2 years ago

Thank you for the PR. Could you please make the timeout a time.Duration instead of an int?

Good idea. I already commited these change.

andig commented 2 years ago

Thought about this some more:

tobima commented 2 years ago

Good catch. I didn't realize that there was already a Timeout function for RTU and TCP. It should look better now.

tobima commented 2 years ago

I realized that the shorthand parameter -t conflits with the -t, --type string Register type to write: holding|coil (default "holding") of the mbmd write command. Should the shorthand paramter be removed for the timeout parameter as the other one already exists or could the shorthand parameter for the write command be renamed or removed as this is only an experimental feature at the moment?

andig commented 2 years ago

Thank you, nice PR!

isarrider commented 2 years ago

maybe related to #277

isarrider commented 2 years ago

we should note here, that it is not only RTU, but TCP too! also we should update the https://github.com/volkszaehler/mbmd/blob/master/mbmd.dist.yaml