Raspberry PI + MQTT Gateway + Domoticz -> Connection refused
-
Hello to all,
i am happy to be here! This is great Platform, thanks for that:)
To my Problem:
I have installed a Raspberry with Domoticz and followed the Instructions on : https://www.mysensors.org/build/raspberry
to create my Gateway.
My Steps:git clone https://github.com/mysensors/MySensors.git --branch master cd MySensors ./configure --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1 make sudo ./bin/mysgw -d
And after that i am getting this Errors:
pi@raspberrypi:~ $ cd MySensors/ pi@raspberrypi:~/MySensors $ sudo ./bin/mysgw -d mysgw: Starting gateway... mysgw: Protocol version - 2.1.1 mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.1.1 mysgw: TSF:LRT:OK mysgw: TSM:INIT mysgw: TSF:WUR:MS=0 mysgw: TSM:INIT:TSP OK mysgw: TSM:INIT:GW MODE mysgw: TSM:READY:ID=0,PAR=0,DIS=0 mysgw: MCO:REG:NOT NEEDED mysgw: MCO:BGN:STP mysgw: MCO:BGN:INIT OK,TSP=1 mysgw: Attempting MQTT connection... mysgw: connect: Connection refused mysgw: failed to connect mysgw: Attempting MQTT connection... mysgw: connect: Connection refused mysgw: failed to connect mysgw: Attempting MQTT connection... mysgw: connect: Connection refused mysgw: failed to connect
Can someone help me?
Thanks, Arthur.
-
Welcome to the MySensors community @artipi !
Domoticz is a mqtt client and wants to connect to a mqtt broker.
The Mqtt gateway is also a mqtt client that wants to connect to a broker.
So you need a mqtt broker that both clients can connect to.
Luckily, Domoticz has instructions for installing mosquitti, which is a mqtt broker. It might already be installed on your system. If it is, you can instruct the gateway to connect to it by using --my-port=1883 in the configure command.
If mosquitto isn't installed, you can install it by following these instructions: https://www.domoticz.com/wiki/MQTT#Installing_Mosquitto
-
Thanks very much! Mosquitto was the solution!:)
-
Just another question:
How to test incomming messages to broker from msgw??
-
You can install any mqtt client on computer, connect to mqtt broker and subscribe to topic # and you should be able to see all incoming messages. Or you can start playing with the ethernet gateway first (this way you can use myscontroller to monitor the gateway) and later move to mqtt.
-
Ok, thanks.