[SUPPORT] blakeblackshear - Frigate


Recommended Posts

Hi, hoping for some help with my config! All seems to work, I have recording 24/7 and clips when it detects. Intel gpu is working and using cpu at the moment for object detection (Coral USB on order). I only want it to detect people which it does about half the time, which is disappointing and I get constant false positives! At night it doesn't detect anything at all, I can stand in front of the camera and wave, nothing! Will the Coral improve this? Camera is S3VC 5mp super HD. Here's my config, please let me know if anything could be changed? Thanks, Tim

mqtt:
  # Required: host name
  host: 192.168.xxx.xxx
  # Optional: port (default: shown below)
  port: 1883
  # Optional: topic prefix (default: shown below)
  # WARNING: must be unique if you are running multiple instances
  topic_prefix: frigate
  # Optional: client id (default: shown below)
  # WARNING: must be unique if you are running multiple instances
  client_id: frigate
  # Optional: user
  user: XXXXXXXXXX
  # Optional: password
  # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}.
  #       eg. password: '{FRIGATE_MQTT_PASSWORD}'
  password: XXXXXXXXXX
  # Optional: interval in seconds for publishing stats (default: shown below)
  stats_interval: 60
cameras:
  # Required: name of the camera
  garden:
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}
        - path: rtsp://XXXXX:[email protected]:554/stream1
          # Required: list of roles for this stream. valid values are: detect,record,clips,rtmp
          # NOTICE: In addition to assigning the record, clips, and rtmp roles,
          # they must also be enabled in the camera config.
          roles:
            - detect
            - record
        - path: rtsp://XXXXX:[email protected]:554/stream0
          roles:
            - clips
            - rtmp
    # Required: width of the frame for the input with the detect role
    width: 704
    # Required: height of the frame for the input with the detect role
    height: 576
    # Optional: desired fps for your camera for the input with the detect role
    # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
    #       Frigate will attempt to autodetect if not specified.
    fps: 5

    # Optional: camera level motion config
    motion:
      # Optional: motion mask
      # NOTE: see docs for more detailed info on creating masks
      mask: 446,370,428,576,0,576,0,296,232,259,255,359

    # Optional: timeout for highest scoring image before allowing it
    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60

    # Optional: zones for this camera
    zones:
      # Required: name of the zone
      # NOTE: This must be different than any camera names, but can match with another zone on another
      #       camera.
      path:
        # Required: List of x,y coordinates to define the polygon of the zone.
        # NOTE: Coordinates can be generated at https://www.image-map.net/
        coordinates: 545,1077,747,939,788,805
        # Optional: Zone level object filters.
        # NOTE: The global and camera filters are applied upstream.
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7

    # Optional: Camera level detect settings
    detect:
      # Optional: enables detection for the camera (default: True)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
      max_disappeared: 25

    # Optional: save clips configuration
    clips:
      # Required: enables clips for the camera (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: Number of seconds before the event to include in the clips (default: shown below)
      pre_capture: 10
      # Optional: Number of seconds after the event to include in the clips (default: shown below)
      post_capture: 10
      # Optional: Objects to save clips for. (default: all tracked objects)
      objects:
        - person
      # Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)
      required_zones: []
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 60
        # Optional: Per object retention days
        objects:
          person: 90

    # Optional: 24/7 recording configuration
    record:
      # Optional: Enable recording (default: global setting)
      enabled: True
      # Optional: Number of days to retain (default: global setting)
      retain_days: 30

    # Optional: RTMP re-stream configuration
    rtmp:
      # Required: Enable the live stream (default: True)
      enabled: True

    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: False
      # Optional: crop the snapshot (default: shown below)
      crop: False
      # Optional: height to resize the snapshot to (default: original size)
      height: 175
      # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
      required_zones: []
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 10
        # Optional: Per object retention days
        objects:
          person: 15

    # Optional: Configuration for the jpg snapshots published via MQTT
    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: True
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: True
      # Optional: height to resize the snapshot to (default: shown below)
      height: 270
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []

    # Optional: Camera level object filters config.
    objects:
      track:
        - person
      # Optional: mask to prevent all object types from being detected in certain areas (default: no mask)
      # Checks based on the bottom center of the bounding box of the object.
      # NOTE: This mask is COMBINED with the object type specific mask below
      mask: 0,0,1000,0,1000,200,0,200
      filters:
        person:
          min_area: 5000
          max_area: 100000
          min_score: 0.5
          threshold: 0.7
          # Optional: mask to prevent this object type from being detected in certain areas (default: no mask)
          # Checks based on the bottom center of the bounding box of the object
          mask: 0,295,234,258,251,359,454,373,434,576,0,576
detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu
clips:
  # Optional: Maximum length of time to retain video during long events. (default: shown below)
  # NOTE: If an object is being tracked for longer than this amount of time, the cache
  #       will begin to expire and the resulting clip will be the last x seconds of the event.
  max_seconds: 600
  # Optional: Retention settings for clips (default: shown below)
  retain:
    # Required: Default retention days (default: shown below)
    default: 60
    # Optional: Per object retention days
    objects:
      person: 90
ffmpeg:
  # Optional: global ffmpeg args (default: shown below)
  global_args: -hide_banner -loglevel warning
  # Optional: global hwaccel args (default: shown below)
  # NOTE: See hardware acceleration docs for your specific device
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
  # Optional: global input args (default: shown below)
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
  # Optional: global output args
  output_args:
    # Optional: output args for detect streams (default: shown below)
    detect: -f rawvideo -pix_fmt yuv420p
    # Optional: output args for record streams (default: shown below)
    record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    # Optional: output args for clips streams (default: shown below)
    clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    # Optional: output args for rtmp streams (default: shown below)
    rtmp: -c copy -f flv
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
  # Optional: filters to reduce false positives for specific object types
  filters:
    person:
      # Optional: minimum width*height of the bounding box for the detected object (default: 0)
      min_area: 5000
      # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
      max_area: 100000
      # Optional: minimum score for the object to initiate tracking (default: shown below)
      min_score: 0.5
      # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
      threshold: 0.7

 

Link to comment
  • 2 weeks later...
On 5/15/2021 at 7:13 PM, MothyTim said:

Hi, hoping for some help with my config! All seems to work, I have recording 24/7 and clips when it detects. Intel gpu is working and using cpu at the moment for object detection (Coral USB on order). I only want it to detect people which it does about half the time, which is disappointing and I get constant false positives! At night it doesn't detect anything at all, I can stand in front of the camera and wave, nothing! Will the Coral improve this? Camera is S3VC 5mp super HD. Here's my config, please let me know if anything could be changed? Thanks, Tim


mqtt:
  # Required: host name
  host: 192.168.xxx.xxx
  # Optional: port (default: shown below)
  port: 1883
  # Optional: topic prefix (default: shown below)
  # WARNING: must be unique if you are running multiple instances
  topic_prefix: frigate
  # Optional: client id (default: shown below)
  # WARNING: must be unique if you are running multiple instances
  client_id: frigate
  # Optional: user
  user: XXXXXXXXXX
  # Optional: password
  # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}.
  #       eg. password: '{FRIGATE_MQTT_PASSWORD}'
  password: XXXXXXXXXX
  # Optional: interval in seconds for publishing stats (default: shown below)
  stats_interval: 60
cameras:
  # Required: name of the camera
  garden:
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}
        - path: rtsp://XXXXX:[email protected]:554/stream1
          # Required: list of roles for this stream. valid values are: detect,record,clips,rtmp
          # NOTICE: In addition to assigning the record, clips, and rtmp roles,
          # they must also be enabled in the camera config.
          roles:
            - detect
            - record
        - path: rtsp://XXXXX:[email protected]:554/stream0
          roles:
            - clips
            - rtmp
    # Required: width of the frame for the input with the detect role
    width: 704
    # Required: height of the frame for the input with the detect role
    height: 576
    # Optional: desired fps for your camera for the input with the detect role
    # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
    #       Frigate will attempt to autodetect if not specified.
    fps: 5

    # Optional: camera level motion config
    motion:
      # Optional: motion mask
      # NOTE: see docs for more detailed info on creating masks
      mask: 446,370,428,576,0,576,0,296,232,259,255,359

    # Optional: timeout for highest scoring image before allowing it
    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60

    # Optional: zones for this camera
    zones:
      # Required: name of the zone
      # NOTE: This must be different than any camera names, but can match with another zone on another
      #       camera.
      path:
        # Required: List of x,y coordinates to define the polygon of the zone.
        # NOTE: Coordinates can be generated at https://www.image-map.net/
        coordinates: 545,1077,747,939,788,805
        # Optional: Zone level object filters.
        # NOTE: The global and camera filters are applied upstream.
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7

    # Optional: Camera level detect settings
    detect:
      # Optional: enables detection for the camera (default: True)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
      max_disappeared: 25

    # Optional: save clips configuration
    clips:
      # Required: enables clips for the camera (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: Number of seconds before the event to include in the clips (default: shown below)
      pre_capture: 10
      # Optional: Number of seconds after the event to include in the clips (default: shown below)
      post_capture: 10
      # Optional: Objects to save clips for. (default: all tracked objects)
      objects:
        - person
      # Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)
      required_zones: []
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 60
        # Optional: Per object retention days
        objects:
          person: 90

    # Optional: 24/7 recording configuration
    record:
      # Optional: Enable recording (default: global setting)
      enabled: True
      # Optional: Number of days to retain (default: global setting)
      retain_days: 30

    # Optional: RTMP re-stream configuration
    rtmp:
      # Required: Enable the live stream (default: True)
      enabled: True

    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: False
      # Optional: crop the snapshot (default: shown below)
      crop: False
      # Optional: height to resize the snapshot to (default: original size)
      height: 175
      # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
      required_zones: []
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 10
        # Optional: Per object retention days
        objects:
          person: 15

    # Optional: Configuration for the jpg snapshots published via MQTT
    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: True
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: True
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: True
      # Optional: height to resize the snapshot to (default: shown below)
      height: 270
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []

    # Optional: Camera level object filters config.
    objects:
      track:
        - person
      # Optional: mask to prevent all object types from being detected in certain areas (default: no mask)
      # Checks based on the bottom center of the bounding box of the object.
      # NOTE: This mask is COMBINED with the object type specific mask below
      mask: 0,0,1000,0,1000,200,0,200
      filters:
        person:
          min_area: 5000
          max_area: 100000
          min_score: 0.5
          threshold: 0.7
          # Optional: mask to prevent this object type from being detected in certain areas (default: no mask)
          # Checks based on the bottom center of the bounding box of the object
          mask: 0,295,234,258,251,359,454,373,434,576,0,576
detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu
clips:
  # Optional: Maximum length of time to retain video during long events. (default: shown below)
  # NOTE: If an object is being tracked for longer than this amount of time, the cache
  #       will begin to expire and the resulting clip will be the last x seconds of the event.
  max_seconds: 600
  # Optional: Retention settings for clips (default: shown below)
  retain:
    # Required: Default retention days (default: shown below)
    default: 60
    # Optional: Per object retention days
    objects:
      person: 90
ffmpeg:
  # Optional: global ffmpeg args (default: shown below)
  global_args: -hide_banner -loglevel warning
  # Optional: global hwaccel args (default: shown below)
  # NOTE: See hardware acceleration docs for your specific device
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
  # Optional: global input args (default: shown below)
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
  # Optional: global output args
  output_args:
    # Optional: output args for detect streams (default: shown below)
    detect: -f rawvideo -pix_fmt yuv420p
    # Optional: output args for record streams (default: shown below)
    record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    # Optional: output args for clips streams (default: shown below)
    clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    # Optional: output args for rtmp streams (default: shown below)
    rtmp: -c copy -f flv
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
  # Optional: filters to reduce false positives for specific object types
  filters:
    person:
      # Optional: minimum width*height of the bounding box for the detected object (default: 0)
      min_area: 5000
      # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
      max_area: 100000
      # Optional: minimum score for the object to initiate tracking (default: shown below)
      min_score: 0.5
      # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
      threshold: 0.7

 

You have to tinker with these values:

 

https://blakeblackshear.github.io/frigate/configuration/false_positives

 

Night detection is still not as good as daylight. Also, false positives at night are being investigated:

 

https://github.com/blakeblackshear/frigate/issues/67

  • Thanks 1
Link to comment
35 minutes ago, yayitazale said:

Rebooting the server does not make my container disappear, and a crash it just stops it...

When I don't use the nvidia hardware decode, you are right, the docker will stop when it crashes and won't disappear after a reboot.

 

However, with the nvidia integration, any crash will delete the docker. Even stopping the docker or rebooting the server will delete the docker.

  • Like 1
Link to comment
16 minutes ago, mathgoy said:

When I don't use the nvidia hardware decode, you are right, the docker will stop when it crashes and won't disappear after a reboot.

 

However, with the nvidia integration, any crash will delete the docker. Even stopping the docker or rebooting the server will delete the docker.

Pushed a change to the template, I hope this will fix it

  • Like 1
Link to comment
  • 2 weeks later...
On 4/24/2021 at 8:34 PM, yayitazale said:

1) To use  the M.2 coral you need to install the "Coral Accelerator Module Drivers" plugin and then edit this:

 

imagen.thumb.png.b39952c9f00430fb1a9a411ecba2287d.png

to this:

imagen.thumb.png.1880e57d3097955fed858412df5245fc.png

 

 

On 4/26/2021 at 5:39 AM, Brian H. said:

 

I'm not sure exactly what worked but, this detectors config is working for me now:


detectors:
  coral:
    type: edgetpu
    device: pci

 

 

 

I recently got the mini PCIe Coral. Not knowing it was any different than PCIe. Then the adapter and started searching on how to get it working.

 

I registered on the forum to say thanks & post so others searching may find this. I used a combination of the methods posted by @yayitazale & @Brian H. above and it is now working. Thanks :)

  • Like 2
Link to comment

Hello. Thanks for your work on the template.

Frigate (FFMPEG) is killing my CPU for motion detection (I have a coral for object recognition). I'm struggling to enable FFmpeg Hardware Acceleration. I'm running unraid on a E3-1270 V2 (no GPU) so I tried this:

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

..but I get 'Execution Error: Server Error' when I try to start it.

If I remove the '/dev/dri/renderD128' parameter from the container config, it will start but then in the logs:

[AVHWDeviceContext @ 0x560ea5803e80] No VA display found for device /dev/dri/renderD128.
[h264 @ 0x560ea57fd640] No device available for decoder: device type vaapi needed for codec h264.

What am I misunderstanding?!

Edited by PlayerOne
inserted actual errors
Link to comment
On 6/10/2021 at 5:49 PM, PlayerOne said:

Hello. Thanks for your work on the template.

Frigate (FFMPEG) is killing my CPU for motion detection (I have a coral for object recognition). I'm struggling to enable FFmpeg Hardware Acceleration. I'm running unraid on a E3-1270 V2 (no GPU) so I tried this:


ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p

..but I get 'Execution Error: Server Error' when I try to start it.

If I remove the '/dev/dri/renderD128' parameter from the container config, it will start but then in the logs:


[AVHWDeviceContext @ 0x560ea5803e80] No VA display found for device /dev/dri/renderD128.
[h264 @ 0x560ea57fd640] No device available for decoder: device type vaapi needed for codec h264.

What am I misunderstanding?!

This is the configr that I'm using:


 

ffmpeg:

  # Optional: global ffmpeg args (default: shown below)

  global_args: -hide_banner -loglevel warning

  # Optional: global hwaccel args (default: shown below)

  # NOTE: See hardware acceleration docs for your specific device

  hwaccel_args:

    - -hwaccel

    - qsv

    - -qsv_device

    - /dev/dri/renderD128

  # Optional: global input args (default: shown below)

  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1     

  # Optional: global output args

  output_args:

    # Optional: output args for detect streams (default: shown below)

    detect: -f rawvideo -pix_fmt yuv420p

    # Optional: output args for record streams (default: shown below)

    record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an

    # Optional: output args for clips streams (default: shown below)

    clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an

    # Optional: output args for rtmp streams (default: shown below)

    rtmp: -c copy -f flv

 

Link to comment

Hey folks - I'm trying to get Frigate setup with a Google Coral USB stick. Everything on the setup has gone well, except that the USB device is behaving strange. It appears to be connecting/disconnecting repeatedly. And it's awfully warm to the touch when it's not in use. It doesn't look like it's actually being used to detect anything, either.

 

To make sure it's not an issue with the Coral, I've plugged the USB device into a Windows based system and have confirmed that it (1) doesn't get warm at idle and (2) works correctly following the Google getting started instructions.

When trying to use the device on my Unraid box, I get these repeated errors in the log:

...
Jun 9 00:02:39 lenny kernel: usb 4-2: LPM exit latency is zeroed, disabling LPM.
Jun 9 00:03:29 lenny kernel: usb 4-2: reset SuperSpeed Gen 1 USB device number 3 using xhci_hcd
Jun 9 00:03:29 lenny kernel: usb 4-2: LPM exit latency is zeroed, disabling LPM.
Jun 9 00:04:19 lenny kernel: usb 4-2: reset SuperSpeed Gen 1 USB device number 3 using xhci_hcd
...

 

And in Frigate, I get a corresponding set of repeated errors around the same time:

...
detector.coral INFO : Starting detection process: 126
frigate.edgetpu INFO : Attempting to load TPU as usb
frigate.edgetpu INFO : TPU found
frigate.watchdog INFO : Detection appears to be stuck. Restarting detection process...
root INFO : Waiting for detection process to exit gracefully...
root INFO : Detection process didnt exit. Force killing...
detector.coral INFO : Starting detection process: 136
frigate.edgetpu INFO : Attempting to load TPU as usb
frigate.edgetpu INFO : TPU found
frigate.watchdog INFO : Detection appears to be stuck. Restarting detection process...
root INFO : Waiting for detection process to exit gracefully...
frigate.watchdog INFO : Detection appears to be stuck. Restarting detection process...
root INFO : Waiting for detection process to exit gracefully...
root INFO : Detection process didnt exit. Force killing...
detector.coral INFO : Starting detection process: 146
...

 

This feels more like an OS, USB, hardware issue than something specific to Frigate... can anyone help point me in the right direction to diagnose this? Thanks in advance.

Link to comment
16 hours ago, kmwoley said:

Hey folks - I'm trying to get Frigate setup with a Google Coral USB stick. Everything on the setup has gone well, except that the USB device is behaving strange. It appears to be connecting/disconnecting repeatedly. And it's awfully warm to the touch when it's not in use. It doesn't look like it's actually being used to detect anything, either.

 

To make sure it's not an issue with the Coral, I've plugged the USB device into a Windows based system and have confirmed that it (1) doesn't get warm at idle and (2) works correctly following the Google getting started instructions.

When trying to use the device on my Unraid box, I get these repeated errors in the log:




...
Jun 9 00:02:39 lenny kernel: usb 4-2: LPM exit latency is zeroed, disabling LPM.
Jun 9 00:03:29 lenny kernel: usb 4-2: reset SuperSpeed Gen 1 USB device number 3 using xhci_hcd
Jun 9 00:03:29 lenny kernel: usb 4-2: LPM exit latency is zeroed, disabling LPM.
Jun 9 00:04:19 lenny kernel: usb 4-2: reset SuperSpeed Gen 1 USB device number 3 using xhci_hcd
...

 

And in Frigate, I get a corresponding set of repeated errors around the same time:




...
detector.coral INFO : Starting detection process: 126
frigate.edgetpu INFO : Attempting to load TPU as usb
frigate.edgetpu INFO : TPU found
frigate.watchdog INFO : Detection appears to be stuck. Restarting detection process...
root INFO : Waiting for detection process to exit gracefully...
root INFO : Detection process didnt exit. Force killing...
detector.coral INFO : Starting detection process: 136
frigate.edgetpu INFO : Attempting to load TPU as usb
frigate.edgetpu INFO : TPU found
frigate.watchdog INFO : Detection appears to be stuck. Restarting detection process...
root INFO : Waiting for detection process to exit gracefully...
frigate.watchdog INFO : Detection appears to be stuck. Restarting detection process...
root INFO : Waiting for detection process to exit gracefully...
root INFO : Detection process didnt exit. Force killing...
detector.coral INFO : Starting detection process: 146
...

 

This feels more like an OS, USB, hardware issue than something specific to Frigate... can anyone help point me in the right direction to diagnose this? Thanks in advance.

 

Not sure about what is happening, I'm using frigate with usb coral from 1 Year now and I never got that error.

 

Are you mapping any usb Port to another container or VM?

Are you using a native 3.0 USB? Maybe is related to a lack of power?

Edited by yayitazale
Link to comment
11 hours ago, yayitazale said:

 

Not dure about whst is happening, I'm using frigate with usb coral from 1 Year now and I never got that error.

 

Are you mapping any usb Port to another container or VM?

Are you using a native 3.0 USB? Maybe is related to a lack of power?

 

My box has 3 USB devices - the USB stick for the OS, a zwave stick, and the Coral. The Coral is on the USB 3 hub. The other two devices are on a USB 2 hub. Interesting theory that it could be lack of power; my motherboard is very, very old and it wouldn't surprise me if there's some quirk there.

 

My USB Coral is mapped via the default settings:
/dev/bus/usb -> /dev/bus/usb

 

My USB zwave stick is mapped in another container to the specific device:

/dev/ttyACM0 -> /dev/ttyACM0

 

Any issue with those settings?

Link to comment
3 hours ago, kmwoley said:

 

My box has 3 USB devices - the USB stick for the OS, a zwave stick, and the Coral. The Coral is on the USB 3 hub. The other two devices are on a USB 2 hub. Interesting theory that it could be lack of power; my motherboard is very, very old and it wouldn't surprise me if there's some quirk there.

 

My USB Coral is mapped via the default settings:
/dev/bus/usb -> /dev/bus/usb

 

My USB zwave stick is mapped in another container to the specific device:

/dev/ttyACM0 -> /dev/ttyACM0

 

Any issue with those settings?

You can try to map the specific usb to frigate too to be sure that there is no compatibility issues but you almost have the same config as mine, the only difference is that in my case I have a zigbee usb istead of zwave.

 

Are you using the original cable that comes with the coral?

Edited by yayitazale
Link to comment
4 hours ago, yayitazale said:

You can try to map the specific usb to frigate too to be sure that there is no compatibility issues...

 

Are you using the original cable that comes with the coral?

 

Yes, I'm using the original cable that came with the coral.

 

How are you mapping the specific USB?

$lsusb
...
Bus 004 Device 002: ID 1a6e:089a Global Unichip Corp. 
...

 

In my case, would I map /dev/bus/usb/004/002 ?

 

I don't know how to find, or cannot find, a specific /dev/tty* device for the coral.

 

 

Link to comment
15 hours ago, kmwoley said:

 

Yes, I'm using the original cable that came with the coral.

 

How are you mapping the specific USB?


$lsusb
...
Bus 004 Device 002: ID 1a6e:089a Global Unichip Corp. 
...

 

In my case, would I map /dev/bus/usb/004/002 ?

 

I don't know how to find, or cannot find, a specific /dev/tty* device for the coral.

 

 

Yes, map it as /dev/bus/usb/004/002:/dev/bus/usb/004/002

 

Anyway, note that rebooting the system or disconnecting the USB will cause a change in the mapping, so this is for debugging purposes only. The application should work correctly with the assignment of /dev/bus/usb

Link to comment
On 6/17/2021 at 8:46 AM, yayitazale said:

Yes, map it as /dev/bus/usb/004/002:/dev/bus/usb/004/002

 

Anyway, note that rebooting the system or disconnecting the USB will cause a change in the mapping, so this is for debugging purposes only. The application should work correctly with the assignment of /dev/bus/usb

 

Thanks for the help on this, but I didn't find a solution that worked. The closest I came was by trying an external, powered USB hub. I actually saw the TPU do some detection in Frigate for a moment... only to stop working shortly thereafter. I think I might have a defective device so I'm going to return it. :/

  • Like 1
Link to comment

I'm sorry to heard that.

On 6/20/2021 at 5:59 AM, kmwoley said:

 

Thanks for the help on this, but I didn't find a solution that worked. The closest I came was by trying an external, powered USB hub. I actually saw the TPU do some detection in Frigate for a moment... only to stop working shortly thereafter. I think I might have a defective device so I'm going to return it. :/

 

Edited by yayitazale
Link to comment
  • 2 weeks later...
13 hours ago, digiblur said:

Side note...others might want to check but I saw something weird.  I was helping someone and saw there was no /media/frigate mapping in the default container and it was dropping the database file in the container.  Not a good thing so definitely check yours.

I updated the two templates to map the complete media folder, not just the media/clips and media/recordings

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.