Heys guys i have this issue when i restarted my pi throught sudo reboot
17-02-19 11:11:57 ERROR (Thread-7) [homeassistant.components.mqtt] Can't connect to the broker. Please check your settings and the broker itself
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/mqtt/__init__.py", line 291, in setup
birth_message)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/mqtt/__init__.py", line 383, in __init__
self._mqttc.connect(broker, port, keepalive)
File "/home/homeassistant/.homeassistant/deps/paho/mqtt/client.py", line 686, in connect
return self.reconnect()
File "/home/homeassistant/.homeassistant/deps/paho/mqtt/client.py", line 808, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/lib/python3.4/socket.py", line 509, in create_connection
raise err
File "/usr/lib/python3.4/socket.py", line 500, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
17-02-19 11:11:57 ERROR (MainThread) [homeassistant.bootstrap] component mqtt failed to initialize
i think yes. my broker running good if now i put the command: mosquitto
show me:
1487503461: mosquitto version 1.4.10 (build date Thu, 25 Aug 2016 10:12:09 +0100) starting
1487503461: Using default config.
1487503461: Opening ipv4 listen socket on port 1883.
1487503461: Opening ipv6 listen socket on port 1883.
my config is:
mqtt:
broker: 127.0.0.1
port: 1883
username: xxx edit
password: xxx edit
keepalive: 60
If i understand your right then you need to make sure that mosquitto is up before starting Home Assistant. Check the systemd documentation for details.
Thank you Rodolfo for showing how to do that, this is very helpfull, a sharp contrast to fabaff’s answer, which although valid, is far from beeing helpfull… let me explain: I’m interested in setting up a home automation system right now, learning the new systemd’s peculiarities is not in my priorities yet, there are much funnier things to learn. The best way to show newbies how to persist in learning Linux is sometimes to go easy on the valid answer.