blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
19.2k stars 1.76k forks source link

[Support]: frigate.comms.mqtt error #8615

Closed zachlovescoffee closed 1 year ago

zachlovescoffee commented 1 year ago

Describe the problem you are having

I keep getting these errors in my Frigate log and I'm not sure what's causing them. I've read the numerous related help strings on this but I cannot detect an answer that works for me.

The camera in question is on a VLAN but it seems to be accessible to/from the local network. Frigate is detecting, capturing and recording videos.

Version

0.12.0

Frigate config file

mqtt:
  enabled: true
  host: xxx
  port: 1883

go2rtc:
  streams:
    back:
      - rtsp://admin:pwd@xxx:554/h264Preview_01_main

logger:
   default: info
   logs:
     frigate.comms.mqtt: debug

detectors:
  coral:
    type: edgetpu
    device: usb

record:
  enabled: True
  events:
    pre_capture: 5
    post_capture: 5
    objects:
      - person
      - dog
      - cat
      - car
      - bicycle
      - motorcycle
      - bus
      - boat
    retain:
      default: 10

ffmpeg:
  hwaccel_args: preset-nvidia-h264

cameras:
  doorbell:
    ffmpeg:
      inputs:
        - path: rtsp://admin:pwd@xxx:554/h264Preview_01_sub # <----- detection
          roles:
            - detect
        - path: rtsp://admin:pwd@xxx:554/h264Preview_01_main # <---- record
          roles:
            - record
      output_args:
        record: preset-record-generic-audio-aac

    detect:
      enabled: true
      width: 640
      height: 480
      fps: 5

motion:
      mask:
      - 0,0,640,0,640,227,426,239,0,227

Relevant log output

2023-11-14 09:59:52.223923522  [INFO] Starting Frigate...
2023-11-14 09:59:52.901530564  [2023-11-14 09:59:52] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-11-14 09:59:52.911766385  [2023-11-14 09:59:52] peewee_migrate                 INFO    : Starting migrations
2023-11-14 09:59:52.917908461  [2023-11-14 09:59:52] peewee_migrate                 INFO    : There is nothing to migrate
2023-11-14 09:59:52.933174148  [2023-11-14 09:59:52] detector.coral                 INFO    : Starting detection process: 363
2023-11-14 09:59:55.573510227  [2023-11-14 09:59:52] frigate.app                    INFO    : Output process started: 365
2023-11-14 09:59:55.579723896  [2023-11-14 09:59:52] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-11-14 09:59:55.579842746  [2023-11-14 09:59:55] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-11-14 09:59:55.579947296  [2023-11-14 09:59:52] frigate.app                    INFO    : Camera processor started for doorbell: 369
2023-11-14 09:59:55.579993974  [2023-11-14 09:59:52] frigate.app                    INFO    : Capture process started for doorbell: 372
2023-11-14 09:59:56.219577917  [2023-11-14 09:59:56] frigate.comms.mqtt             ERROR   : Unable to publish to doorbell/all: client is not connected
2023-11-14 10:01:06.329377360  [2023-11-14 10:01:06] frigate.comms.mqtt             ERROR   : Unable to publish to stats: client is not connected

FFprobe output from your camera

# ffprobe rtsp:admin:pwd@xxx:554
ffprobe version n5.1-2-g915ef932a3-20220731 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-ffbuild-linux-gnu- --arch=x86_64 --target-os=linux --enable-gpl --enable-version3 --disable-debug --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libpulse --enable-libvmaf --enable-libxcb --enable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-mbedtls --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --disable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags=-pie --extra-libs='-ldl -lgomp' --extra-version=20220731
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, rtsp, from 'rtsp:admin:pwd@xxx:554':
  Metadata:
    title           : Session streamed by "preview"
  Duration: N/A, start: 0.000313, bitrate: N/A
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 2560x1920, 20 fps, 20 tbr, 90k tbn
  Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp

Frigate stats

<?xml version="1.0"?>
<Container version="2">
  <Name>frigate</Name>
  <Repository>ghcr.io/blakeblackshear/frigate:stable</Repository>
  <Registry>https://hub.docker.com/r/blakeblackshear/frigate/</Registry>
  <Network>bridge</Network>
  <MyIP/>
  <Shell>sh</Shell>
  <Privileged>false</Privileged>
  <Support>https://forums.unraid.net/topic/98064-support-blakeblackshear-frigate/</Support>
  <Project>https://frigate.video/</Project>
  <Overview>A complete and local NVR designed for Home Assistant with AI object detection. Uses OpenCV and Tensorflow to perform realtime object detection locally for IP cameras.&#xD;
&#xD;
You cas use a integrated or dedicated GPU (Intel/AMD/Nvidia) to perform the image decoding of the input streams of your cameras.&#xD;
&#xD;
Optionally (but highly recommended), you can use multiple devices to perform the object detetion, such as a Google Coral Accelerator Nvidia GPU, OpenVINO (Intel GPU) and Intel NCS2 VPU&#xD;
&#xD;
See the documentation for more details about your specific hardware and needs (https://docs.frigate.video/). This is a general templeate that aims to give a fast deoplyment for every user so check all the options carefully and remove all the configurations that you are not going to use.</Overview>
  <Category>HomeAutomation: Security:</Category>
  <WebUI>http://[IP]:[PORT:5000]</WebUI>
  <TemplateURL>https://gitlab.com/yayitazale/unraid-templates/-/raw/main/yayitazale/frigate.xml</TemplateURL>
  <Icon>https://raw.githubusercontent.com/yayitazale/unraid-templates/main/frigate.png</Icon>
  <ExtraParams>--shm-size=256mb --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 --restart unless-stopped --gpus=all</ExtraParams>
  <PostArgs/>
  <CPUset/>
  <DateInstalled>1699970673</DateInstalled>
  <DonateText>If you like my work please consider Donating.</DonateText>
  <DonateLink>https://paypal.me/JosebaEgiaLarrinaga</DonateLink>
  <Requires>&amp;lt;br&amp;gt;- A valid config.yml file must exist in the config directory to startup the container.&amp;lt;br&amp;gt;- If you are using a Coral Detector, you must set the container to privileged mode under advanced view&amp;lt;br&amp;gt;- If you are using a PCI Coral instead of a USB one, you must install first the needed drivers going to the CA app and searching for Coral-Driver (thanks to @ich777)&amp;lt;br&amp;gt;- If you want to use a NVidia card to image decoding and/or detection, you must first install the drivers from CA app (thanks to @ich777), add &amp;amp;quot;--runtime=nvidia&amp;amp;quot; as extra parameter under advanced view and set the &amp;amp;quot;Nvidia Visible Devices&amp;amp;quot; variable with your &amp;amp;quot;GPU UUID&amp;amp;quot; as the value.&amp;lt;br&amp;gt;- If you want to use the NVidia TensorRT Detector, you have to create the models using the &amp;amp;quot;tensorrt-models&amp;amp;quot; app from the CA app and select the correspondig branch.&amp;lt;br&amp;gt;- If you want to use a AMD GPU to image decoding you must change driver to &amp;amp;quot;radeonsi&amp;amp;quot;&amp;lt;br&amp;gt;- With some of the Intel processors, like the J4125, the default driver &amp;amp;quot;iHD&amp;amp;quot; doesn't seem to work correctly for hardware acceleration. You may need to change the driver to &amp;amp;quot;i965&amp;amp;quot;&amp;lt;br&amp;gt;- If you want to use a NCS2 as detector you have to add &amp;amp;quot;--device-cgroup-rule='c 189:\* rmw'&amp;amp;quot; as extra parameter under advanced view and install the &amp;amp;quot;udev rule&amp;amp;quot; in the unraid host.</Requires>
  <Config Name="Config Path" Target="/config" Default="/mnt/cache/appdata/frigate" Mode="rw" Description="" Type="Path" Display="always" Required="true" Mask="false">/mnt/cache/appdata/frigate</Config>
  <Config Name="Media path" Target="/media/frigate" Default="" Mode="rw" Description="" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/Media/frigate</Config>
  <Config Name="HTTP port" Target="5000" Default="" Mode="tcp" Description="" Type="Port" Display="always" Required="true" Mask="false">5000</Config>
  <Config Name="RTSP port" Target="8554" Default="" Mode="tcp" Description="" Type="Port" Display="always" Required="true" Mask="false">8554</Config>
  <Config Name="Frigate RTSP Password" Target="FRIGATE_RTSP_PASSWORD" Default="" Mode="" Description="" Type="Variable" Display="always" Required="true" Mask="false">enterpassword</Config>
  <Config Name="Frigate+ API key" Target="PLUS_API_KEY" Default="" Mode="" Description="Optional: Enter the frigate+ API key or remove this if you are not using it" Type="Variable" Display="always" Required="false" Mask="false"/>
  <Config Name="Coral TPU/NCS2 Mapping" Target="/dev/bus/usb" Default="" Mode="" Description="Use /dev/bus/usb for USB devices and /dev/apex_0 for PCIe devices (you must install the drivers first for PCIe devices). Remove this if you are not using it." Type="Device" Display="always" Required="false" Mask="false">/dev/bus/usb</Config>
  <Config Name="Nvidia Visible Devices" Target="NVIDIA_VISIBLE_DEVICES" Default="" Mode="" Description="This info can be found in the NVidia driver plugin.. Only for Nvidia GPU decoding and/or detection. Remove this if you are not using it." Type="Variable" Display="always" Required="false" Mask="false">GPU-eaxxxxx-xxxx-xxxx-xxxx-xxxxxxxx6a1</Config>
  <Config Name="Nvidia Driver Capabilities" Target="NVIDIA_DRIVER_CAPABILITIES" Default="" Mode="" Description="Only for Nvidia GPU decoding and/or detection. Remove this if you are not using it." Type="Variable" Display="always" Required="false" Mask="false">compute,utility,video</Config>
  <Config Name="TRT-Models path" Target="/trt-models" Default="" Mode="ro" Description="Only for TensorRT, remove this if you are not using it" Type="Path" Display="always" Required="false" Mask="false">/mnt/user/appdata/trt-models</Config>
  <Config Name="go2rtc TCP port" Target="8555" Default="" Mode="tcp" Description="If you are not going to use MSE/WebRCT you can remove all the WebRTC entrys" Type="Port" Display="always" Required="false" Mask="false">8555</Config>
  <Config Name="go2rtc UDP port" Target="8555" Default="" Mode="udp" Description="If you are not going to use MSE/WebRCT you can remove all the WebRTC entrys" Type="Port" Display="always" Required="false" Mask="false">8555</Config>
  <Config Name="go2rtc server port" Target="1984" Default="" Mode="tcp" Description="For Home Assistant WebRTC integration. Remove this if you are not using it." Type="Port" Display="always" Required="false" Mask="false">1984</Config>
  <Config Name="Localtime" Target="/etc/localtime" Default="" Mode="rw" Description="" Type="Path" Display="advanced-hide" Required="true" Mask="false">/etc/localtime</Config>
</Container>

Operating system

UNRAID

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Reolink PoE Doorbell

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

mqtt is not setup correctly, presumably because frigate is not able to reach the mqtt host. It would be good to know what is configured there

zachlovescoffee commented 1 year ago

What is 'mqtt'? I don't see anything about it in the Community App configuration. Is there a way to poke it to get more info? I tried going to 192.168.xx.xxx:1883 and there is nothing returned in a browser or ping.

NickM-27 commented 1 year ago

mqtt is a communication protocol that allows different IoT services and devices to talk to each other. In Frigate's case it allows frigate and the home assistant frigate integration to communicate.

If you have not setup an mqtt broker then that would explain the error

zachlovescoffee commented 1 year ago

oooh! so if I set up Home Assist and pipe frigate and its cameras to Home Assist then that error might go away?

NickM-27 commented 1 year ago

if you are not using home assistant then there's no requirement to and you should just disable mqtt.

zachlovescoffee commented 1 year ago

I want to use Home Assist to complement / replace HomeKit. Until I get it up and running, how does one disable mqtt?

NickM-27 commented 1 year ago
mqtt:
  enabled: false
zachlovescoffee commented 1 year ago

(face palm). Thank you! Awesome work with Frigate. It's going to power 6-8 cameras at my home so so far it's only sipping CPU cycles.