I run the Rock 5B with Frigate, here are my install instructions.
Rock 5B - Frigate Setup
Install RadaxOS debian 12 bookworm image.
OS Update
Don’t do apt upgrade
to update the debian system, instead to update do;
rsetup
Then from the menu select System->System Update
.
First Changes
Disable Desktop booting, so it boots to CLI only.
sudo systemctl set-default multi-user.target
reboot
Install common tools
apt install net-tools build-essential dnsutils
Install Docker
Install dependencies
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release
Add Dockers GPG Key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Add docker APT repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Update APT repo information
sudo apt update
Install docker
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin
Add user to docker for permission access
sudo usermod -aG docker rock
Logout and log back in SSH session.
Verify installation as user
docker run hello-world
Install Frigate
Create a root project directory for frigate, I did this under the rock
linux user.
mkdir ~/frigate
cd ~/frigate
Create frigate directory structure
mkdir storage config && touch docker-compose.yml
Edit the docker-compose.yml and set contents;
services:
frigate:
container_name: frigate
restart: unless-stopped
stop_grace_period: 30s
image: ghcr.io/blakeblackshear/frigate:stable-rk
shm_size: "1024mb"
volumes:
- /etc/localtime:/etc/localtime:ro
- ./config:/config
- ./storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "8971:8971"
- "8554:8554" # RTSP feeds
security_opt:
- apparmor=unconfined
- systempaths=unconfined
devices:
- /dev/dri
- /dev/dma_heap
- /dev/rga
- /dev/mpp_service
Start frigate with;
docker compose up -d
Get admin password generated from logs;
docker logs frigate
Go to web interface on port 8971
, ie: https://<rock5b ip address>:8971
Configure Frigate
Edit the frigate configuration in the Web UI and setup the cameras and object detectors.
Used config of;
mqtt:
enabled: false
ffmpeg:
hwaccel_args: preset-rk-h264
detectors:
rknn1:
type: rknn
num_cores: 3
rknn2:
type: rknn
num_cores: 3
rknn3:
type: rknn
num_cores: 3
model:
# name of model (will be automatically downloaded) or path to your own .rknn model file
# possible values are:
# - deci-fp16-yolonas_s
# - deci-fp16-yolonas_m
# - deci-fp16-yolonas_l
# - /config/model_cache/your_custom_model.rknn
path: deci-fp16-yolonas_s
# width and height of detection frames
width: 320
height: 320
# pixel format of detection frame
# default value is rgb but yolo models usually use bgr format
input_pixel_format: bgr
# shape of detection frame
input_tensor: nhwc
# needs to be adjusted to model, see below
labelmap_path: /labelmap.txt
#
# configure your camera streams here
#
version: 0.15-1
Start at Bootup
Create a systemd service so frigate starts on boot.
Create file /etc/systemd/system/frigate.service
with contents;
[Unit]
Description=Frigate NVR
Requires=docker.service
After=docker.service network-online.target
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/rock/frigate
User=rock
Group=rock
# If you use Docker Compose v2 plugin:
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
Enable;
sudo systemctl daemon-reload
sudo systemctl enable frigate.service
Reboot and test.