-
Notifications
You must be signed in to change notification settings - Fork 957
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
Added keyword arguments to remote.py #2545
base: dev
Are you sure you want to change the base?
Conversation
Got the following error: TypeError: ModbusClientMixin.read_holding_registers() takes 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given Fixed it by adding keywords to callbacks in __build_mapping(self)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups seems you broke our test harness, please fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was really too fast, address and count are positional not optional parameters.
Are you using an older version of pymodbus but have the current examples, that would explain your problems, because earlier it accepted named parameters for positional parameters |
I have pymodbus 3.8.3 installed, and I'm not running any of the examples. The error arises when I make a Modbus TCP to RTU gateway like this:
About breaking the test harness, I have no idea what went wrong and how I can fix it to be honest, but I would be happy to take a look if you can point me in the right direction! |
Well as you can see, the CI complains (correctly) because address= is not allowed. Since your fix works on your system it indicates the pymodbus is old. Please be aware that the remote datastore offers very limited functionality and in essence do not work as expected. The main problem is that only a few requests are supported and no proper error handling. We are working on a new version that interconnects the framers to give 100% functionality The tests are as usual in the test directory, but as I wrote the real problem is that address= is not allowed in v3.8.3 |
Got the following error:
TypeError: ModbusClientMixin.read_holding_registers() takes 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
Fixed it by adding keywords to callbacks in __build_mapping(self)