victronenergy / venus

Victron Energy Unix/Linux OS

Home Page:https://github.com/victronenergy/venus/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MQTT bridge from mosquitto to flashmq: keepalive not working

fred777 opened this issue · comments

Hi! I have a shiny new Multiplus GX with Venus OS v3.31 where I am trying to integrate a couple of measurements into home assistant with an mqtt bridge on an already existing mosquitto broker.

The bridge is defined in mosquitto.conf as follows:

connection venus
address ip_of_mp2_gx:1883
topic # both venus/

Forwarding from flashmq on the gx device to the mosquitto broker does work, but the other way is not working.

When I execute mosquitto_pub -h $MOSQUITTO_IP -t 'venus/R/MYSECRETID/keepalive' -m '{ "keepalive-options" : ["suppress-republish"] }' it will not trigger keepalive - it's not being received / processed at all by the GX device.

If I trigger the keep alive directly on flashmq broker via mosquitto_pub -h $VENUS_IP -t 'R/MYSECRETID/keepalive' -m '{ "keepalive-options" : ["suppress-republish"] }' it works as expected, i.e. data is published to both - flashmq broker and mosquitto broker via the bridge.

On flashmq side, there is nothing suspicious in the log - the bridge seems to connect just fine:

@40000000662d83da00f85ffc [2024-04-27 23:01:36.015] [NOTICE] Accepting connection from: address='192.168.10.33', transport='TCP/Non-SSL', fd=18
@40000000662d831621c944e4 [2024-04-27 22:58:20.566] [NOTICE] Client '[Bridge ClientID='s740.venus', username='', fd=18, keepalive=60s, transport='TCP/Non-SSL', address='192.168.10.33', prot=
3.1.1, clean=1]' logged in successfully

Same for mosquitto - bridge is established and no hints regarding any errors:

Apr 28 01:01:35 s740 mosquitto[53491]: 1714258895: Connecting bridge venus (192.168.10.22:1883)
Apr 28 01:01:35 s740 mosquitto[53491]: 1714258895: mosquitto version 2.0.18 running
Apr 28 01:01:35 s740 systemd[1]: Started Mosquitto MQTT Broker daemon.
Apr 28 01:01:36 s740 mosquitto[53491]: 1714258896: New connection from ::1:60662 on port 1883.
Apr 28 01:01:36 s740 mosquitto[53491]: 1714258896: New client connected from ::1:60662 as auto-1FEA3360-CB24-01D7-5B1F-D5E967A8DE14 (p2, c1, k60).
Apr 28 01:01:36 s740 mosquitto[53491]: 1714258896: New connection from 192.168.10.33:43591 on port 1883.
Apr 28 01:01:36 s740 mosquitto[53491]: 1714258896: New client connected from 192.168.10.33:43591 as 4P5TLSCsOJVB4RnFqBAeX7 (p2, c1, k60).
Apr 28 01:01:36 s740 mosquitto[53491]: 1714258896: New connection from 192.168.10.173:54572 on port 1883.
Apr 28 01:01:36 s740 mosquitto[53491]: 1714258896: New connection from 192.168.10.174:43104 on port 1883.
Apr 28 01:01:36 s740 mosquitto[53491]: 1714258896: New client connected from 192.168.10.173:54572 as vzlogger_6410 (p2, c1, k30, u'vzlogger').
Apr 28 01:01:36 s740 mosquitto[53491]: 1714258896: New client connected from 192.168.10.174:43104 as mqtt-explorer-06644356 (p2, c1, k60).
Apr 28 01:01:37 s740 mosquitto[53491]: 1714258897: New connection from 192.168.10.183:52657 on port 1883.
Apr 28 01:01:37 s740 mosquitto[53491]: 1714258897: New client connected from 192.168.10.183:52657 as OpenDTU-12150696 (p2, c1, k15, u'ahoy').
Apr 28 01:01:50 s740 mosquitto[53491]: 1714258910: New connection from 127.0.0.1:43512 on port 1883.
Apr 28 01:01:50 s740 mosquitto[53491]: 1714258910: New client connected from 127.0.0.1:43512 as nodered_8f0f1508cf3f2119 (p2, c1, k60, u'ahoy').

I played around with many options of mosquitto bridging without success.

I also tried to define the bridge on flashmq-side but it seems it's bridging abilities are a bit limited, i.e. topic mapping possible as with mosquitto.

Any help is appreciated!

sorry, my bad - there was an error in mosquitto acl file