A little history, I’m new to openHab, migrated from Smartthings. I’ve been learning as I go with a no programming experience. (Just a little Basic commadore 64)
In three or four weeks time, I’m running openhabian on a Pi 3 B. I’ve learned Item, Rules, Maps, etc. and tried following the rule design principles
I have my first ESP8266 based sensor up and running and chopped up arduino code running on it it communicating via MQTT.
I installed the MQTT 2.4 Binding watched the videos, read the documentation and the boards but I’m really having a tough time with this. I do not have an extenal MQTT server
My first try at set-up, my Sensor couldn’t connect. I troubleshot. INCLUDING uninstalling and reinstalling the MQTT 2.4 binding.
I finally got the sensor to connect to the MQTT Broker but could get any data into any items.
I’ve been at it for two days and I’m about to give up. so I though i’d start from scratch one more time.
I uninstalled the Generic MQTT thing (including the channels)
I uninstalled the MQTT Thing (Broker)
I uninstalled the MQTT Binding 2.4
Restarted the PI and noticed my sensor lost connection as it was restarting, but re-established a connection. I have no external MQTT server, so I’m guessing there is a ghost of the broker still on my PI
This is my first question ever on the site, my apologies if this is the wrong topic or way to address this.
So the question is:
How can I delete and/or find and correct these files?
I see a complete reload in my future, but I thought I’d ask first
Well, I haven’t much. I have been creating the Broker with Paper UI, and then I just have linked Items. each is a test, I thought it may have been the item type that was stopped the data.
as for the PI I cleared the cache and rebooted, and my sensor still has a connection, even after resetting it. The MQTT “Ghost” must be one the first parts of code that gets loaded. My sensor re-establishes a connection almost immediately after the Pi starts
This is a little confusing because there is a difference between the actual embedded broker and the connection to the broker. The connection to the broker is represented by a Broker Thing. So if you just deleted the Thing you just deleted the connection OH has to the embedded broker.
The broker itself you will find the configuration for under Configuration → Bindings. To remove the embedded broker, you need to uninstall the Add-On.
But, since your sensor is successfully connected I’d say leave it be, it’s working.
So since we know the emebedded broker is working you next need to create the MQTT Broker Thing. This represents the connection to the Broker. If it successfully connects to the broker it will show as Online in PaperUI.
Next you need to create your Things. It sounds like you need to create Generic MQTT Things. Create one Thing for each device. I sounds like you have one device at this time so create a single Thing.
Now create a Channel for each Thing. Now here is where I think you may have gone wrong. What makes up the message for the motion sensor topic? If it isn’t “ON” and “OFF” you need to transform the message to “ON” or “OFF” inorder for it to work. The type of the Channel also needs to be On Off switch and this Channel can ONLY be linked to a Switch Item. If you link it to any other Item type nothing will happen.
The Channel type for the temp and temp2 Channels need to be Number and the Channel type for hum needs to be Text.
@rlkoshak Thank you for the reply, I learned a ton from your design pattern posts.
I have uninstalled everything hoping for a clean start.
The add-on is un-installed: there is no MQTT under Add-ons
I think you are correct, but I was trying to start fresh so I could get the names of everything correct. ie server name, broker name, device name, topic, channel
I have a motion sensor that sends a 1
DHT22 sensor that sends a string that is a number (because MQTT only sends strings?)
I tried a switch channel for the motion sensor, I tried a text channel and a number channel for the temperature.
If I install the binding, then install the system Broker I get an error: OFFLINE (CONFIGURATION_ERROR): The system connection with the name homebroker doesnt exist anymore.
but I can create a broker thing (which goes ONLINE) and then a Generic MQTT thing with the channels. when I do, I don’t get any data. in the paper UI - control i see - for humidity and NaN for temperature.
I watch the log feed and don’t see any update, only the actual items update when i save the item file.
Here is the error log when I delete the System MQTT Broker. (time: 18:04)
Then created a Broker Thing (time: 18:07)
2019-01-18 18:04:25.628 [hingStatusInfoChangedEvent] - 'mqtt:systemBroker:90bd732b' changed from OFFLINE (CONFIGURATION_ERROR): The system connection with the name SBroker doesnt exist anymore. to REMOVING
2019-01-18 18:04:25.636 [hingStatusInfoChangedEvent] - 'mqtt:systemBroker:90bd732b' changed from REMOVING to REMOVED
2019-01-18 18:04:25.643 [hingStatusInfoChangedEvent] - 'mqtt:systemBroker:90bd732b' changed from REMOVED to UNINITIALIZED
2019-01-18 18:04:25.642 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.dispose()' on 'org.eclipse.smarthome.binding.mqtt.handler.SystemBrokerHandler@13f45c5': null
at org.eclipse.smarthome.binding.mqtt.handler.AbstractBrokerHandler.dispose(AbstractBrokerHandler.java:141) ~[?:?]
at org.eclipse.smarthome.binding.mqtt.handler.SystemBrokerHandler.dispose(SystemBrokerHandler.java:133) ~[?:?]
2019-01-18 18:04:25.671 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while disposing handler of thing 'mqtt:systemBroker:90bd732b': null
at org.eclipse.smarthome.binding.mqtt.handler.AbstractBrokerHandler.dispose(AbstractBrokerHandler.java:141) ~[?:?]
at org.eclipse.smarthome.binding.mqtt.handler.SystemBrokerHandler.dispose(SystemBrokerHandler.java:133) ~[?:?]
2019-01-18 18:04:25.719 [hingStatusInfoChangedEvent] - 'mqtt:systemBroker:90bd732b' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-01-18 18:07:29.895 [hingStatusInfoChangedEvent] - 'mqtt:broker:0661030d' changed from UNINITIALIZED to INITIALIZING
2019-01-18 18:07:30.013 [hingStatusInfoChangedEvent] - 'mqtt:broker:0661030d' changed from INITIALIZING to OFFLINE
2019-01-18 18:07:30.110 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.1.232' with clientid paho19030931491603 and file store '/var/lib/openhab2/mqtt/192.168.1.232'
2019-01-18 18:07:30.176 [hingStatusInfoChangedEvent] - 'mqtt:broker:0661030d' changed from OFFLINE to ONLINE
2019-01-18 18:07:30.285 [me.event.ThingUpdatedEvent] - Thing 'mqtt:broker:0661030d' has been updated.
It looks like the Broker thing (0661030d) is connecting to clientid paho19030931491603 but there is no System MQTT running… it’s my “ghost”
How do I fully delete it? is it located at: ‘/var/lib/openhab2/mqtt/192.168.1.232’?
Try netstat -tulpen | grep 1883 and see if there is any application running that provides a service on that port. There’s maybe a running mosquitto mqtt broker or so? Please find out and report back.
Turns out, I installed the MQTT option when I installed openhabian. there wasn’t a “ghost” that was left over, it was there before the 2.4 release… still can’t figure this MQTT out…but I’m still trying.