ioana
ioana

Reputation: 95

Bridge between two mosquitto brokers

I want to create a bridge between my mosquitto broker which runs on my Raspberry Pi and the mosquitto broker from my PC.

In the mosquitto.conf file (on Raspberry Pi) I set the bridge setting as:

connection raspi-PC
address 192.168.0.104:1883 -> Pc address
topic # both 0 local/sensor remote/sensor

The connection seems to be fine but when I try to publish on the local topic I cannot see the message in the subscribed client to the remote/topic.

Example:

client1 : mosquitto_pub -t local/sensor/room -m "23C"
client2 : mosquitto_sub -h 192.168.0.104 -t remote/sensor/# ->> here is not published msg

What am I doing wrong ?

Upvotes: 2

Views: 13218

Answers (1)

ralight
ralight

Reputation: 11608

You are missing a final / on the topic remapping strings, as described in the mosquitto.conf man page. You should use:

topic # both 0 local/sensor/ remote/sensor/

Upvotes: 1

Related Questions