Hardware: Intel Q9650 on Dell 0G261D motherboard
OS: Ubuntu 18.04.1 LTS
JRE: OpenJDK 1.8.0_192
OpenHAB 2.5.0.M3
I started a thread sometime back by trying to use Mosquitto, ended up going with the embedded broker and worked to get it running, then to pull temperature data from a Sonoff TH16. I was successful for a few minutes before the broker stopped working and I’ve not been able to get it running again. That thread was solved (perhaps prematurely) so I’m moving over here.
Original thread:
Where I am today
- Recently updated to 2.5.0.M3
- The “MQTT Broker Moquette 2.5.0.M3” was installed
- The “MQTT Binding 2.5.0.M3” was installed
- I did not install the suggested MQTT thing; I have a bridge, thing and channels in a .things file as:
Bridge mqtt:broker:mqttbroker "MQTT Broker" [ host="127.0.0.1", secure=false, port=1883, qos=0, retain=false, clientID="openhab", keep_alive_time=30000, reconnect_time=60000 ]
{
Thing topic Sonoff_Coop_Thing "Sonoff Coop" @ "openhab" {
Channels:
Type switch : power "Power" [ stateTopic="stat/Sonoff_Coop/POWER", commandTopic="cmnd/Sonoff_Coop/POWER" ]
Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Coop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature"]
Type number : humidity "Humidity" [ stateTopic="tele/Sonoff_Coop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
}
}
My .items file contains:
Switch Sonoff_Coop_Power "Coop Switch" <switch> { channel="mqtt:topic:mqttbroker:Sonoff_Coop_Thing:power"}
Number Sonoff_Coop_Temperature "Coop Temperature [%.1f °F]" <temperature> { channel="mqtt:topic:mqttbroker:Sonoff_Coop_Thing:temperature"}
Number Sonoff_Coop_Humidity "Coop Humidity [%s %%]" <humidity> {channel="mqtt:topic:mqttbroker:Sonoff_Coop_Thing:humidity"}
The broker was working right up to the time that the Temperature data started displaying from my Sonoff TH16 on my sitemap, then suddenly the broker just stopped working.
My openhab.log file is continuously displaying the following entries:
2019-10-08 20:20:18.172 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '127.0.0.1'. Next attempt in 10000ms
2019-10-08 20:20:18.173 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '127.0.0.1' with clientid openhab and file store '/var/lib/openhab2/mqtt/127.0.0.1'
And the events.log repeats:
2019-10-08 20:21:48.192 [hingStatusInfoChangedEvent] - 'mqtt:broker:mqttbroker' changed from OFFLINE (COMMUNICATION_ERROR): Unable to connect to server to OFFLINE
2019-10-08 20:21:48.197 [hingStatusInfoChangedEvent] - 'mqtt:broker:mqttbroker' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Unable to connect to server
I’ve uninstalled the broker and binding and rebooted, no change. It’s all uninstalled now as it was filling my log files.
There is a file called “mqttembedded.bin” that was created in /var/lib/openhab2 that includes a lot of characters in addition to my .things file entries. Could this file be corrupt? What if I deleted the file and restarted openHAB?