Thanks for the answer!
But then the error on the side of openhab.
Today I wrote a arduino sketch for temperature sensors ds18b20
Opened the mosquito. cmd… bla… bla… bla… mosquitto -v
Opened MQTT spy
These are !!! Working!!!
Mosquitto shows that openhab connected. There is a ping!
A openhab no data!
I do not understand what’s the problem !?
I’m an idiot?
and noting that ON is the command to match, and on is what is published in that case. Also note that you would have to publish ON or OFF from the other side so the switch can be updated properly, since you have default in the inbound item binding. Or change default to a transform.
(In other words, no need to specify anything beyond the broker URL.) So you are running the mosquitto broker on the machine at <myip> on port 1883, with no passwords or encryption on that port?
Windows Firewall turned off.
Antivirus disabled.
Additionally, create a rule for port 8080 and 1883 (opened)
Checked CMD netstat -ano
Everything is fine!
1883 mosquito
8080 Java (openhab)
I tried to install the mosquito on the same laptop (Win 7 x64)
Test mosquitto. Work good.
Analog error
[ERROR] [.io.transport.mqtt.MqttService] - Error starting broker connection
It’s getting ridiculous. I set up a lot of time such systems as AMX, Creston, Lutron and more!
Familiar with many protocols.
And I can not adjust the MQTT ))))
Thank you, Aleksandr. Is there any chance you could take the org.openhab.binding.mqtt-1.8.0.jar and use it on your openHAB 1.7.1 installation in place of org.openhab.binding.mqtt-1.7.1.jar to see if that breaks your configuration again? It would help in trying to isolate the nature of your issue, in hopes of allowing you to upgrade back to current.
even i faced the same problems you faced to make the openhab send the mqtt messages so try to do the following
check if you have copied the correct addons to the add-ons directory in the openhab runtime. in openhab ver 1.8 there are two mqtt addons one is named as org.openhab.actions.mqtt and one more named as org.openhab.binding.mqtt . note that you have to copy the bindings to the add ons folder in your runtime
make sure you have your mqtt broker running and when you run openhab make sure that you see something getting connected in your broker window.
in the openhab config file change the line under mqtt transport to
mqtt:mybroker.url=tcp://localhost:1883
in that make sure you define some name to the broker in openhab like i have defined as mybroker
try these things and atleast you will able to see the mqtt messages on your subscribe all window
You really saved my day! I was also suffering for hours as to why my messages were not sent from openHAB to my RPi through MQTT.
I installed the org.openhab.action.mqtt-1.8.3.jar file, but I was NOT aware there was also a second JAR file needed to get the feature working fine: org.openhab.binding.mqtt-1.8.3.jar.
I spent hours chasing an error which I thought was because of me in my scripts, but it was just a lacking JAR file. A pity this is not mentioned in the openHAB documentation of the MQTT binding (here). Would have saved me hours of frustration…
PS: adding debug information in the logback.xml file (as is explained here) is/was also very useful!
Have you followed the guidelines explained in the second link in my post above? When you add the debug lines in the logback.xml file, you should at least see if the MQTT binding is fine and if the subscription is done properly.
By the way, that whole message thread is worth reading. It learned me a lot on how to try to tackle down the problems I faced with MQTT.