Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frigate does not recognize after a couple of hours the Coral USB device #1098

Closed
mi4mac opened this issue May 14, 2021 · 3 comments
Closed

Comments

@mi4mac
Copy link

mi4mac commented May 14, 2021

Describe the bug
After a couple of hours Frigate seams to restart and does not recognize the Coral USB device anymore. After performing a reboot of the Rassberry Pi4 with Home Assistant installed everything is working fine again. A normal reboot of the Home Assistant Server is not helping you have to reboot the host.

Version of frigate
0.8.4 (1.13)

Config file
Include your full config file wrapped in triple back ticks.

  coral:
    type: edgetpu
    device: usb
mqtt:
  # Required: host name
  host: 192.168.222.202
  # 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: admin
  # Optional: password
  # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}.
  #       eg. password: '{FRIGATE_MQTT_PASSWORD}'
  password: password
  # Optional: interval in seconds for publishing stats (default: shown below)
  stats_interval: 60
cameras:
  # Name of your camera
  Cam3:
    ffmpeg:
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
      inputs:
        - path: rtsp://admin:password@192.168.222.212:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
        - path: rtsp://admin:password@192.168.222.212:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips
            - rtmp
    objects:
      track:
        - person
        # 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: 5
      # Optional: Number of seconds after the event to include in the clips (default: shown below)
      post_capture: 5
      # 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: 10
        # Optional: Per object retention days
        objects:
          person: 15
        # 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
    rtmp:
      # Required: Enable the live stream (default: True)
      enabled: True
    width: 640
    height: 480
    fps: 5
  Cam1:
    ffmpeg:
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
      inputs:
        - path: rtsp://admin:password@192.168.222.210:88/videoSub
          roles:
            - detect
        - path: rtsp://admin:password@192.168.222.210:88/videoMain
          roles:
            - clips
            - rtmp
    objects:
      track:
        - person
        # 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: 5
      # Optional: Number of seconds after the event to include in the clips (default: shown below)
      post_capture: 5
      # 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: 10
        # Optional: Per object retention days
        objects:
          person: 15
        # 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
    rtmp:
      # Required: Enable the live stream (default: True)
      enabled: True
    width: 640
    height: 480
    fps: 5
  Cam4:
    ffmpeg:
      hwaccel_args:
        - -c:v
        - h264_v4l2m2m
      inputs:
        - path: rtsp://admin:password@192.168.222.213/cam/realmonitor?channel=1&subtype=1&authBasic=YWRtaW46TDI1RkY5OUU=
          roles:
            - detect
        - path: rtsp://admin:password@192.168.222.213/cam/realmonitor?channel=1&subtype=0&authBasic=YWRtaW46TDI1RkY5OUU=
          roles:
            - clips
            - rtmp
    objects:
      track:
        - person
        # 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: 5
      # Optional: Number of seconds after the event to include in the clips (default: shown below)
      post_capture: 5
      # 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: 10
        # Optional: Per object retention days
        objects:
          person: 15
        # 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
    rtmp:
      # Required: Enable the live stream (default: True)
      enabled: True
    width: 640
    height: 480
    fps: 5```


**Screenshots**
If applicable, add screenshots to help explain your problem.

**Computer Hardware**
 - OS: Home Assistant OS 5.13
 - Install method: Addon
 - Virtualization: /
 - Coral Version: USB
 - Network Setup: Wired

**Camera Info:**
 - Manufacturer: Imou (Dahua), Foscam
 - Model: all of them (IPC-A22EP, IPC-A26HP-V2, Fi9821W-V2
 - Resolution: 640x480 for detect, 720p for stream
 - FPS: 5

**Additional context**
* Starting nginx nginx
   ...done.
frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
peewee_migrate                 INFO    : There is nothing to migrate
frigate.app                    INFO    : Camera processor started for Cam3: 40
frigate.app                    INFO    : Camera processor started for Cam1: 41
detector.coral                 INFO    : Starting detection process: 37
frigate.edgetpu                INFO    : Attempting to load TPU as usb
frigate.app                    INFO    : Camera processor started for Cam4: 43
frigate.app                    INFO    : Capture process started for Cam3: 44
frigate.app                    INFO    : Capture process started for Cam1: 45
frigate.app                    INFO    : Capture process started for Cam4: 47
frigate.mqtt                   INFO    : MQTT connected
frigate.edgetpu                INFO    : TPU found
frigate.mqtt                   INFO    : Turning off clips for Cam4 via mqtt
frigate.mqtt                   INFO    : Turning off snapshots for Cam4 via mqtt
frigate.mqtt                   INFO    : Turning off clips for Cam3 via mqtt
frigate.mqtt                   INFO    : Turning off snapshots for Cam3 via mqtt
frigate.mqtt                   INFO    : Turning off clips for Cam1 via mqtt
frigate.mqtt                   INFO    : Turning off snapshots for Cam1 via mqtt

After a few hours the following problem occurred ....

 * Starting nginx nginx
   ...done.
frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
peewee_migrate                 INFO    : There is nothing to migrate
frigate.mqtt                   INFO    : MQTT connected
frigate.app                    INFO    : Camera processor started for Cam3: 39
frigate.app                    INFO    : Camera processor started for Cam1: 40
detector.coral                 INFO    : Starting detection process: 36
frigate.edgetpu                INFO    : Attempting to load TPU as usb
Process detector:coral:
frigate.edgetpu                INFO    : No EdgeTPU detected.
frigate.app                    INFO    : Camera processor started for Cam4: 43
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 152, in load_delegate
    delegate = Delegate(library, options)
  File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 111, in __init__
    raise ValueError(capture.message)
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/frigate/frigate/edgetpu.py", line 124, in run_detector
    object_detector = LocalObjectDetector(tf_device=tf_device, num_threads=num_threads)
  File "/opt/frigate/frigate/edgetpu.py", line 63, in __init__
    edge_tpu_delegate = load_delegate('libedgetpu.so.1.0', device_config)
  File "/usr/local/lib/python3.8/dist-packages/tflite_runtime/interpreter.py", line 154, in load_delegate
    raise ValueError('Failed to load delegate from {}\n{}'.format(
ValueError: Failed to load delegate from libedgetpu.so.1.0
frigate.app                    INFO    : Capture process started for Cam3: 44
frigate.app                    INFO    : Capture process started for Cam1: 45
frigate.app                    INFO    : Capture process started for Cam4: 47
frigate.mqtt                   INFO    : Turning off clips for Cam4 via mqtt
frigate.mqtt                   INFO    : Turning off snapshots for Cam4 via mqtt
frigate.mqtt                   INFO    : Turning off clips for Cam3 via mqtt
frigate.mqtt                   INFO    : Turning off snapshots for Cam3 via mqtt
frigate.mqtt                   INFO    : Turning off clips for Cam1 via mqtt
frigate.mqtt                   INFO    : Turning off snapshots for Cam1 via mqtt
frigate.watchdog               INFO    : Detection appears to have stopped. Exiting frigate...
frigate.app                    INFO    : Stopping...
frigate.object_processing      INFO    : Exiting object processor...
frigate.record                 INFO    : Exiting recording maintenance...
frigate.events                 INFO    : Exiting event processor...
frigate.events                 INFO    : Exiting event cleanup...
frigate.watchdog               INFO    : Exiting watchdog...
frigate.stats                  INFO    : Exiting watchdog...
peewee.sqliteq                 INFO    : writer received shutdown request, exiting.
root                           INFO    : Waiting for detection process to exit gracefully...
frigate.video                  INFO    : Cam4: exiting subprocess
@blakeblackshear
Copy link
Owner

This is most likely a power issue similar to #1025

@mi4mac
Copy link
Author

mi4mac commented May 14, 2021

Thx for the quick response ... I am going to use a powered USB Hub and keep you posted about the result.

@mi4mac
Copy link
Author

mi4mac commented May 17, 2021

This is most likely a power issue similar to #1025

You were right regarding the power issue. Everything seams to be working fine now. By the way a really nice project. Thx for sharing and have a good day.

@mi4mac mi4mac closed this as completed May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants