Frigate NVR Frigate NVR

Frigate NVR

Description

Frigate is used to record footage from three cameras in my home. Two are for fun, and one looks out the front door peephole for deliveries.

Hardware: Home Lab

History

I don’t really need a surveillance system, but a different idea started me on the path:

Peep Cam

It was 2020 and I suddenly found myself getting a lot more things delivered to my apartment. I was feeling lazy and wished for a way to see out the peep hole from my desk.

There didn’t seem to be any products yet that could replace a standard peephole with a camera, so i used what I had laying around: an old rPi0 and Pi camera

I learned i could flash motioneyeos to the SD Card and it should do what I needed spoiler: it did.

Now I wanted a way to store what the camera saw

Version 1

After doing some research, it seemed like a software called Frigate would suit my needs.

Already having gotten my hands dirty in K8s and helm, it didn’t take long to get the app spun up to poke around.

Adding my existing cameras was fairly easy, I have experience playing with these for a few years so I knew where to look for stream urls and such.

Reading through the docs i found that Frigate can do object identification, but requires something called a TPU

After more reading and an Amazon purchase, I was ready for a redesign.

Version 2

Because of the new USB device, I decided to make things more interesting by adding my rPi4 to my K8s cluster and running Frigate that way.

This enabled me to run the Frigate container with “admin rights” and find the TPU without compromising other apps in the cluster.

That meant I needed to learn how to add a worker node to microk8s, and how to “force” resource assignment to nodes. I’d love to say this was easy, but it took some time to wrap my head around taints and toleration.

Once I sorted that out, it was on to storage. The Media Server project needed persistent storage so I had code to copy and it was now just a matter of correctly mounting the drive to Ubuntu.

Version 3

While reading through the Frigate docs, MQTT had caught my eye but it wasn’t until another project that I had a broker to work with. Once I realized the possibilities, I had a new interest in figuring out notifications.

The broker I chose was EMQX, and after messing around with that for a bit I was able to get notifications from Frigate to reach a custom channel on Discord.

Once that was going, I found that I could also get notifications through HomeAssistant connected to the same MQTT broker as Frigate. This was cool because it would send a push notification to my phone with images from Frigate.

Version 4

I decided to move my home server to smaller hardware, including moving Frigate back to the primary k8s node. I had it on the rPi4 to play with k8s worker nodes and it was easier to set up hardware acceleration for that CPU.

I started by editing the values file for the app, removing the settings that put it on the worker only and setting limits for the new cluster. I then created a new folder on the shared drive for camera footage, and added a new pv and pvc for Frigate to store media.

Hardware

For the Google Coral, I knew I would need to pass the USB device from the proxmox host to the Ubuntu VM, and with some quick Google Fu I was able to get the device seen by Ubuntu.

I added iGPU with similar Google Fu, but it still was not being seen by Ubuntu. After further research I found that the N150 iGPU is not supported until linux 6.11 and ubuntu is built on 6.8 - but it can be updated. I installed that and the intel iGPU drivers and it seems to work!

Frigate

I double-checked the values file and made sure that the USB device it looks for isn’t a specific one, and set the hardware acceleration to what it should be for the N150. I then read in the Frigate docs that the N150 is not recommended for unknown issues. Well…

I added the app to ArgoCD and tried it anyway, but it booted up with errors about finding the iGPU so I turned it off. The App runs well and the decode streams are only using ~12% of the given CPU so maybe this will be fine for a while. I’ll keep an eye out for updates


← Back to projects