Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Cannot connect to a bridge

Ok, I thought that Mosquito, when bridging, just introduces itself to another broker as a plain MQTT client. Do you have any idea on how could this be debugged to find the exact source of the problem?

--
Łukasz Przeniosło


------ Original Message ------
From "Attilio Giordana" <attilio.giordana@xxxxxxxxx>
To "Łukasz Przeniosło" <bremenpl@xxxxxxxxx>
Date 2023-09-24 15:06:53
Subject Re: Re[2]: [mosquitto-dev] Cannot connect to a bridge

Of course, it is MQTT standard, but bridging is an extension of mosquitto. Mosquitto connect to another broker specifying that it is a broker, so that it will mot receive the messages it publish.
If the broker doesn't support bridging just closes the connection. This is what I' ve seen with the MQTT plugin of RabbitMQ.
Attilio


On Sun, Sep 24, 2023, 14:45 Łukasz Przeniosło <bremenpl@xxxxxxxxx> wrote:
Hi Attilio,
Thank you for the answer. 

What kind of broker is Supla.org?

Im not sure what the question refers to exactly, but Ill list all that I know about it:
  1. TCP based connection,
  2. Accepts MQTT protocol versions 5.0 and 3.1.1 (using 2 different ones from 2 different clients),
  3. Its SSL secured,
It does not look like anything exotic, especially since I can connect to it directly from Home Assistant or MQTTX clients. 

--
Łukasz Przeniosło


------ Original Message ------
From "Attilio Giordana" <attilio.giordana@xxxxxxxxx>
To "Łukasz Przeniosło" <bremenpl@xxxxxxxxx>; "General development discussions for the mosquitto project" <mosquitto-dev@xxxxxxxxxxx>
Date 2023-09-24 11:54:59
Subject Re: [mosquitto-dev] Cannot connect to a bridge

 What kind of broker is Supla.org? Bridging is typical of Mosquitto but it is not a standard feature of MQTT. I had a similar experience with RabbitMQ. After upgrading RabbitMQ and Mosquitto to the new releases, bridging is no longer accepted.
Attilio


On Sun, 24 Sept 2023 at 00:16, Łukasz Przeniosło via mosquitto-dev <mosquitto-dev@xxxxxxxxxxx> wrote:
Hello there,
I am trying to configure the Mosquito broker on a Raspberry Pi 3 to:
1. Allow for a connection from a Zigbee2mqtt instance (working),
2. Configure a bridge to another Broker (Supla.org). This is not working.

By using MQTTX client I am able to connect to the Supla.org broker so I am certain it works. What I think is wrong, are config files, but I cannot figure out where. I have 2 config files for the Mosquito on the Rpi:

/etc/mosquitto/mosquitto.conf:

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

per_listener_settings true

pid_file /run/mosquitto/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

allow_anonymous false
listener 1883
password_file /etc/mosquitto/passwd

The above must work, since I am able to connect here from the MQTTX client as well.

The second file is for the bridge, /etc/mosquitto/conf.d/supla_broker.conf:

# Supla bridge config

connection saupla_bridge
topic # both 0
cleansession false
remote_clientid brokerSupla
remote_password 4w9TDXU2*1V...
remote_username 07df9cbb081...
start_type automatic
try_private true
bridge_insecure false

When the Mosquito service is started, I can se the following in the log:

pi@rpi3:/etc/mosquitto/conf.d $ sudo cat /var/log/mosquitto/mosquitto.log
1695506647: mosquitto version 2.0.11 starting
1695506647: Config loaded from /etc/mosquitto/mosquitto.conf.
1695506647: Failed to associate persisted user 07df9cbb081... with ACLs, likely due to changed ports while using a per_listener_settings configuration. 
1695506647: Failed to associate persisted user 07df9cbb081... with ACLs, likely due to changed ports while using a per_listener_settings configuration. 
1695506647: Opening ipv4 listen socket on port 1883.
1695506647: Opening ipv6 listen socket on port 1883.
1695506647: Connecting bridge (step 1) saupla_bridge (mqtt85.supla.org:8883)
1695506647: mosquitto version 2.0.11 running
1695506647: Connecting bridge (step 2) saupla_bridge (mqtt85.supla.org:8883)
1695506648: Client local.brokerSupla closed its connection.
1695506648: New connection from ::1:42736 on port 1883.
1695506648: New client connected from ::1:42736 as mqttjs_3116b5eb (p2, c1, k60, u'mqtt').
1695506655: Connecting bridge (step 1) saupla_bridge (mqtt85.supla.org:8883)
1695506655: Connecting bridge (step 2) saupla_bridge (mqtt85.supla.org:8883)
1695506655: Client local.brokerSupla closed its connection.
1695506673: Connecting bridge (step 1) saupla_bridge (mqtt85.supla.org:8883)
1695506673: Connecting bridge (step 2) saupla_bridge (mqtt85.supla.org:8883)
1695506673: Client local.brokerSupla closed its connection.
1695506698: Connecting bridge (step 1) saupla_bridge (mqtt85.supla.org:8883)
1695506698: Connecting bridge (step 2) saupla_bridge (mqtt85.supla.org:8883)
1695506698: Client local.brokerSupla closed its connection.
1695506729: Connecting bridge (step 1) saupla_bridge (mqtt85.supla.org:8883)
1695506729: Connecting bridge (step 2) saupla_bridge (mqtt85.supla.org:8883)
1695506729: Client local.brokerSupla closed its connection.
1695506760: Connecting bridge (step 1) saupla_bridge (mqtt85.supla.org:8883)
1695506760: Connecting bridge (step 2) saupla_bridge (mqtt85.supla.org:8883)
1695506760: Client local.brokerSupla closed its connection.

The last 3 lines go on and on- the bridge cannot be connected. The connection on port 1883 is the Zigbee2mqtt instance. 

I would appreciate all feedback and help in figuring out why I cannot successfully create this bridge. 

--
Łukasz Przeniosło

_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev

Back to the top