Mqtt and openhab
-
Hi I just finish my first sensor and my first mqtt gateway for my openhab server.
I try to make an easy door/windows sensor.
I think everything work because :
Mqtt gateway : I can ping it and everything seam fine in the log
Sensor : everything seam Fine in the log AND when I touch the 2 wire together the led flash.
My real issue is I don't understand the mqtt protocol. I was thinking about testing it to understand it but it's not that easy.
So: I use a software call mqtt.fx and connect to my mqtt server without any problems but nothing appear when I subscribe to # if I'm right the mqtt gateway is a server so I try to connect to Arduino ip adress with my software and a couldn't ... Is it normal ?
-
@Dominic-Bonneau That's a good question. No expert but just giving it a try.
The MQTT gateway is a MQTT client and not a MQTT server. So trying to connect to the MQTT gateway as if it's server isn't possible.
Also not all implementations of an MQTT server support the '#' on all channels. I haven't been able to do that with Mosquitto when I use the paho MQTT client for python on a raspberry pi.
But however there's documentation on this forum or the main page. Which describes in which topic the MQTT gatewat publishes the message etc. But you need to search for that.
What does the debug log of the gateway say?
-
When you look at the code here :
https://www.mysensors.org/build/mqtt_gateway
it doesn't have any place to enter a mqtt server adress it's why I tought it was the server .... If I don't give the mqtt server address in the code how he find it ?
-
@Dominic-Bonneau Have a look at this thread https://forum.mysensors.org/topic/4415/my-final-setup-to-get-mysensors-and-openhab-communicating-via-mqtt it might provide you with the answers you seek.