mqttmosquittopahobridgesap-business-technology-platform

Mosquitto Broker Bridge Configuration - unacceptable protocol version


I'm doing a small IoT project with a local client using Paho MQTT client, sending MQTT data to a local mosquitto broker (acting as bridge) and then to my remote broker (SAP IoT Cloud).

The data flow from client to remote broker (using TLS) is working successfully and now I'm struggling to place and configure the bridge between accordingly.

As I have to use TLS for the MQTT messages (QoS 1), a second listener with port 8883 is created. Also the same CA file for authentication with the remote broker, as the client used for sending is provided. Once I start my broker (I haven't started my local client yet) with the stated config below I'll get error messages on an unacceptable protocol version (see log file below). So the bridge connection to my remote broker can't be established, but why?

I've had the same problem before and then I've found out that I was using a old mosquitto version (1.4.10) and updated it accordingly. But also with v1.6.7 it's not working.

Any hints are highly appreciated. Some information are depersonalized (like connection name which is used as clientId in remote broker, endpoint address)

Some necessary information:

connection raspberryPiZero
address xxxxxxxx.eu10.cp.iot.sap:8883
topic # both 1
log_type all
listener 8883
bridge_cafile /etc/mosquitto/certs/CAcert.pem
1574754457: mosquitto version 1.6.7 starting
1574754457: Config loaded from /etc/mosquitto/mosquitto.conf.
1574754457: Opening ipv4 listen socket on port 1883.
1574754457: Opening ipv6 listen socket on port 1883.
1574754715: mosquitto version 1.6.7 terminating
1574754715: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1574754721: mosquitto version 1.6.7 starting
1574754721: Config loaded from /etc/mosquitto/mosquitto.conf.
1574754721: Opening ipv4 listen socket on port 8883.
1574754721: Opening ipv6 listen socket on port 8883.
1574754721: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754721: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754726: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754726: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754741: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754741: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754741: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754741: Bridge raspberrypi.raspberryPiZero sending CONNECT
1574754742: Received CONNACK on connection local.raspberrypi.raspberryPiZero.
1574754742: Connection Refused: unacceptable protocol version
1574754742: Socket error on client local.raspberrypi.raspberryPiZero, disconnecting.
1574754747: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754747: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754747: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754747: Bridge raspberrypi.raspberryPiZero sending CONNECT
1574754747: Received CONNACK on connection local.raspberrypi.raspberryPiZero.
1574754747: Connection Refused: broker unavailable
1574754747: Socket error on client local.raspberrypi.raspberryPiZero, disconnecting.
1574754775: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754775: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754776: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754776: Bridge raspberrypi.raspberryPiZero sending CONNECT
1574754776: Received CONNACK on connection local.raspberrypi.raspberryPiZero.
1574754776: Connection Refused: broker unavailable
1574754776: Socket error on client local.raspberrypi.raspberryPiZero, disconnecting.
1574754781: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754781: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754782: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754782: Bridge raspberrypi.raspberryPiZero sending CONNECT
1574754782: Received CONNACK on connection local.raspberrypi.raspberryPiZero.
1574754782: Connection Refused: broker unavailable
1574754782: Socket error on client local.raspberrypi.raspberryPiZero, disconnecting.
1574754787: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754787: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754788: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754788: Bridge raspberrypi.raspberryPiZero sending CONNECT
1574754788: Received CONNACK on connection local.raspberrypi.raspberryPiZero.
1574754788: Connection Refused: broker unavailable
1574754788: Socket error on client local.raspberrypi.raspberryPiZero, disconnecting.
1574754793: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754793: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754794: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754794: Bridge raspberrypi.raspberryPiZero sending CONNECT
1574754794: Received CONNACK on connection local.raspberrypi.raspberryPiZero.
1574754794: Connection Refused: broker unavailable
1574754794: Socket error on client local.raspberrypi.raspberryPiZero, disconnecting.
1574754799: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754799: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754800: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754800: Bridge raspberrypi.raspberryPiZero sending CONNECT
1574754800: Received CONNACK on connection local.raspberrypi.raspberryPiZero.
1574754800: Connection Refused: broker unavailable
1574754800: Socket error on client local.raspberrypi.raspberryPiZero, disconnecting.
1574754805: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754805: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754806: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754806: Bridge raspberrypi.raspberryPiZero sending CONNECT
1574754806: Received CONNACK on connection local.raspberrypi.raspberryPiZero.
1574754806: Connection Refused: broker unavailable
1574754806: Socket error on client local.raspberrypi.raspberryPiZero, disconnecting.
1574754811: Bridge local.raspberrypi.raspberryPiZero doing local SUBSCRIBE on topic #
1574754811: Connecting bridge (step 1) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754812: Connecting bridge (step 2) raspberryPiZero (xxxxxxxx.eu10.cp.iot.sap:8883)
1574754812: mosquitto version 1.6.7 terminating
1574754812: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.

Solution

  • By default mosquitto tries to set up bridges with MQTT 3.1

    You can change this by adding the bridge_protocol_version option to the bridge configuration it accepts mqttv31 and mqttv311

    bridge_protocol_version mqttv311
    

    Try using 3.11

    Also disable the mosquitto private bridge extensions with:

    try_private false