Search code examples
raspberry-pimqttmosquitto

MQTT Mosquitto bridging configuration


I am trying to bridge my mosquitto broker running in raspberry pi to the cloud Mosquitto mqtt broker(test.mosquitto.org:1883).

I am not getting message in my client connected to the local broker, When I publish from a client connected to the cloud broker . But I am getting messages on the client connected to the cloud mosquitto broker from the client connected to the local MQTT Broker. I don't have any firewalls to block messages.

my mosquitto.conf file is like this

connection bridge-01
address test.mosquitto.org:1883
topic # out 0
topic # in 0

And I also have

listener 1883
allow_anonymous true

in my config

How to solve this issue?. Where am I going wrong??


Solution

  • Global wildcard subscriptions (subscribing to #) is disabled on the test.mosquitto.org broker because it generates too much load.

    e.g.

    $ mosquitto_sub -h test.mosquitto.org -v -t '#' 
    All subscription requests were denied.
    

    You can change the topic # in 0 line to only pull in only the topics you are actually using.

    Please also remember this broker is only really meant for testing, you should not be using it as a free cloud relay for anything long term.