Openhab2 2.1 MQTT Service initialization completed but not starting?


(mick) #1

Hi
im a newish starter to openhab2 but im having a few issues. I had openhab 2.1 running ok on a laptop but unfortunately it died and left me installing it on a new laptop again.I have installed openhab2 2.1 again got it running as a windows service. I have the mosquito broker running as a windows service and seeing the commands in mqttfx from the sonoff basics with but on the openhab log im seeing “MQTT Service initialization completed” but not started?. Also I have had to rebuild my .items folder and .things folders.

2018-10-22 12:53:28.603 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘sonoff.items’
2018-10-22 12:53:28.686 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘Sonoff.Strings.items’
2018-10-22 12:53:28.724 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘Sonoff.Wifi.Signals.items’
2018-10-22 12:53:30.936 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2018-10-22 12:53:31.257 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2018-10-22 12:53:31.360 [INFO ] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app

my .items folder

Switch Boys_Room_Light “Boys_Room_Light” [ “Switchable” ] { mqtt=">[mosquitto:cmnd/Boys_Room_Light/POWER:command:*:default],<[mosquitto:stat/Boys_Room_Light/POWER:state:default]"}

my .things folder

im struggling with. I have tried to read and understand how to configure it but im not understanding it correctly should it be

Switch Boys_Room_Light_Switch “Boys_Room_Light” { channel=“192.168.5.64” }

any help would be appreciated or if someone could post a .things config for a sonoff basic I could adapt that would be very helpful.

thanks in advance

mick


(Angelos) #2

since you are on OH 2.1 (why not 2.3 ?) you are still using the MQTT v1 binding
The MQTT v2 is only available for testing on the 2.4 snapshot releases.
So… no need for .things stuff and channels (this is coming soon with the MQTT v2 world)
Use the old style configuration for items to bind them to the MQTT v1 world

unless you deployed manually the MQTT v2 jar on your OH 2.1… (I don’t think that it would work)

you should have 2 entries in you openhab.log:

2018-10-22 05:42:31.533 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2018-10-22 05:42:31.534 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'alias'

post your mqtt.cfg to be checked


(mick) #3

HI

I did try 2.3 but got a load more errors and couldn’t work out what was wrong so I went back to what I thought would work easier lol. I haven’t deployed v2 jar that im aware of ive only added the mqtt service from the paper ui?

my mqtt config

Define your MQTT broker connections here for use in the MQTT Binding or MQTT

Persistence bundles. Replace with an ID you choose.

URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883

#mosquitto.url=tcp://192.168.5.60:1883

Optional. Client id (max 23 chars) to use when connecting to the broker.

If not provided a random default is generated.

#mosquitto.clientId=mosquitto

Optional. True or false. If set to true, allows the use of clientId values

up to 65535 characters long. Defaults to false.

NOTE: clientId values longer than 23 characters may not be supported by all

MQTT servers. Check the server documentation.

#mosquitto.allowLongerClientIds=false

Optional. User id to authenticate with the broker.

#mosquitto.user=

Optional. Password to authenticate with the broker.

mosquittopwd=

Optional. Set the quality of service level for sending messages to this broker.

Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2

(Deliver exactly once). Defaults to 0.

#mosquitto.qos=

Optional. True or false. Defines if the broker should retain the messages sent to

it. Defaults to false.

#mosquitto.retain=

Optional. True or false. Defines if messages are published asynchronously or

synchronously. Defaults to true.

#mosquitto.async=

Optional. Defines the last will and testament that is sent when this client goes offline

Format: topic:message:qos:retained

#mosquitto.lwt=

cheers


(CM6.5 H102) #4

Do you have these settings commented out in the cfg file or just a typo? If commented out, remove the # .


(mick) #5

Hi

Thank you it started but I now get the following error. sorry for been a pain

2018-10-22 22:38:45.805 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2018-10-22 22:38:45.992 [INFO ] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app
2018-10-22 22:38:46.055 [ERROR] [penhab.io.transport.mqtt.MqttService] - Error starting broker connection
java.lang.IllegalArgumentException
at org.eclipse.paho.client.mqttv3.MqttConnectOptions.validateWill(MqttConnectOptions.java:168)[214:org.openhab.io.transport.mqtt:1.10.0]
at org.eclipse.paho.client.mqttv3.MqttConnectOptions.setWill(MqttConnectOptions.java:158)[214:org.openhab.io.transport.mqtt:1.10.0]
at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.openConnection(MqttBrokerConnection.java:344)[214:org.openhab.io.transport.mqtt:1.10.0]
at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.start(MqttBrokerConnection.java:99)[214:org.openhab.io.transport.mqtt:1.10.0]
at org.openhab.io.transport.mqtt.MqttService.updated(MqttService.java:115)[214:org.openhab.io.transport.mqtt:1.10.0]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
at java.lang.Thread.run(Unknown Source)[:1.8.0_191]


(Angelos) #6

try the following: add as the very first line in your mqtt.cfg the following:

pid:org.openhab.mqtt

check this out also: How to use code fences & MQTT Binding (v1.11) Getting Started 101


(Vincent Regaud) #7

Also, have you installed the mqtt action?
If yes, remove it


(mick) #8

Hi Guys

Thank you for the help its working…party time……… I had to uninstall everything and reset windows to default settings (probably a bit over kill) then re install mosquito and then openhab 2.3 (thought i would give it another go as I was loosing the will to live)and it works ace… I have noticed in the log that im getting failed to execute “arping”? is this something I need to run sonoff basics and pro`s or is this something I can disable somehow ? can anyone shed some light what it is or what is should be doing? I am planning on expanding this system to incorporate dht11 temp and humidity sensors and audio/visual equipment at a later date so if its needed then I can cope with the error in the log.

thanks again for the assistance and hopefully one day I can return the favour in helping someone else out.

You guys are amazing

cheers

mick


(Angelos) #9

you can ignore this one
see also: