cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 38 forks source link

MQTT broker not starting #104

Closed Hansolduron closed 3 years ago

Hansolduron commented 4 years ago

Config below returns the following error in the log. There is no MQTT server after and HomeBridge keeps repeating the same message. Any idea for why this is happening?

config:

"platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "platform": "mqtt",
            "url": "mqtt://192.168.1.8",
            "name": "mqtt",
            "port": "1883"
        }
    ]

HomeBridge's log

[9/7/2020, 13:12:47] [mqtt] on.close <to analyze>
[9/7/2020, 13:12:48] [mqtt] on.reconnect <to analyze>
[9/7/2020, 13:12:48] [mqtt] on.error Error: connect ECONNREFUSED 192.168.1.8:1883
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.1.8',
  port: 1883
}

System info

Timezone | GMT+0200
-- | --
Raspbian GNU/Linux Buster (10)
homebridge
192.168.1.8
fe80::6eff:37db:792c:57b9
v12.18.3
v6.14.8
pi
/var/lib/homebridge
/var/lib/homebridge/config.json
Yes
emes commented 3 years ago

Do you have an mqtt server running on 192.168.1.8?

You can check with:

netstat -an | grep 1883

If not, then you'll need to install with:

sudo apt-get install mosquitto mosquitto-clients

Hansolduron commented 3 years ago

I didn't and that was the issue. Got it fixed a couple of days afterwards by installing the same in the shell. Just did not know that I had to install in the shell.