Dim
(Angelos)
October 26, 2016, 3:18pm
14
Hi @sihui ,
I found this kind of info from reading various posts here in the community and mainly from this great thread:
Would it be possible to backup the userdata folder as a whole and overwrite the userdata folder that comes with the distribution?
Well, in general a full backup comprises the conf and the userdata folder, thatās the idea. Note that the distribution does not come with any userdata folder at all, so this does not get overwritten either.
That is, if a thing is setup in a textual file, it should be taken as it is defined and Paper UI should not discover a new copy of this thing.
But should itā¦
I also read a bit the Apache Karaf Shell wiki here: Apache Karaf Container 4.x - Documentation
but mostlyā¦ trial and error
BR,
Dim
Ps: @jflarente : Thatās a big discussionā¦ check out the thread referenced above. I believe that the short answer is no because this is by design.
1 Like
rlkoshak
(Rich Koshak)
October 26, 2016, 4:00pm
16
@Dim , would you be willing to write this posting up as a quick tutorial as a top level thread under Tutorials and Examples? I think this really important and not well known and it actually answers a lot of questions I had. Eventually I can see this migrating to the official docs.
Dim
(Angelos)
October 26, 2016, 4:07pm
17
Absolutely. I will give it a try and write some examples on how to āmanageā configurations that are already stored within the OpenHab 2 OSGi cache. I am not an expert in Apache Karaf, so I will need help to āiron-outā any errors
BR,
Dim
1 Like
rlkoshak
(Rich Koshak)
October 26, 2016, 4:57pm
18
If you see any of my or Thomās tutorials you will see we all get lots of help on such postings. I look forward to reading it.
1 Like
Dim
(Angelos)
October 30, 2016, 10:21am
19
@rlkoshak : First (alpha) version posted on:
1. Intro
This tutorial is based on an apt-get installation of OH2 in Linux and is for advanced/manual configuration of OpenHab 2 and for troubleshooting purposes. The normal way of working with OpenHab 2 configurations is via the Paper UI and the config files in /etc/openhab2.
2. Basics
OpenHab 2 is based on the Eclipse SmartHome framework and is fully written in Java. It uses the Apache Karaf (a lightweight and modular container, powered by OSGi) to store many information, including all tā¦
1 Like
Drpepper
(Phillip Udel)
January 20, 2017, 10:15pm
20
Please Help, I spent the day trying to debug.
I have run out of idesā¦
The best I can tell when I press the switch It triggers a event
2017-01-20 17:00:24.129 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ''
2017-01-20 17:02:56.931 [DEBUG] [inding.mqtt.internal.MqttItemBinding] - Publishing command ON to control/SW010101/command
But the broker does not see any <> messages from OH2:
1484950320: Sending CONNACK to paho-263225371366065 (0, 0)
1484950321: Received PUBLISH from paho-263225371366065 (d0, q0, r0, m0, ācontrol/SW010101/commandā, ā¦ (2 bytes))
1484950322: Received PUBLISH from WallSwitch001 (d0, q0, r0, m0, ācontrol/SW010101/SW1/stateā, ā¦ (1 bytes))
1484950330: Received PINGREQ from Openhab2
1484950330: Sending PINGRESP to Openhab2
the broker does see Openhab:
1484950210: Sending CONNACK to Openhab2 (0, 0)
1484950217: Received PINGREQ from WallSwitch001
Can you show us the contents of your mqtt.cfg file and also the items which are not working?
Drpepper
(Phillip Udel)
January 20, 2017, 10:59pm
22
they donāt display well, had to replace the brackets with ā
āmqttbrokerā.url=tcp://10.1.0.22:1869ā
āmqttbrokerā.clientId=Openhab2
āmqttbrokerā.user=xxxxxxxxx
āmqttbrokerā.pwd=xxxxxxxxxxxx
for mine (delete any commented out lines in txt editor (e.g. notepad or notepad++)
most important line in mqtt.cfg is
OH2MQTT.url=tcp://192.168.1.10:1883
my items look like:
Switch DO_70_4 āEnsuite Fan - manual override [%s]ā (Ensuite,Node70,log) {mqtt=">[OH2MQTT:home/rfm_gw/sb/node70/dev19:command:ON:ON],>[OH2MQTT:home/rfm_gw/sb/node70/dev19:command:OFF:OFF]",autoupdate=ātrueā}
Number Tem_7048 āRoof space 7048 [%.1f Ā°C]ā (Roof, HouseData, Node70, All_Temperature,log,temp_chart) {mqtt="<[OH2MQTT:home/rfm_gw/nb/node70/dev48:state:default]"}
Number Tem_7050 āBathroom temperature 7050 [%.1f Ā°C]ā (HouseData, Bathroom, Node70, All_Temperature,log,temp_chart) {mqtt="<[OH2MQTT:home/rfm_gw/nb/node70/dev50:state:default]"}
type removing quote marks from broker name - see mine above
watou
(John Cocula)
January 20, 2017, 11:15pm
26
Note that changing existing keys in mqtt.cfg will need attention as well under /var/lib/openhab2/config to work around issue.
1 Like
Drpepper
(Phillip Udel)
January 20, 2017, 11:16pm
27
getting these errors now
17-01-20 18:15:41.872 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to āā was lost: Connection lost : ReasonCode 32109 : Cause : null
Drpepper
(Phillip Udel)
January 20, 2017, 11:21pm
28
broker is up and running. just checked
More of the log. the good news this is the most I have ever seen in the log
Connection lost (32109) - java.io.EOFException
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146)[186:org.eclipse.paho.client.mqttv3:1.0.2]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)[:1.8.0_111]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65)[186:org.eclipse.paho.client.mqttv3:1.0.2]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107)[186:org.eclipse.paho.client.mqttv3:1.0.2]
ā¦ 1 more
2017-01-20 18:20:52.438 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to āmqttbrokerā was lost: Connection lost : ReasonCode 32109 : Cause : null
2017-01-20 18:20:52.439 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mqttbrokerā
2017-01-20 18:21:02.439 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mqttbrokerā
2017-01-20 18:21:02.447 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to broker was lost
Connection lost (32109) - java.io.EOFException
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146)[186:org.eclipse.paho.client.mqttv3:1.0.2]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)[:1.8.0_111]
at org.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65)[186:org.eclipse.paho.client.mqttv3:1.0.2]
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107)[186:org.eclipse.paho.client.mqttv3:1.0.2]
ā¦ 1 more
2017-01-20 18:21:02.447 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to āā was lost: Connection lost : ReasonCode 32109 : Cause : null
2017-01-20 18:21:02.448 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker ''
2017-01-20 18:21:02.451 [DEBUG] [t.mqtt.internal.MqttBrokerConnection] - Starting message consumer for broker āmqttbrokerā on topic 'control/SW010101/SW2/stateā
2017-01-20 18:21:02.453 [DEBUG] [t.mqtt.internal.MqttBrokerConnection] - Starting message consumer for broker āmqttbrokerā on topic 'control/SW010101/SW2/stateā
2017-01-20 18:21:02.454 [DEBUG] [t.mqtt.internal.MqttBrokerConnection] - Starting message consumer for broker āmqttbrokerā on topic 'control/SW010101/SW3/stateā
2017-01-20 18:21:02.455 [DEBUG] [t.mqtt.internal.MqttBrokerConnection] - Starting message consumer for broker āmqttbrokerā on topic ācontrol/SW010101/SW3/stateā
^C
Dim
(Angelos)
January 20, 2017, 11:21pm
29
Drpepper:
getting these errors now
delete file: /var/lib/openhab2/config/org/openhab/mqtt.config
and let openHAB 2 reload your /etc/openhab2/services/mqtt.cfg
2 Likes
Drpepper
(Phillip Udel)
January 20, 2017, 11:26pm
30
Wooootā¦ your the man
up and running. I owe you big time.
Where do you live?
I owe you a coffee
1 Like
Dim
(Angelos)
January 20, 2017, 11:44pm
31
I think that @WayneStronach helped you much more by assisting you in fixing your mqtt.cfg file
I just put the finishing touch with 1 small error
Drpepper
(Phillip Udel)
January 21, 2017, 1:06am
32
true, so I owe you both LOL
1 Like
This thread helped me a lot. I was also stuck with two different mqtt config files and finally I solved it.
Thanks a lot guys and keep up the good work.