Installation of Embedded MQTT Broker with 2.5.0-SNAPSHOT fails AND/OR connection refused

mqtt
Tags: #<Tag:0x00007f1e59f93660>
(Richard) #1
  • Platform information:

    • OS: Ubuntu 18.04.2 LTS

    • Java Runtime Environment:
      openjdk version “1.8.0_202”
      OpenJDK Runtime Environment (Zulu 8.36.0.1-CA-linux64) (build 1.8.0_202-b05)
      OpenJDK 64-Bit Server VM (Zulu 8.36.0.1-CA-linux64) (build 25.202-b05, mixed mode)

    • openHAB version: 2.5.0-SNAPSHOT (#1561)

Yesterday my MQTT Instance (V2 Binding, internal OH MQTT Broker) works great on my OH 2.5 (sadly, idk the Version Nummer). Then i did update … never change a running system … and OH was not able to connect to the MQTT Broker:

 [hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden

I tried to reinstall (stopped OH, cleaned the cache, out commented the mqtt.thing file) the embedded broker (Moquette misc-mqttbroker - 2.5.0.SNAPSHOT) with no success:

[ERROR] [org.openhab.io.mqttembeddedbroker   ] - bundle org.openhab.io.mqttembeddedbroker:2.5.0.201903260112 (258)[org.openhab.io.mqttembeddedbroker.internal.EmbeddedBrokerService(304)] : The activate method has thrown an exception

[hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

and “can’t establish connection to server”

'mqtt:broker:openhabembedded' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden

==> /var/log/openhab2/openhab.log <==

 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'localhost'. Next attempt in 10000ms

==> /var/log/openhab2/events.log <==

 [hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden to OFFLINE

==> /var/log/openhab2/openhab.log <==

 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'localhost' with clientid paho34229486255687 and file store '/var/lib/openhab2/mqtt/localhost'

==> /var/log/openhab2/events.log <==

 [hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden

==> /var/log/openhab2/openhab.log <==

 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'localhost'. Next attempt in 10000ms

==> /var/log/openhab2/events.log <==

 [hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden to OFFLINE

==> /var/log/openhab2/openhab.log <==
 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'localhost' with clientid paho34229486255687 and file store '/var/lib/openhab2/mqtt/localhost'

==> /var/log/openhab2/events.log <==

[hingStatusInfoChangedEvent] - 'mqtt:broker:openhabembedded' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Verbindung zu Server kann nicht hergestellt werden

I configured the Broker only with a text file (Visual Studio):

Bridge mqtt:broker:openhabembedded "OH embedded Broker" [ host="localhost", port=1883, secure=false ]

Is this a known error of the snapshot or my misconfiguration? How can i rescue my system? (e.g.using a extern mosquitto server?)
I was so happy with my mqtt system: learned to filter out json strings, convert them to a number, calculate a new value and post the value on the knx bus. But … i crashed my system. :-0

(Off topic, skip if you do not want to read frustation: My user experience the last two months: steep learning curve, too many changes, new concepts (great), but confusing without documention and examples (bad). I never experienced a change that radical in the last 1…2…3 years. I hope OH will slow down its pace.)

1 Like

(Richard) #2

downgrade to 2.4.0-1 (sudo apt-get install openhab2=2.4.0-1), same config file, no reboot: back in business!

(Off-Topic: This openhabian-config tool …:

Grafana+influxdb installation: no success (old repository entry) solution: manual installation
Downgrade: no success … manual installation.
Sadly the log output is unreadable, so the user has no feedback, if his action had suceeded.)
Hmmm …

0 Likes

(Rich Koshak) #3

Personally, I would recommend using the external Mosquitto server at this time. I’d give the embedded broker a bit of time to mature a bit before I’d rely on it.

I’d also stay away from the snapshot builds unless you want to help find and solve the many many problems that have popped up with the merge of ESH back into the OH core. Though I don’t think any of those changes should be a cause of the problem you are seeing.

It does sound like you may have discovered a bug in the embedded broker. Please file an issue on the openhab2-addons repo. See How to file an Issue for details if you need help.

0 Likes

(Marijn Oudijk) #4

@rlkoshak, why would you currently advice to go wit mosquitto (VS embedded broker)?
I’m currently getting into my first mqtt connection so I try to learn ‘the right thing’

0 Likes

(Rich Koshak) #5

That isn’t a general recommendation but a recommendation specific to OP’s situation.

My generic opinion is that I don’t have one. It doesn’t really make much of a difference. But because the OP was having trouble, I couldn’t tell what was causing the trouble, and setting up Mosquitto is so easy I recommend moving to that.

0 Likes

(Marijn Oudijk) #6

Thanks for the explanation

0 Likes

(David Graeff) #7

The snapshot build are not recommended right now. We are currently migrating all bindings to a new build system and it is likely that the packaging does not work as intended.

The actual change is that we no longer package external dependencies like the Moquette broker in this case with the bundle but only reference them as dependencies. That seem to have failed here.

0 Likes

(Richard) #8

Rich and David: Many thanks for your reply with your explanations and your patience! That make things clear!

:slight_smile:

0 Likes