Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan batching misbehaves with modbus address zero/one issue. #28

Open
tjhowse opened this issue Jan 13, 2021 · 0 comments
Open

Scan batching misbehaves with modbus address zero/one issue. #28

tjhowse opened this issue Jan 13, 2021 · 0 comments

Comments

@tjhowse
Copy link
Owner

tjhowse commented Jan 13, 2021

Minimal config:

ip: 192.168.1.89
port: 502
update_rate: 5
address_offset: 0
variant: sungrow
scan_batching: 100
registers:
  - pub_topic: "inverter_model"
    address: 4999
    table: input

Fails: 2021-01-13 20:51:28 ERROR Failed to read 100 input table registers starting from 4900: Modbus Error: [Input/Output] No Response received from the remoteunit/Unable to decode response

This is due to the long-ignored issue of modbus4mqtt addresses starting from zero, but actual modbus addresses starting from 1. When the yaml specifies address 4999 we're actually reading address 5000 from modbus' perspective. This means when we try to batch reads on 100-register-aligned boundaries we send a request for address 4900 (4901) which is invalid.

We should fix the addresses in the example YAMLs and teach the modbus interface to account for the zero/one problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant