Page 1 of 1

MQTT failed to start

Posted: Wednesday 13 September 2017 12:59
by mikejclark
Hopefully this should just be a quick question.
I've bought some Sonoff devices and have flashed Tasmota to utilise MQTT.
Following the Domoticz MQTT wiki I have added the MQTT Client Gateway with LAN interface
https://www.domoticz.com/wiki/MQTT
The wiki indicates that all the necessary software is installed with the Domoticz image
Please note that the current Domoticz SDCard image has this included, and you do not need to install any software.
But I see this error:

MQTT: Failed to start, return code: 14 (Check IP/Port)

Is it possible my install is old enough that MQTT was not on the image?
What do I need to do to get MQTT running?
Many thanks!

Version V3.8392
Raspberry Pi

Re: MQTT failed to start

Posted: Wednesday 13 September 2017 13:56
by Logread
not sure about how the images are updated/prepared, but you could try to see if the MQTT broker is listening by issuing this from the shell command line:

Code: Select all

netstat -na | grep 1883
if you see something output like:

Code: Select all

tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN
tcp6       0      0 :::1883                 :::*                    LISTEN
then you have a MQTT broker up and running with websockets enabled... If not you probably want to manually install a MQTT broker such as mosquitto (search the forum for instructions)
Hope this helps

Re: MQTT failed to start

Posted: Wednesday 13 September 2017 14:05
by htilburgs
Just checking to be sure:

- You installed Node.JS ? -> https://joshondesign.com/2013/10/23/noderpi
- You installed Mosquitto ? -> http://mosquitto.org/2013/01/mosquitto- ... epository/
- You don't have a firewall that blockes port 1883 ?
- You've checked the remote address and the ip port in Domoticz (Settings - Hardware MQTT Client Gateway)?
- Somethimes it helpes if you change the address from 127.0.0.1 to the real ip of your Domoiticz Host

If all this is checked and still have the error, maybe try the solution in viewtopic.php?f=6&t=14263&start=20#p144735

Succes!

Re: MQTT failed to start

Posted: Wednesday 13 September 2017 14:52
by mikejclark
Logread wrote: Wednesday 13 September 2017 13:56
Spoiler: show
not sure about how the images are updated/prepared, but you could try to see if the MQTT broker is listening by issuing this from the shell command line:

Code: Select all

netstat -na | grep 1883
if you see something output like:

Code: Select all

tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN
tcp6       0      0 :::1883                 :::*                    LISTEN
then you have a MQTT broker up and running with websockets enabled... If not you probably want to manually install a MQTT broker such as mosquitto (search the forum for instructions)
Hope this helps
I will try this when I get home, thanks!

Re: MQTT failed to start

Posted: Wednesday 13 September 2017 14:56
by mikejclark
htilburgs wrote: Wednesday 13 September 2017 14:05
Spoiler: show
Just checking to be sure:

- You installed Node.JS ? -> https://joshondesign.com/2013/10/23/noderpi
- You installed Mosquitto ? -> http://mosquitto.org/2013/01/mosquitto- ... epository/
- You don't have a firewall that blockes port 1883 ?
- You've checked the remote address and the ip port in Domoticz (Settings - Hardware MQTT Client Gateway)?
- Somethimes it helpes if you change the address from 127.0.0.1 to the real ip of your Domoiticz Host

If all this is checked and still have the error, maybe try the solution in viewtopic.php?f=6&t=14263&start=20#p144735

Succes!
I haven't installed anything yet, I have the default Domoticz installation from the image, can't remember how long ago. As you suggest, I think I am missing the software you mention. Will try and install later. Thanks!

Re: MQTT failed to start

Posted: Wednesday 13 September 2017 14:58
by htilburgs
mikejclark wrote: Wednesday 13 September 2017 14:56
htilburgs wrote: Wednesday 13 September 2017 14:05
Spoiler: show
Just checking to be sure:

- You installed Node.JS ? -> https://joshondesign.com/2013/10/23/noderpi
- You installed Mosquitto ? -> http://mosquitto.org/2013/01/mosquitto- ... epository/
- You don't have a firewall that blockes port 1883 ?
- You've checked the remote address and the ip port in Domoticz (Settings - Hardware MQTT Client Gateway)?
- Somethimes it helpes if you change the address from 127.0.0.1 to the real ip of your Domoiticz Host

If all this is checked and still have the error, maybe try the solution in viewtopic.php?f=6&t=14263&start=20#p144735

Succes!
I haven't installed anything yet, I have the default Domoticz installation from the image, can't remember how long ago. As you suggest, I think I am missing the software you mention. Will try and install later. Thanks!
You write
Following the Domoticz MQTT wiki I have added the MQTT Client Gateway with LAN interface
https://www.domoticz.com/wiki/MQTT
In the wiki are al the steps you have to follow, including installing Node.JS, installing Mosquitto, etc...
Just follow the wiki and it should be fine.

Re: MQTT failed to start

Posted: Wednesday 13 September 2017 15:21
by mikejclark
In the wiki are al the steps you have to follow, including installing Node.JS, installing Mosquitto, etc...
Just follow the wiki and it should be fine.
I was thrown by the statement about all software being already installed, but I think that must be a recent thing.
Will follow the rest of the wiki and see what happens.
Thanks!

Re: MQTT failed to start

Posted: Thursday 14 September 2017 9:40
by mikejclark
Followed the rest of the wiki and all working well now. Thanks for your help!

Re: MQTT failed to start

Posted: Thursday 14 September 2017 10:58
by htilburgs
Your welcome and succes!

Re: MQTT failed to start

Posted: Thursday 08 December 2022 21:48
by jeroenvd
htilburgs wrote: Wednesday 13 September 2017 14:05 Just checking to be sure:

- You installed Node.JS ? -> https://joshondesign.com/2013/10/23/noderpi
- You installed Mosquitto ? -> http://mosquitto.org/2013/01/mosquitto- ... epository/
- You don't have a firewall that blockes port 1883 ?
- You've checked the remote address and the ip port in Domoticz (Settings - Hardware MQTT Client Gateway)?
- Somethimes it helpes if you change the address from 127.0.0.1 to the real ip of your Domoiticz Host

If all this is checked and still have the error, maybe try the solution in viewtopic.php?f=6&t=14263&start=20#p144735

Succes!
Strangely 127.0.0.1 or localhost didn't work for me either. Changing to the real IP does the trick for me :-)