geerlingguy/pi-nvr

Get Frigate working (with Coral TPU)

geerlingguy opened this issue · 8 comments

I would like to see if I can get Frigate working well... it seems to have a lot of momentum, especially around GPU or TPU-accelerated use.

They have a suggested Docker Compose setup: https://docs.frigate.video/frigate/installation

It looks like they have arm64 images available, yay! https://hub.docker.com/r/blakeblackshear/frigate/tags

Downside to Coral support—only the USB Coral module will work with the Raspberry Pi currently (see notes: https://pipci.jeffgeerling.com/cards_m2/coral-accelerator-ae-key.html).

The M.2 PCIe versions won't work because of driver issues with the CM4 PCIe bus.

But could still be a good option, we'll see. I might need to use a different CM4 IO board than the one I'm currently using (BitPiRat) so I can have a USB 2.0 interface.

I have it running:

Screen Shot 2023-01-12 at 11 45 56 AM

However, nothing happens, and if I go to docker logs, I see:

[2023-01-12 11:46:08] frigate.app                    INFO    : Starting Frigate (0.11.1-2eada21)
*************************************************************
*************************************************************
***    Your config file is not valid!                     ***
***    Please check the docs at                           ***
***    https://docs.frigate.video/configuration/index     ***
*************************************************************
*************************************************************
***    Config Validation Errors                           ***
*************************************************************
2 validation errors for FrigateConfig
mqtt
  field required (type=value_error.missing)
cameras
  field required (type=value_error.missing)
Traceback (most recent call last):
  File "/opt/frigate/frigate/app.py", line 332, in start
    self.init_config()
  File "/opt/frigate/frigate/app.py", line 82, in init_config
    user_config = FrigateConfig.parse_file(config_file)
  File "/opt/frigate/frigate/config.py", line 942, in parse_file
    return cls.parse_obj(config)
  File "/usr/local/lib/python3.9/dist-packages/pydantic/main.py", line 521, in parse_obj
    return cls(**obj)
  File "/usr/local/lib/python3.9/dist-packages/pydantic/main.py", line 341, in __init__
    raise validation_error
pydantic.error_wrappers.ValidationError: 2 validation errors for FrigateConfig
mqtt
  field required (type=value_error.missing)
cameras
  field required (type=value_error.missing)

*************************************************************
***    End Config Validation Errors                       ***
*************************************************************
[cmd] python3 exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
...

MQTT's auth is a bit annoying. You have to manually create user / password pairs if you want to do that, after the mosquitto container is running...

Things are mostly working, but MQTT is not starting up correctly because I don't have the automated hashing of the user/pass pair working correctly yet. I might do something like install mqtt client on the managed server (or run it in a Docker container temporarily or something), just to encrypt the auth file passwords.

It's a bit annoying but might be doable. Just didn't want to have to add in more mqtt-specific tasks in the playbook.