Closed dw-1983 closed 11 months ago
Write holding registers to both components for starting/stopping filtering, setting pump motor speed, etc. I have the special need to write a single register value using Function 16 (0x10, write_multiple_holding_register), as the component does not accept/react to a single register write operation (at least for a special register) when writing a value of 0. Maybe I will raise another issue for this case, currently I can help myself in writing the following register, too, to force a write_multiple.
That is interesting. Unfortunately mqmgateway uses write_multiple_holding_register only when number of register to write is > 1. Do do this you have to specify count: (2 or more)
in config for command topic.
I am not sure what you mean at the end, you have workaround for this problem? Only one I can think of is to read at least two adjacent registers and write ["0","(last value]"
.
Thanks for the fast fix! I see there is a docker pipeline set up, so probably the docker repo will auto-update at some time later?
Regarding my custom write_multiple case:
Currently that workaround is working fine, because the followup register holds a binary value (that states "having heating installed" or not), which is always static (0) for my setup.
Thanks for the fast fix! I see there is a docker pipeline set up, so probably the docker repo will auto-update at some time later?
Unfortunately I do not have docker image build setup yet. There is a pull request #28, but it is not merged yet.
@BlackZork just fyi, I finally managed to set up a linux targeting c++ dev environment and able to build the binaries and a docker container. After starting up the service, everything worked out fine right away (mqtt connection, modbus register read/write). Especially the automatic register grouping is a huge boost of performance and minimizes the configuration effort on my integration path into Home Assistant. Incomparable to the native modbus implementation in HA (pymodbus-based). Thanks again for your work!
Good to know that it works for you, thanks :-)
FYI: v1.2.0 is available as Docker image ckware/mqmgateway:v1.2.0
on Docker Hub.
Firstly, what I can see from the documentation - great work! I have tried different gateways and none provides the flexibility I see here to bulk read and write multiple registers from/to a modbus slave in combination of mapping this functionality to MQTT topics.
My use case:
My current setup:
The Issue:
My mqtt configuration snippet for mqmgateway:
The logs of the gateway look like this:
The logs of the broker server look like this:
It looks like the mqtt client does not use credentials at all, as successful user/pass connection attempts look like this:
As far as I can see from the code, mosquitto_username_pw_set is not being called prior to mosquitto_connect. As I am no C++ developer, I don't trust myself to provide a PR (and have no dev environment setup, atm). Would you mind having a look at this issue? I will provide additional logs and do testing as required, of course.