-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
input.modbus Read custom bit lenght in coil #8506
Comments
@mirkocomparetti-synesis as far as it concerns the code, the coil address is the BIT address in the coil. So leave out the |
@srebhan I did some more tests with Using telegraf with this configuration
this is what we got
Looking at those debug you enabled for the PR it makes me think that this is due to the fact that I need to skip some registers (like byte 1, bit 6)... should this be handled by the plugin itself? Using a modbus client (modbus doctor) this is what we found |
So, using a configuration like
works fine and the values I want to drop are dropped. But somehow I do not really like it... what do you think @srebhan ? |
It does (or should at least) discard that registers automatically. What we do is we group all consecutive registers to one request. Seems like there is a bug in your first example when trying to perform the second request. I will add some more debugging capabilities (like outputting the request itself) and we should boil that down to where it goes wrong... |
Thanks a lot for looking into it! Anyway, even with this workaround it is much better for us so that we do not need nodered to write only the colils directly to the DB! |
@srebhan here it is the result with the latest build
|
For documentation purposes: In case you experience the same issue you can, as a workaround, specify the list of addresses consecutively such that only one request will be issued. Please report here if you also own such a device. |
Relevant telegraf.conf:
This is an example configuration for this case, with a possible proposed solution that will be more clear later.
System info:
Telegraf 1.16.3, ubuntu 18.04.4 server
Steps to reproduce:
This is the example configuration
which retrieves the value
Expected behavior:
Possibility to read a configurable lenght of bits from a coil address and possibility to map them to single variables; something like the above example configuration. In additional info there is an explaination of why those need to be handled in that way, so that we get
The relevant config above is an example of how this can be achieved using dot notation, but it is not the solution, just an idea.
Actual behavior:
The value 0i for FOut in example above is the first 8bits of the coil 0000, and all the other 32 bits are not retrieved (see additional info)
Additional info:
The device is an energy meter from Seneca; in chapter 7 of the following document you can see how the coils are defined: the first 40bits of address 0000 contain the information that we need to gather and store as separeted bools in the database, because the meaning of each bit is specific and has to be stored separately.
The text was updated successfully, but these errors were encountered: