Can't set up second mqtt bridge (connection to second broker)

Hi,

I am trying to connect to second mqtt broker by configuring second bridge. The broker is outside of my lecal network. I have got following data

server: xxx.yyy.org
port: 8883
TLS: on
user: supersecretuser
password: supersecretpassword

When I put those data to mqtt.fx, there is no problem with connection, I see mqtt messages. But when I setup it in openhab (via UI or manually using things file), bridge is offline. always.

Here is a piece of my mqtt.things file regarding second bridge:

Bridge mqtt:broker:broker_1 [ host="xxx.yyy.org", port=8883, secure=true, username="supersecretuser", password="supersecretpassword" ]
{  

}

Any idea why? Could you help me?

Your openhab.log might tell you more.

broker_1 is an unusual choice to name a second broker, it is unique yes?

It is just a name for testing purposes :slight_smile: And yes, unique one. Log says nothing special, maybe I will change to DEBUG if noone has any clue here.

2021-07-21 12:05:02.372 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'xxx.yyy.org' with clientid 56f46e2a-8c69-4329-9aae-2d3194c59aa1
2021-07-21 12:05:02.494 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:broker_1' changed from UNINITIALIZED to INITIALIZING
2021-07-21 12:05:02.494 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:broker_1' changed from INITIALIZING to OFFLINE
2021-07-21 12:05:02.738 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:broker_1:Test_thing' changed from UNINITIALIZED to INITIALIZING
2021-07-21 12:05:02.745 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:broker_1:Test_thing' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE)

Change to false to test if it works

No, it does not work.

2021-07-21 14:08:14.531 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'xxx.yyy.org' with clientid 8d69b432-5bf4-4a3c-abc1-ec8dc2a948f2
2021-07-21 14:08:14.617 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:broker_1' changed from OFFLINE (COMMUNICATION_ERROR): java.io.IOException: Connection reset by peer to OFFLINE
2021-07-21 14:08:14.718 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:broker_1' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Timeout
2021-07-21 14:08:14.718 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:broker_1' changed from OFFLINE (COMMUNICATION_ERROR): Timeout to OFFLINE (COMMUNICATION_ERROR): java.io.IOException: Connection reset by peer

I recommend you to setup bridge between local and remote MQTT brokers and use in OH he setup for local only.

Based on your example I assume that you can try connect to supla.org :wink: so please check this Zamel MEW-01 + Mosquitto + OpenHab3 - supla.org

1 Like

You made my day!!! I have been trying for couple of weeks without success and now I see bridge mode is what I am looking for! I was even thinking about such solution, but didn’t know if such exists and I was looking using wrong words. Thanks one again!

Nice to hear that it works also for you :slight_smile:
Maybe during the weekend I will prepare English version.

1 Like

Works like a charm, althought I still don’t get why I could not connect via openhab mqtt binding. Anyway it works, so I dont care now :smiley: Thanks once again !!

1 Like