[Config Support]: Unable to connect to MQTT server #17102
Describe the problem you are havingI am running mosquitto and frigate in docker containers. Frigate is unable to connect to mosquitto and I'm very lost on how to go about troubleshooting this. I did increase logging for frigate.coms and frigate.mqtt to debug but still nothing that pointed me in a direction of what is wrong. Version0.15.0-cea210d Frigate config filego2rtc:
streams:
driveway_cam:
- rtsp://wtbadmin:***@192.168.0.160:554/stream1 # stream which supports video & aac audio
- "ffmpeg:driveway_cam#audio=opus" # copy of the stream which transcodes audio to opus
logger:
default: info
logs:
frigate.mqtt: debug
frigate.comms: debug
mqtt:
enabled: true
host: mosquitto
port: 1883
topic_prefix: frigate
client_id: frigate
cameras:
driveway_cam: # <------ Name the camera
enabled: true
ffmpeg:
#output_args:
#- preset-record-generic-audio-aac [1, 7]
inputs:
- path: rtsp://wtbadmin:***@192.168.0.160:554/stream1 # <----- The stream you want to use for detection
roles:
- detect
- record
- audio
detect:
enabled: false # <---- disable detection until you have a working camera feed
width: 1280
height: 720
version: 0.15-1Relevant Frigate log output2025-03-11 14:11:22.032405372 [2025-03-11 14:11:22] frigate.comms.ws DEBUG : Publishing mqtt message from websockets at onConnect.
2025-03-11 14:11:22.032720837 [2025-03-11 14:11:22] frigate.comms.mqtt DEBUG : Unable to publish to camera_activity: client is not connected
2025-03-11 14:11:22.032917988 [2025-03-11 14:11:22] frigate.comms.mqtt DEBUG : Unable to publish to model_state: client is not connected
2025-03-11 14:11:22.033241619 [2025-03-11 14:11:22] frigate.comms.mqtt DEBUG : Unable to publish to embeddings_reindex_progress: client is not connected
2Relevant go2rtc log outputNoneFrigate statsNo response Operating systemDebian Install methodDocker Compose docker-compose file or Docker CLI command# version: "3.9"
services:
mosquitto:
image: eclipse-mosquitto:latest
container_name: mosquitto
ports:
- "1833:1833"
networks:
- frigate_network
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
stop_grace_period: 30s # allow enough time to shut down the various services
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "512mb" # update for your cameras based on calculation above
devices:
#- /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions
#- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
#- /dev/video11:/dev/video11 # For Raspberry Pi 4B
- /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- /frigate/config:/config
- /frigate/media:/media
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "8971:8971"
# - "5000:5000" # Internal unauthenticated access. Expose carefully.
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "password"
networks:
- frigate_network
depends_on:
- mosquitto
networks:
frigate_network:Object DetectorCPU (no coral) Screenshots of the Frigate UI's System metrics pagesNo response Any other information that may be helpfulNo response |
Replies: 2 comments 7 replies
|
Your port numbers are incorrect. You have this in your docker compose file: But in your Frigate config, you are specifying this: The standard port for mqtt is 1883, not 1833. But you could update one or the other - just keep it consistent. |
|
I just checked the mosquitto logs and I think I may see the problem:
Based on that I need to define a listener since mosquitto isn't really running on "this machine" Time to Google stuff! |
You'll want to look at the logs for the mosquitto container, then.
docker logs mosquittoSince you've put both containers on the same network, you should be able to address it with just the hostname in the frigate config, but you could also try the IP address. You'd need to get the internal IP address of the mosquitto container and use that.