I have an issue starting the MQTT binding within openhab2.
Openhabian is running an old RPI2 and seems to be running as it should.
I can connect with the app and the basic ui is looking OK.
I set up the mosquitto broker and installer the MQTT binding.
An app on my android phine can read the data from the RPI (on port 1883) send by an ESP8266.
But openHAB isn’t connecting.
in MQTT.cfg the following lines are used:
When I check the openhab.log or events.log I don’t see any connection attempts.
Also mosquitto.log doesn’t show any connection attempts from the RPI.
Restarted the PI and reinstalled the MQTT binding, mosquitto multiple times, but no luck.
Regards and thanks,
Is the MQTT Broker on the same host (the rPi2) ?
If yes, use:
Do the following:
Enable debug in the openHAB console:
log:set DEBUG org.openhab.binding.mqtt &
log:set DEBUG org.openhab.io.transport.mqtt
Uninstall from PaperUI the MQTT Action add-on (if installed)
Shut down OH2
Also, make sure that the clientId (openhab2) is not used by any other client
Which release of OH2 are you using?
My mqtt.cfg is as follows and it is working. mosquitto broker is mosquitto again in my setup. I also created a user and pass under mosquitto. Maybe your setup doesnot allow unauthenticated?? And maybe you should put “mqtt:” in front of every line.
No, it should be without
mqtt: in openHAB2 since we are using a dedicated config file (
/etc/openhab2/services/mqtt.cfg) for the MQTT parameters.
Wow, i am on OH2 snapshot
#920, and my setup is like this and funny thing it is working? I should check it again. I only use mqttitude maybe that’s why…
Thanks for your replies…
Unfortunatly your solutions didn’t work.
In the end I re-installed openhabian and gues what… everything works now.
So maybe something went wrong during the first installation??
I had a similar problem due to an initial typo. Cleaning the MQTT settings in the OpenHAB database fixed it for me:
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 th…
I think this is also what happend when you reinstalled it.
Just to add to this. I had the same problem, I spent hours and hours and hours trying to get it to work. (Literally about 10 hours
Then I uninstalled OpenHAB, reinstalled it… added the MQTT binding and put my IP, user, password in mqtt.confg
And it worked first time!!!
So if you are reading this thread, uninstall/reinstall OpenHAB.
I had a similar issue when I upgraded MQTT to ver 3.1 and it just stopped working for no reason. After uninstalling MQTT action in the PaperUI. everything seems to working fine!!
Thanks for your suggestion!!