Frigate wont connect to mqqt

Hi,

when i start frigate with this in the config file i see

mqtt:
host: 192.168.1.45
user: mqqtuser
password: mqqtpass
port: 1883
topic_prefix: frigate

i get this

2023-07-10 00:06:32.853190977  [INFO] Starting Frigate...
2023-07-10 00:06:34.104320577  [2023-07-10 02:06:34] frigate.app                    INFO    : Starting Frigate (0.12.0-bc16ad1)
2023-07-10 00:06:34.122909038  [2023-07-10 02:06:34] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-07-10 00:06:34.125090464  [2023-07-10 02:06:34] peewee_migrate                 INFO    : Starting migrations
2023-07-10 00:06:34.129830346  [2023-07-10 02:06:34] peewee_migrate                 INFO    : There is nothing to migrate
2023-07-10 00:06:34.145749319  [2023-07-10 02:06:34] frigate.app                    INFO    : Output process started: 302
2023-07-10 00:06:34.146152729  [2023-07-10 02:06:34] detector.cpu                   INFO    : Starting detection process: 300
2023-07-10 00:06:34.146310470  [2023-07-10 02:06:34] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-07-10 00:06:34.151373960  [2023-07-10 02:06:34] frigate.app                    INFO    : Camera processor started for kantoor: 305
2023-07-10 00:06:34.156156315  [2023-07-10 02:06:34] frigate.app                    INFO    : Capture process started for kantoor: 306

when i only use

mqtt:
host: 192.168.1.45
topic_prefix: frigate

i get

2023-07-10 00:05:28.565522852  [INFO] Starting Frigate...
2023-07-10 00:05:29.779308232  [2023-07-10 02:05:29] frigate.app                    INFO    : Starting Frigate (0.12.0-bc16ad1)
2023-07-10 00:05:29.795473181  [2023-07-10 02:05:29] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-07-10 00:05:29.797733685  [2023-07-10 02:05:29] peewee_migrate                 INFO    : Starting migrations
2023-07-10 00:05:29.803641274  [2023-07-10 02:05:29] peewee_migrate                 INFO    : There is nothing to migrate
2023-07-10 00:05:29.807648539  [2023-07-10 02:05:29] frigate.comms.mqtt             ERROR   : Unable to connect to MQTT server: MQTT Not authorized
2023-07-10 00:05:29.819549393  [2023-07-10 02:05:29] detector.cpu                   INFO    : Starting detection process: 299
2023-07-10 00:05:29.820095868  [2023-07-10 02:05:29] frigate.app                    INFO    : Output process started: 301
2023-07-10 00:05:29.822439000  [2023-07-10 02:05:29] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-07-10 00:05:29.827309857  [2023-07-10 02:05:29] frigate.app                    INFO    : Camera processor started for kantoor: 304
2023-07-10 00:05:29.832245267  [2023-07-10 02:05:29] frigate.app                    INFO    : Capture process started for kantoor: 306
2023-07-10 00:05:30.809740428  [2023-07-10 02:05:30] frigate.comms.mqtt             ERROR   : Unable to connect to MQTT server: MQTT Not authorized
2023-07-10 00:05:32.812970315  [2023-07-10 02:05:32] frigate.comms.mqtt             ERROR   : Unable to connect to MQTT server: MQTT Not authorized
2023-07-10 00:05:36.814625677  [2023-07-10 02:05:36] frigate.comms.mqtt             ERROR   : Unable to connect to MQTT server: MQTT Not authorized
2023-07-10 00:05:44.818275987  [2023-07-10 02:05:44] frigate.comms.mqtt             ERROR   : Unable to connect to MQTT server: MQTT Not authorized

so when i fill in username and password it doesnt even try to connect.
i also added enabled: true in it but still it doesnt even try to connect mqqt

anyone any idea how to fix this

Looking at the second log, the MQTT entries only show errors. There is no “Attempting to connect” style message.

Are you certain that the lack of MQTT entries in the first log isn’t just because everything is working and it doesn’t have anything to report? Have you checked the broker logs to see if it’s connecting?

What makes you think this is the case?

yes checked and no new entries

You might need to increase the log level then, there isn’t enough information in what you’ve posted to tell what is happening.

Possibly because neither of your configs are yaml. No indentation.

If MQTT is working properly there will be no log entries

s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service log-prepare: starting
s6-rc: info: service log-prepare successfully started
s6-rc: info: service nginx-log: starting
s6-rc: info: service go2rtc-log: starting
s6-rc: info: service frigate-log: starting
s6-rc: info: service go2rtc-log successfully started
s6-rc: info: service go2rtc: starting
s6-rc: info: service nginx-log successfully started
s6-rc: info: service frigate-log successfully started
s6-rc: info: service go2rtc successfully started
s6-rc: info: service go2rtc-healthcheck: starting
s6-rc: info: service frigate: starting
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service go2rtc-healthcheck successfully started
2023-07-10 13:49:38.473821412  [INFO] Preparing go2rtc config...
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
2023-07-10 13:49:38.477981597  [INFO] Starting NGINX...
2023-07-10 13:49:38.478170020  [INFO] Starting Frigate...
s6-rc: info: service legacy-services successfully started
2023-07-10 13:49:38.511028079  [INFO] Got IP address from supervisor: 192.168.1.45
2023-07-10 13:49:38.545703800  [INFO] Got WebRTC port from supervisor: 8555
2023-07-10 13:49:38.795220879  [INFO] Starting go2rtc...
2023-07-10 13:49:38.874159108  15:49:38.874 INF go2rtc version 1.2.0 linux/amd64
2023-07-10 13:49:38.874457303  15:49:38.874 INF [api] listen addr=:1984
2023-07-10 13:49:38.874749836  15:49:38.874 INF [rtsp] listen addr=:8554
2023-07-10 13:49:38.875206125  15:49:38.875 INF [srtp] listen addr=:8443
2023-07-10 13:49:38.875518086  15:49:38.875 INF [webrtc] listen addr=:8555
2023-07-10 13:49:39.384369416  2023/07/10 15:49:39 [error] 131#131: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.45, server: , request: "GET /api/stats HTTP/1.1", upstream: "http://127.0.0.1:5001/stats", host: "192.168.1.45:5000"
2023-07-10 13:49:39.384375348  192.168.1.45 - - [10/Jul/2023:15:49:39 +0200] "GET /api/stats HTTP/1.1" 502 157 "-" "HomeAssistant/2023.7.1 aiohttp/3.8.4 Python/3.11" "-"
2023-07-10 13:49:39.705323273  [2023-07-10 15:49:39] frigate.app                    INFO    : Starting Frigate (0.12.0-bc16ad1)
2023-07-10 13:49:39.743286588  [2023-07-10 15:49:39] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-07-10 13:49:39.745807053  [2023-07-10 15:49:39] peewee_migrate                 INFO    : Starting migrations
2023-07-10 13:49:39.749973780  [2023-07-10 15:49:39] peewee_migrate                 INFO    : There is nothing to migrate
2023-07-10 13:49:39.774211192  [2023-07-10 15:49:39] detector.cpu                   INFO    : Starting detection process: 300
2023-07-10 13:49:39.774848089  [2023-07-10 15:49:39] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-07-10 13:49:39.781204113  [2023-07-10 15:49:39] frigate.app                    INFO    : Output process started: 303
2023-07-10 13:49:39.789756208  [2023-07-10 15:49:39] frigate.app                    INFO    : Camera processor started for kantoor: 307
2023-07-10 13:49:39.795297954  [2023-07-10 15:49:39] frigate.app                    INFO    : Camera processor started for trap: 309
2023-07-10 13:49:39.799969423  [2023-07-10 15:49:39] detector.cpu2                  INFO    : Starting detection process: 302
2023-07-10 13:49:39.800287747  [2023-07-10 15:49:39] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-07-10 13:49:39.803192172  [2023-07-10 15:49:39] frigate.app                    INFO    : Camera processor started for gang: 311
2023-07-10 13:49:39.812089693  [2023-07-10 15:49:39] frigate.app                    INFO    : Camera processor started for buiten: 312
2023-07-10 13:49:39.817874156  [2023-07-10 15:49:39] frigate.app                    INFO    : Camera processor started for loods: 314
2023-07-10 13:49:39.823735838  [2023-07-10 15:49:39] frigate.app                    INFO    : Capture process started for kantoor: 316
2023-07-10 13:49:39.829707102  [2023-07-10 15:49:39] frigate.app                    INFO    : Capture process started for trap: 319
2023-07-10 13:49:39.835731106  [2023-07-10 15:49:39] frigate.app                    INFO    : Capture process started for gang: 322
2023-07-10 13:49:39.845940955  [2023-07-10 15:49:39] frigate.app                    INFO    : Capture process started for buiten: 326
2023-07-10 13:49:39.857993874  [2023-07-10 15:49:39] frigate.app                    INFO    : Capture process started for loods: 333
2023-07-10 13:49:47.685931810  192.168.1.45 - - [10/Jul/2023:15:49:47 +0200] "GET /api/stats HTTP/1.1" 200 3318 "-" "HomeAssistant/2023.7.1 aiohttp/3.8.4 Python/3.11" "-"
2023-07-10 13:49:48.478520822  [INFO] Starting go2rtc healthcheck service...
logger:
  # Optional: default log level (default: shown below)
  default: info
  # Optional: module by module log level configuration
  logs:
    frigate.mqtt: debug

mqtt:
  enabled: true
  host: 192.168.1.45
  topic_prefix: frigate  
  user: mqttuser
  password: mqttpass
2023-07-10 15:02:14: New connection from 172.30.32.1:43832 on port 1883.
2023-07-10 15:02:14: New client connected from 172.30.32.1:43832 as frigate (p2, c1, k60, u'mqttuser').
2023-07-10 15:02:24: New connection from 172.30.32.2:38264 on port 1883.
2023-07-10 15:02:24: Client <unknown> closed its connection.
2023-07-10 15:04:24: New connection from 172.30.32.2:60614 on port 1883.
2023-07-10 15:04:24: Client <unknown> closed its connection.
2023-07-10 15:06:24: New connection from 172.30.32.2:36880 on port 1883.
2023-07-10 15:06:24: Client <unknown> closed its connection.
2023-07-10 15:08:24: New connection from 172.30.32.2:42326 on port 1883.
2023-07-10 15:08:24: Client <unknown> closed its connection.
2023-07-10 15:08:56: Saving in-memory database to /data//mosquitto.db.
2023-07-10 15:10:24: New connection from 172.30.32.2:44174 on port 1883.
2023-07-10 15:10:24: Client <unknown> closed its connection.
2023-07-10 15:12:24: New connection from 172.30.32.2:37848 on port 1883.
2023-07-10 15:12:24: Client <unknown> closed its connection.
2023-07-10 15:14:24: New connection from 172.30.32.2:36120 on port 1883.
2023-07-10 15:14:24: Client <unknown> closed its connection.

that is wrong, on 0.12 it should be frigate.comms.mqtt

Do you have mqttuser and mqttpass properly defined as a homeassistant user.

This looks like a successful connection and login to me. The disconnections are all from a different address. Which address corresponds to your Frigate instance?

but he wont appear in my mqtt devices

thx. now it is debug logging.
And yes it say connected. but why i dont see the devices in mqtt

because that’s not how frigate works, you need the frigate integration

What @crzynik said and as I said before

1 Like

thx all

i can continue

hello, i have the same,
frigate connected to mqtt but no data form frigate

1 Like