MQTT Bridge Mode for Mosquitto

I need to move from the integrated MQTT broker to Mosquitto because the integrated one seems to start causing issues.

I have Mosquitto set up in a Docker Container on my NAS and it seems to be working fine.

In order to give me time to migrate everything in an organized manner, especially the 2 WeMos D1 Minis that run my garage door opener and the irrigation system (I have to dismount them to update the code in them, I thought about activating bridge mode in Mosquitto for a while.

I have read around quite a bit but the only topics I could find were on how to bridge SmartThings and ClouMQTT through Mosquitto.
Has anybody managed to successfully set up a bridge through Mosquitto using another, more generic MQTT Broker as the ‘source’?

I have looked at the man page for instructions using the bridge mode, but that’s way over my head. I only understand train station - as my fellow German HomeAssistant Adventurers would say.

How about Steve’s Internet Guide?
http://www.steves-internet-guide.com/mosquitto-bridge-configuration/

Why not report the issues so they get fixed?

Thanks for the link - I’ll take a look asap.

It’s a known issue, even mentioned on the documentation

“There is an issue with the HBMQTT broker and the WebSocket connection that is causing a memory leak. If you experience this issue, consider using another broker like Mosquitto.”

1 Like

This is from now my favourite expression!

Sounds easy enough, but can’t get it to work :frowning:

Even the simplest config (.14 is the IP of my HA install. i.e. where the current broker runs)

connection hbmqtt 
address 192.168.7.14:1883
start_type automatic
keepalive_interval 15
topic #both

results in this:
image

And only the sytem topic shows up:
image

Does hbmqtt support bridging?

I don’t see anything mentioned in its documentation.

There’s one unanswered question about bridging in its Github repo.

https://github.com/beerfactory/hbmqtt/issues/113

My, admittedly naive, view was that the bridge (read: Mosquitto) would act as a MQTT client that ‘simply’ rebroadcasts everything from and to the broker it’s acting as a bridge for.

Guess it’s not that easy then.

Seems like I’ll have to get the ladder out for the ESP8266 in the garage and the coveralls for the one in the crawlspace under the house sooner than I thought.

Oh, I see. You’re configuring the Mosquitto broker, not the hbmqtt broker, to act as the bridge. Theoretically, that should work because, as you mentioned, it acts as a client so it’s no different from hbmqtt’s perspective.

So that’s all fine and good but that stream of ‘Socket error on client local.Sunology.hbmqtt’ says otherwise. :frowning:

Probably faster to haul the ladder out than find the cause of hbmqtt’s problem … that you intend to retire anyway.

You’ll use something you can update OTA next time won’t you :slight_smile:

Esphome is recommended.

Just noticed the error in my HA setup:
Invalid connection from (client @=192.168.7.10:50276) : [MQTT-3.1.2-1] Incorrect protocol name: “MQIsdp”

Not sure, what that means, but then again: does it matter - he says, ladder in hand (almost) :stuck_out_tongue:

Actually, @nickrout, thanks for the hint I think I can update the garage door WeMos OTA - hadn’t even thought about that, duh.

And yes, I thought about ESPHome - not just for the WeMos kit, but for my Sonoff S31s as well.