Closed bajwamar closed 1 year ago
This is likely a power issue where the USB ports are not able to supply enough power for all devices, a powered USB hub is generally recommended especially for devices like RPi
do you know a good powered USB hub that would work with RPi 4 and Coral?
There is one linked in the docs https://docs.frigate.video/frigate/installation/#raspberry-pi-34
There is one linked in the docs https://docs.frigate.video/frigate/installation/#raspberry-pi-34
I happened to buy this one by chance and can attest it works. I'm sure it ended up in your documentation for a good reason.
There is one linked in the docs https://docs.frigate.video/frigate/installation/#raspberry-pi-34
I happened to buy this one by chance and can attest it works. I'm sure it ended up in your documentation for a good reason.
Just to clarify, they are not my docs 👍
so I got the USB hub but still frigate is not running (below is the log and it looks identical to before)
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 frigate-log successfully started
s6-rc: info: service nginx-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 go2rtc-healthcheck successfully started
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
2023-08-17 23:52:17.059456078 [INFO] Preparing go2rtc config...
2023-08-17 23:52:17.069806847 [INFO] Starting Frigate...
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
2023-08-17 23:52:17.097714282 [INFO] Starting NGINX...
s6-rc: info: service legacy-services successfully started
2023-08-17 23:52:17.258330953 [INFO] Got IP address from supervisor: 192.168.1.151
2023-08-17 23:52:17.405311523 [INFO] Got WebRTC port from supervisor: 8555
2023-08-17 23:52:18.476154432 [INFO] Starting go2rtc...
2023-08-17 23:52:18.710212064 17:52:18.709 INF go2rtc version 1.2.0 linux/arm64
2023-08-17 23:52:18.711326385 17:52:18.711 INF [api] listen addr=:1984
2023-08-17 23:52:18.712458612 17:52:18.712 INF [rtsp] listen addr=:8554
2023-08-17 23:52:18.713519304 17:52:18.713 INF [srtp] listen addr=:8443
2023-08-17 23:52:18.714401534 17:52:18.714 INF [webrtc] listen addr=:8555
2023-08-17 23:52:22.453381981 2023/08/17 17:52:22 [error] 137#137: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.30.32.1, server: , request: "GET /api/stats HTTP/1.1", upstream: "http://127.0.0.1:5001/stats", host: "ccab4aaf-frigate-fa:5000"
2023-08-17 23:52:22.453737903 172.30.32.1 - - [17/Aug/2023:17:52:22 -0600] "GET /api/stats HTTP/1.1" 502 157 "-" "HomeAssistant/2023.8.2 aiohttp/3.8.5 Python/3.11" "-"
2023-08-17 23:52:23.952213512 [2023-08-17 17:52:23] frigate.app INFO : Starting Frigate (0.12.1-367d724)
2023-08-17 23:52:24.077938607 [2023-08-17 17:52:24] frigate.app INFO : Creating directory: /tmp/cache
2023-08-17 23:52:27.074386574 [INFO] Starting go2rtc healthcheck service...
2023-08-17 23:52:30.826772911 172.30.32.1 - - [17/Aug/2023:17:52:30 -0600] "GET /api/stats HTTP/1.1" 200 2653 "-" "HomeAssistant/2023.8.2 aiohttp/3.8.5 Python/3.11" "-"
2023-08-17 23:52:38.946056942 172.30.32.1 - - [17/Aug/2023:17:52:38 -0600] "GET /api/stats HTTP/1.1" 200 2590 "-" "HomeAssistant/2023.8.2 aiohttp/3.8.5 Python/3.11" "-"
2023-08-17 23:52:46.737062914 172.30.32.1 - - [17/Aug/2023:17:52:46 -0600] "GET /api/stats HTTP/1.1" 200 2658 "-" "HomeAssistant/2023.8.2 aiohttp/3.8.5 Python/3.11" "-"
2023-08-17 23:52:50.231178085 Process detector:coral:
2023-08-17 23:52:50.246557536 Traceback (most recent call last):
2023-08-17 23:52:50.246574795 File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
2023-08-17 23:52:50.246623776 delegate = Delegate(library, options)
2023-08-17 23:52:50.246663442 File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 119, in __init__
2023-08-17 23:52:50.246668220 raise ValueError(capture.message)
2023-08-17 23:52:50.247130122 ValueError
2023-08-17 23:52:50.247173066
2023-08-17 23:52:50.247207010 During handling of the above exception, another exception occurred:
2023-08-17 23:52:50.247213713
2023-08-17 23:52:50.247215343 Traceback (most recent call last):
2023-08-17 23:52:50.247219436 File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2023-08-17 23:52:50.247220787 self.run()
2023-08-17 23:52:50.247222917 File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2023-08-17 23:52:50.247732244 self._target(*self._args, **self._kwargs)
2023-08-17 23:52:50.247862965 File "/opt/frigate/frigate/object_detection.py", line 98, in run_detector
2023-08-17 23:52:50.247878743 object_detector = LocalObjectDetector(detector_config=detector_config)
2023-08-17 23:52:50.247880946 File "/opt/frigate/frigate/object_detection.py", line 52, in __init__
2023-08-17 23:52:50.248201739 self.detect_api = create_detector(detector_config)
2023-08-17 23:52:50.248214313 File "/opt/frigate/frigate/detectors/__init__.py", line 24, in create_detector
2023-08-17 23:52:50.248217554 return api(detector_config)
2023-08-17 23:52:50.248219868 File "/opt/frigate/frigate/detectors/plugins/edgetpu_tfl.py", line 37, in __init__
2023-08-17 23:52:50.248257998 edge_tpu_delegate = load_delegate("libedgetpu.so.1.0", device_config)
2023-08-17 23:52:50.249042285 File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 162, in load_delegate
2023-08-17 23:52:50.249055692 raise ValueError('Failed to load delegate from {}\n{}'.format(
2023-08-17 23:52:50.249057766 ValueError: Failed to load delegate from libedgetpu.so.1.0
2023-08-17 23:52:50.249062988
2023-08-17 23:52:54.959127490 172.30.32.1 - - [17/Aug/2023:17:52:54 -0600] "GET /api/stats HTTP/1.1" 200 2592 "-" "HomeAssistant/2023.8.2 aiohttp/3.8.5 Python/3.11" "-"
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
s6-rc: info: service go2rtc-healthcheck: stopping
2023-08-17 23:52:56.216984962 [INFO] The go2rtc-healthcheck service exited with code 256 (by signal 15)
s6-rc: info: service go2rtc-healthcheck successfully stopped
2023-08-17 23:52:56.257726415 [INFO] Service NGINX exited with code 0 (by signal 0)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service nginx-log: stopping
s6-rc: info: service frigate: stopping
s6-rc: info: service nginx-log successfully stopped
2023-08-17 23:52:58.534167896 /usr/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 28 leaked shared_memory objects to clean up at shutdown
2023-08-17 23:52:58.534188748 warnings.warn('resource_tracker: There appear to be %d '
2023-08-17 23:52:58.552267186 [INFO] Service Frigate exited with code 0 (by signal 0)
s6-rc: info: service frigate successfully stopped
s6-rc: info: service go2rtc: stopping
s6-rc: info: service frigate-log: stopping
s6-rc: info: service frigate-log successfully stopped
2023-08-17 23:52:58.580175770 exit OK
2023-08-17 23:52:58.609044805 [INFO] The go2rtc service exited with code 0 (by signal 0)
s6-rc: info: service go2rtc successfully stopped
s6-rc: info: service go2rtc-log: stopping
s6-rc: info: service go2rtc-log successfully stopped
s6-rc: info: service log-prepare: stopping
s6-rc: info: service s6rc-fdholder: stopping
s6-rc: info: service log-prepare successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service s6rc-fdholder successfully stopped
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
How are the usb devices setup with the hub?
What does running lsusb inside the container show?
running lsusb shows the following info Bus 002 Device 004: ID 1a6e:089a Bus 002 Device 002: ID 05e3:0626 Bus 001 Device 001: ID 1d6b:0002 Bus 001 Device 003: ID 05e3:0610 Bus 001 Device 002: ID 2109:3431 Bus 002 Device 002: ID 174c:55aa Bus 002 Device 001: ID 1d6b:0003 Bus 001 Device 003: ID 10c4:3a60
Is that inside the container (addon)?
I have HA running on RPi 4 and frigate addon
You can run docker exec -it addon_ccab4aaf_frigate lsusb
to se what it shows in the container.
had to change the code to docker exec -it addon_ccab4aaf_frigate-**fa** lsusb
but for Error
OCI runtime exec failed: exec failed: unable to start container process: exec: "lsusb": executable file not found in $PATH: unknown
Oh, right, so it'll need to be
docker exec -it addon_ccab4aaf_frigate-fa apt-get update && apt-get install lsusb -y && lsusb
now it says command not found: apt-get
docker exec -it addon_ccab4aaf_frigate-fa apt update && apt install lsusb -y && lsusb
was able to get the addon up and running with Coral had to disable the protection mode
within the addon
but I still have high CPU usable
Show a screenshot of the system page.
Sorry, I meant the system tab in the frigate webUI.
I'd definitely suggest leaving detect fps at 5, you're also going to want to enable hardware acceleration
What kind of hardware acceleration should I enable for rpi4 with coral
preset-rpi-64-h264
so I have setup the frigate.yaml file accordingly and I was reading the documentation and it mentioned that I should also allocate more mem for GPU but these commond mentioned in https://docs.frigate.video/configuration/hardware_acceleration#raspberry-pi-34 don't work I have disabled the protection mode on the Advance SSH & Web Terminal
it says command not found: raspi-config
In this case for ha os you need to edit /mnt/boot/config.txt
https://gist.github.com/enegaard/a57af286205914bd912270c89650fb1b
I was able to get into /mnt directory but there is no /boot directory
Odd, I'm not sure unfortunately they don't make it easy in ha os. Is hwaccel working as is?
That's expected for RPi, like it says that does not indicate any problems
still have high usage on CPU for ffmpeg
Yeah, unfortunately that's not unexpected for a Pi running detect on a 1920x1080 stream.
Could try -c:v h264_v4l2m2m
as hwaccel args and see if it makes a difference.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the problem you are having
I have Frigate working and recording events with CPU dectector (only have 1 Camera and 1 Doorbell Camera) and recently bought the Coral USB and made the change to config file to detectors: coral: type: edgetpu device: usb and now Frigate is not working but if I change the detectors back to CPU it works fine
Version
0.12.1
Frigate config file
docker-compose file or Docker CLI command
Relevant log output
Operating system
HassOS
Install method
HassOS Addon
Coral version
USB
Any other information that may be helpful
running lsusb shows the following info Bus 001 Device 001: ID 1d6b:0002 Bus 001 Device 002: ID 2109:3431 Bus 002 Device 002: ID 174c:55aa Bus 002 Device 001: ID 1d6b:0003 Bus 001 Device 003: ID 10c4:3a60
I have an SSD connected to USB 3.0 I have SkyConnect connected to USB 2.0 (I think Bus 001 Device 003: ID 10c4:3a60 is the skyconnect)