I understand this is a common problem, however none of the topics I have read answer my questions.
What exactly do I have to do in order to get this working?
I have (I think) a MQTT server running, and OpenHab seems to like it, but when I start the client MQTT.fx, Openhab throws an error every 2 seconds that it is disconnected.
When I close the client, Openhab behaves again.
If no other client can connect to this, how on earth can I test it?
Is this normal?
Thanks in advance for any help you can give.
If you want logs, files (or locks of my hair that I have pulled out) please let me know.
The items do indeed change via the logs, just no visual update, however they do update on my iPhone openhab app.
Using chrome on windows 7 ultimate. edit You might have meant what OS OH is on⊠that is a Rpi3.
Latest version of openhab2.
Itâs strange, if I open 2 browsers and point them both at basicUI, my other items synchronise (if I switch on a lamp on 1, it shows on the other), this doesnât happen with the mqtt item.
I also donât get the item at all in PaperUI (no item in the Control tab), it just isnât there.
Just a thought⊠do all my subscribed topics have to start with âopenhabâ?
I mean, at the moment my topic is âflat/testâ.
Should it be âopenhab/flat/testâ?
The reason I ask is that when I start mqttlens and subscribe to # (everything), I get a message posted to âopenhab/flat/testâ, and directly after a message posted to âflat/testâ, even though there is no such topic. I know I could simply subscribe to the topic explicitly and wouldnât get that posting, it just confused me why it is there.
Yes, thatâs how I found out about MQTTlens, which I prefer, before that I was using MQTTfx.
However, since your question seems rhetorical, I just read it again, it doesnât mention anything about topic prerequisites.
No idea. But I have just SSHâd into the server and it says 2.1.0 Release build. Whatever that means. The only reason I think itâs the latest version is because I did an apt-upgrade thingy a few days ago. All this Raspeberry Pi tomfoolery doesnât exactly speak to my skill set.
Many apologies, when you asked âDid you even read the link above?â, I did not presume you actually meant âDid you even read the link above, and follow all the links on that page, and follow all the links on the pages the links had within those pages?â As such I would like to change my answer.
No, I did not even read the link above.
What I actually did was read only the first link (above), and follow the step-by-step.
Having read section 5, as suggested, it is still ambiguous as to whether subscribed topics have to start with a particular prefix, since the only topic I have is âflat/testâ then âflatâ could be considered my top-level topic, and as such satisfies any future topics where âflatâ is also the top level topic, although there is a whole paragraph that states multiple topics with differing top level topics can be maintained on the same broker.
My question was more to inquire if openhab itself added âopenhabâ as a top level prefix to its MQTT topics prior to publish or subscribe.
It is entirely possible that I have a remnant of an old topic I created during testing that still exists in some form, somewhere, and is getting reported during a wildcard subscribe.
For those wanting to purge old topics, this is what I found.
Delete all the topics. It worked for me.
sudo service mosquitto stop
sudo rm /var/lib/mosquitto/mosquitto.db
sudo service mosquitto start
Devices wont show current statuses until they publish again, because there will be no topic available, which is a drawback, but at least youâll have a nice clean broker.