[SOLVED] Not connecting to second MQTT broker

I’ve configured information on two MQTT brokers in conf/services/mqtt.conf:

apple.url=tcp://192.168.0.12:1883
apple.clientId=openhab
apple.user=openHab
apple.pwd=XXX

banana.url=tcp://192.168.0.12:1883
banana.clientId=openhab
banana.user=openHab
banana.pwd=XXX

I can subscribe to both brokers using those identities from other places on the network.

When openHab 2.2.0 starts, it connects to the first:

2018-10-23 14:59:57.905 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2018-10-23 14:59:57.910 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'apple'

but there is no sign of a connection to the second, either in openhab’s logs, or in mosquitto’s logs on the banana server.

Is this the only required configuration?

P.S. Updated my version:

Repository        Version
----------------------------------------
openhab-distro  : 2.3.0
smarthome       : 0.10.0.oh230
openhab-core    : 2.3.0
openhab1-addons : 1.12.0
openhab2-addons : 2.3.0
karaf           : 4.1.5

with no change in behaviour.

Doh!

Configuration is in /etc/openhab2. I was editing the OLD configuration in my user directories, from an old installation of openhab.

2 Likes