First off, thanks for this plugin! Super great. :)
I think the optimization around min & max addresses:
for (let type in this.maxModbus) {
let idx = this.minModbus[type];
let count = 1+this.maxModbus[type]-idx;
this.commands.push({"cmd":'r', "type":type, "add":idx, "count":count});
}
can cause problems; I have a boiler which has Input Registers at 0,1,2 and 768,769 ... 776.
If I try to configure the plugin to read register 1 as well as register 771, I think this results in an attempt to read 771 bytes from address 1, and because there are many addresses not present, this fails:
(Also, as a side note, it might be good to specify whether the plugin assumes addresses which start at 0 or at 1; this seems to be somewhat inconsistent across Modbus documentation, so specifying which is used here might save some trial and error... I think it starts at 1, so you might also want to catch & flag i.e. "i0" as invalid?)
First off, thanks for this plugin! Super great. :)
I think the optimization around min & max addresses:
can cause problems; I have a boiler which has Input Registers at 0,1,2 and 768,769 ... 776.
If I try to configure the plugin to read register 1 as well as register 771, I think this results in an attempt to read 771 bytes from address 1, and because there are many addresses not present, this fails:
(Also, as a side note, it might be good to specify whether the plugin assumes addresses which start at 0 or at 1; this seems to be somewhat inconsistent across Modbus documentation, so specifying which is used here might save some trial and error... I think it starts at 1, so you might also want to catch & flag i.e. "i0" as invalid?)