Skip to content

tonyperkins/frigate_setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frigate NVR with Coral PCIe Accelerator

This project sets up a complete Frigate NVR system with Google Coral PCIe accelerator on Ubuntu 20.04 LTS, including Docker, Portainer, and network storage integration.

Features

  • Automated installation of Frigate with Coral PCIe support
  • Hardware-accelerated video decoding with AMD iGPU (radeonsi VAAPI driver)
  • Network storage integration (SMB/CIFS)
  • Docker and Portainer for container management
  • Ansible-based deployment for repeatable setup

Hardware Requirements

  • x86_64 system with Ubuntu 20.04 LTS
  • Google Coral PCIe accelerator
  • AMD iGPU (for hardware-accelerated decoding)
  • Minimum 2GB RAM (4GB+ recommended)
  • At least 10GB free disk space

Network Requirements

  • Static IP assignment recommended for the server
  • Access to SMB share (update in ansible/templates/frigate/config.yml.j2)
  • MQTT broker (update host/port in ansible/templates/frigate/config.yml.j2)

Configuration

Before running the playbook, update these configuration files:

  1. Ansible Inventory (ansible/inventory):

    [all]
    your-hostname ansible_user=your-username
    

    Replace your-hostname with your server's hostname or IP, and your-username with your SSH username.

  2. Frigate Config (ansible/templates/frigate/config.yml.j2):

    • Update MQTT connection details
    • Configure camera settings
    • Update any IP addresses or credentials
  3. Network Shares:

    • Update SMB/CIFS share paths in the Frigate config
    • Ensure proper permissions are set for the media directory

Directory Structure

frigate_setup/
├── ansible/                  # Ansible playbooks and templates
│   ├── templates/
│   │   └── frigate/         # Frigate configuration templates
│   │       ├── config.yml.j2  # Main Frigate config template
│   │       └── docker-compose.yml.j2  # Docker Compose template
│   ├── inventory            # Ansible inventory file
│   ├── site.yml            # Main playbook
│   └── README.md           # Ansible-specific docs
└── README.md               # This file

Quick Start

  1. Prerequisites

    • Ubuntu 20.04 LTS installed
    • Python 3.8+ and pip installed
    • SSH access with sudo privileges
  2. Install Ansible

    sudo apt update
    sudo apt install -y ansible
  3. Configure Inventory Update ansible/inventory with your server's IP and SSH user:

    [all]
    192.168.50.5 ansible_user=your_username
    
  4. Run the Playbook

    ansible-playbook -i ansible/inventory ansible/site.yml --ask-become-pass

    When prompted, enter your sudo password.

Configuration

Frigate Configuration

The main configuration is managed through Ansible templates in ansible/templates/frigate/. Key settings:

  • Configuration File: config.yml.j2 (templated to /opt/frigate/config/config.yml)
  • MQTT: Configured for broker at 192.168.50.84:1883
  • Recording: 7-day retention with motion-based storage
  • Hardware Acceleration: Using AMD radeonsi VAAPI driver
  • Coral TPU: Configured for PCIe accelerator (coral_pci detector)

Storage Configuration

  • SMB share mounted at /mnt/cameras
  • Frigate media directory: /media/frigate (inside container)
  • Database stored in /opt/frigate/db

Verifying the Setup

  1. Check Coral Device

    docker exec -it frigate ls -la /dev/apex_0
  2. Verify VAAPI

    docker exec -it frigate vainfo --display drm --device /dev/dri/renderD128
  3. Check Frigate Logs

    docker logs -f frigate

Accessing Services

Maintenance

Updating Frigate

  1. Update the image tag in ansible/site.yml
  2. Re-run the playbook:
    ansible-playbook -i ansible/inventory ansible/site.yml --ask-become-pass

Backing Up Configuration

Back up these files:

  • ansible/templates/frigate/config.yml.j2 (main configuration template)
  • /opt/frigate/config/config.yml (generated config)
  • /opt/frigate/db/frigate.db (database)

Troubleshooting

Coral Device Not Detected

  1. Check if the device is visible on the host:
    ls -la /dev/apex_0
    lsmod | grep -i gasket
  2. Reboot the system if the device isn't found

VAAPI Issues

If hardware acceleration isn't working:

  1. Verify the driver:
    docker exec -it frigate vainfo --display drm --device /dev/dri/renderD128
  2. Check the driver in use:
    docker inspect frigate --format '{{json .Config.Env}}' | jq -r '.[]' | grep LIBVA_DRIVER_NAME

License

This project is open source and available under the MIT License.

Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages