I have 2 OpenHAB instances running on 2 Raspberry Pi’s and the majority of the items on both machines are connected using mqtt-eventbus. I rely on mosquitto running on the main Pi as the broker, as I use the broker running on the other Pi for other things.
Whenever I reboot the main Pi, the second Pi fills its logs with error messages whenever it tries to publish anything. The errors are below:
2017-10-22 12:25:17.280 [WARN ] [t.mqtt.internal.MqttBrokerConnection] - Broker connection not started. Cannot publish message to topic 'Upstairs/Status/UsablePower'
2017-10-22 12:25:18.498 [WARN ] [t.mqtt.internal.MqttBrokerConnection] - Broker connection not started. Cannot publish message to topic 'Upstairs/Status/BedroomTemperature'
2017-10-22 12:25:18.803 [WARN ] [t.mqtt.internal.MqttBrokerConnection] - Broker connection not started. Cannot publish message to topic 'Upstairs/Status/TopRoofPower'
I’ve tried to tame this by adding this to /var/.lib/openhab2/etc/org.ops4j.pax.logging.cfg
log4j.logger.smarthome.event.mqtt.internal.MqttBrokerConnection = OFF
but it hasn’t made any difference. Does anyone know what the correct way of cancelling this out is?
A simple can’t connect to broker is all I need rather than an entry for every message as I have several messages per second which just clutters up the log
The MqttBrokerConnection class that’s in an internal package is from OH1. Is there a reason you’re running the OH1 MQTT binding instead of the OH2 MQTT binding?
If so, just use the right package name in the pax.logging.cfg file and it should fix the output.
That’s one of those bindings I can’t wait for a V2 version of, having the CPU tied up for minutes at a time after every change in an items file is a pain!
In the meantime does anyone know how to shut the logging off for the OH1 binding?
Thanks for the clarification. I was confused by the profusion of MQTT hits in the code.
To be clear, there is an MQTT IO Transport in both OH1 and ESH. The warns seen above appear to be coming from this OH1 transport.
If we assume the ESH transport isn’t running and/or can’t be used instead, then the solution here is still to fix the package name in the log config file.
I’m looking forward to it too. They are actually making it be a broker itself so no more need to run a separate bother. This should make initial setup for beginner user’s way easier.
I’m not sure if you will have to use the internal broker to get auto discovered Things but wouldn’t be surprised if that were a requirement.
Look to the logging docs on the oh docs site. You need to change the logger for the org.openhab.binding.mqtt binding.
Sounds good as long as it doesn’t slow down the main OH instance, and can talk to other brokers - I have one broker that deals with a couple of Happy Bubbles Bluetooth Beacon detectors, which make heaps of unfiltered noise. I bridge the topics I’m interested in to the main broker .