Works with

Squirrel: 92%.How it works
A single-class squirrel model runs as a native Frigate detector on the Sixfab AI HAT+ for Raspberry Pi 5 (DEEPX DX-M1M): Frigate’s DEEPX detector runs it on the NPU, and the rule logic runs on the Raspberry Pi 5 CPU, in a listener that turns each squirrel event into an MQTT sprinkler trigger. The project is part of the Raspberry Pi 5 AI projects series.
- An RTSP feed reaches Frigate as the camera
garden(use your own camera name). - Frigate’s DEEPX NPU detector runs the squirrel
.dxnnmodel on the NPU through the DX-RT runtime. - Frigate tracks each squirrel as an event (Frigate’s record of one tracked object across many frames) with the label
Squirrel. - Frigate publishes the event to the MQTT broker on the topic
frigate/events(see Frigate’s MQTT docs). - The listener, a systemd service that runs under your own user account instead of root, receives the event and checks it against its score and cooldown rules.
- The listener’s trigger function publishes a JSON trigger to
squirrel_sprinkler/triggerand logs a line. A relay and valve would connect here.
Read the detections in Frigate’s web interface at https://[PI_IP]:8971 and each trigger on the squirrel_sprinkler/trigger topic; Verify shows both.
Requirements
Set up first, in this order
- AI HAT+ quickstartThe HAT mounted and the NPU running on the Raspberry Pi 5
- Frigate NVR on Raspberry Pi 5 with the DEEPX NPUFrigate running with the DEEPX detector and DX-RT
- Camera feeds and MQTT for Frigate projectsThe MQTT broker and the camera feed
- DIY Raspberry Pi bird cameraOptionalCan share the same Frigate instance
Hardware
- Raspberry Pi 5Host for Frigate and the listener. Tested on the 8 GB model
- Sixfab AI HAT+ (DEEPX DX-M1M)Mounted on the Raspberry Pi 5
- RTSP camera or stream
rtsp://<stream-host>:8554/<stream-path>
Software
- Raspberry Pi OS TrixieThe tested OS
- MQTT brokerMosquitto on
<broker-host>, port 1883 git,curl,sha256sum,ffprobeffprobecomes with ffmpegmosquitto_subFor Verifypython3withvenvThe installer addspaho-mqtt
DEEPX support is in Frigate’s dev branch
DEEPX support was merged into Frigate’s dev branch on September 21, 2026 (PR #24336) and is not in a stable release yet; the latest stable release is v0.18.0 (September 12, 2026). The ghcr.io/blakeblackshear/frigate:af0ba19-standard-arm64 image, which the Frigate setup page pulls, is built from commit af0ba19 of the dev branch. Sixfab develops and maintains DEEPX support in Frigate (Frigate’s DEEPX NPU detector docs).
Install
Run the install on the Raspberry Pi 5. It adds the squirrel camera and model to your running Frigate and starts the listener. The installer and the listener are in the project folder of sixfab-dx-frigate on GitHub; the model is a ready-compiled file from the project’s GitHub release.
Clone the repository and run the installer with your camera’s RTSP URL and your broker host:
git clone https://github.com/sixfab/sixfab-dx-frigate.git
cd sixfab-dx-frigate/apps/squirrel-sprinkler
./install.sh --rtsp-url [RTSP_URL] --broker [BROKER_HOST]
--rtsp-urlstringThe RTSP stream of your camera, written into the
gardencamera in your Frigate config.--brokerstringThe MQTT broker host the listener connects to.
--yesflagSkips the question before Frigate restarts.
--containerstringOnly if your Frigate container differs; the installer finds it itself. Defaults to
frigate.--config-dirstringOnly if your Frigate config directory differs; the installer finds it itself.
The installer asks for any value you leave out. It downloads the model from the project’s GitHub release, checks its SHA-256 and runs 5 stages:
- Checks that your RTSP stream is reachable with
ffprobe, and stops if it is not. - Copies the model and label map into
model_cacheunder your Frigate config directory. - Backs up
config.yaml, then merges the project’s camera and model into it with your RTSP URL, without touching other cameras or global settings. - Installs the listener as a user-level systemd service, which needs no sudo, with its own
venvunder~/sixfab-apps/squirrel-sprinkler. The installed copy ofsprinkler.pycarries your broker host in itsBROKERconstant, and the service file points at your home directory. - Asks, then restarts the Frigate container.

== 1/5: checking the squirrel RTSP feed is reachable == to == 5/5: Frigate container restart ==, and ends with Install complete.Figure 2 shows a complete run. To let the listener start at boot without a login, run once:
sudo loginctl enable-linger $USER
The manual route runs the installer’s steps one at a time.
-
Check that Frigate runs with the DEEPX detector
The
docker runcommand for Frigate is in Set up Frigate with the DEEPX NPU. Use the same[FRIGATE_CONFIG_DIR]and[FRIGATE_MEDIA_DIR]you set there. -
Clone repository and open project folder
Keep the whole clone: the installer calls the merge script in the shared
toolkitfolder.git clone https://github.com/sixfab/sixfab-dx-frigate.git [REPO_DIR] cd [REPO_DIR]/apps/squirrel-sprinkler -
Download model and check it
Use the repository address without a trailing
.gitin the download URL.curl -fL -o model/squirrel-detector-model.dxnn https://github.com/sixfab/sixfab-dx-frigate/releases/download/squirrel-sprinkler-v1.0.0/squirrel-detector-model.dxnnawk '$1 !~ /^#/ && NF {print $3 " " $2}' models.txt | sha256sum -c -model/squirrel-detector-model.dxnn: OK -
Run installer with your values
Run it from the project folder; it is safe to re-run. It reads the config directory from the Frigate container’s
/configmount; setCONFIG_DIRorCONTAINERonly if yours differ.RTSP_URL=[RTSP_URL] BROKER=[BROKER_HOST] ./install.sh -
Restart Frigate
Answer
ywhen the installer asks to restart Frigate, or setASSUME_YES=1to skip the question. To restart Frigate yourself, rundocker restart frigate. -
Enable linger once
Linger lets a user-level systemd service start at boot without a login.
sudo loginctl enable-linger $USER
Verify
API checks run inside the container; the browser reaches Frigate only through the authenticated port 8971. List the recent events of the garden camera:
docker exec frigate curl -s 'http://localhost:5000/api/events?camera=garden&limit=10'
The response is JSON; detected squirrels appear with the label Squirrel. To see the detections, open https://[PI_IP]:8971 and select the garden camera (or your own camera name). Switch on Bounding Boxes in the debug view to watch each detection, as in Figure 1.
Subscribe to the trigger topic:
mosquitto_sub -h [BROKER_HOST] -t squirrel_sprinkler/trigger -v
Each accepted trigger publishes one JSON message with the camera name, the score and a timestamp, at most one per camera every 30 s. This message was captured in the test:
squirrel_sprinkler/trigger {"camera": "garden", "score": 0.89, "timestamp": 1791272738.7976897}
The service status is active (running) in systemctl --user status squirrel-sprinkler-automation.service -l. At start the listener logs Connected to broker (<broker-host>:1883), listening on frigate/events, and each trigger logs SPRINKLER TRIGGER camera=garden score=<score> (simulated for now).
Details
Model
The COCO-80 label map that the Boss Detector project uses has 80 lines and no squirrel entry, so a COCO-80 detector cannot report a squirrel. This project’s model, squirrel-detector-model.dxnn, is a single-class squirrel detector compiled to .dxnn, DEEPX’s model format; its label map holds one line, Squirrel.
Detection settings
The installer merges these camera and model settings into your Frigate config.yaml and replaces the RTSP path with your RTSP URL:
models:
- scene: outdoor
model_type: yolo-generic
width: 640
height: 640
path: /config/model_cache/squirrel-detector-model.dxnn
labelmap_path: /config/model_cache/squirrel-only-labelmap.txt
devices:
- deepx:PCIe:0
cameras:
garden:
ffmpeg:
inputs:
- path: rtsp://[STREAM_HOST]:8554/[STREAM_PATH]
roles:
- detect
- record
detect:
enabled: true
width: 1280
height: 720
scene: outdoor
objects:
track:
- Squirrel
filters:
Squirrel:
min_score: 0.35
threshold: 0.5
The scene: outdoor value ties the garden camera to this model, so another project’s camera keeps its own model in the same Frigate instance.
Listener rules
The listener runs as squirrel-sprinkler-automation.service. Its rules are defined at the top of automation/sprinkler.py:
| Setting | Value |
|---|---|
| Topic | frigate/events |
| Label filter | Squirrel |
| Event type | Only the first new event for each event ID |
| Minimum score | 0.6, read from top_score, falling back to score |
| Cooldown | 30 s per camera |
| Broker | BROKER and PORT constants (port 1883) |
Relay or valve control goes in the trigger_sprinkler() function of automation/sprinkler.py. The function only publishes the trigger and logs a line; its comment suggests driving a relay pin with GPIO or sending a request to a relay HAT’s REST or MQTT interface. After editing it, run ./install.sh again.
Limitations
- No relay or valve is connected. The listener publishes and logs each trigger. Valve control is not part of this build, and the valve host (the Raspberry Pi 5, another edge computer or a microcontroller) is undecided. The page gives no wiring, voltages or part numbers because no valve has been tested. Once you add a valve, keep the spray away from paths, doors and neighbors’ property, and check your local water-use rules before you automate a sprinkler.
- No motion-activated sprinkler was tested, so the page makes no comparison with one.
- Nothing is measured for the shipped model: no confidence scores across a test set, accuracy, false-positive rates under real lighting, angles and backgrounds, inference time or skipped frames. Figure 1 and the trigger in Verify are single frames (92% and 0.89), not a measurement. Test with your own camera before you rely on it.
- No night, low-light or rain results exist.
- Training a custom model is not covered.
- The listener ignores events with a score below 0.6, while the Frigate filter tracks squirrels from 0.35. Detections between those values may appear in Frigate without a trigger.
- The installer fixes the listener folder at
~/sixfab-apps/squirrel-sprinklerand overwrites the installed copy on every run, so edits made directly to~/sixfab-apps/squirrel-sprinkler/sprinkler.pyare lost. Editautomation/sprinkler.pyin the repository and run./install.shagain. - The listener connects to the broker on port 1883 without credentials or TLS, so any device that can publish to the broker can send it a fake
frigate/eventsmessage. - Frigate chooses the DX-RT version its DEEPX detector uses. The tested build pins DX-RT v3.4.0, and this project cannot change it.
- Frigate ran in Docker. Home Assistant OS and the Frigate add-on were not tested.
Privacy
A garden camera can record people. Aim the camera at your own garden, away from neighbors’ windows and public sidewalks. The garden camera input carries the detect and record roles; if recording is enabled in your Frigate config, Frigate stores recordings in [FRIGATE_MEDIA_DIR] under its own retention settings.
Detection runs locally on the Raspberry Pi 5. Frigate downloads the DX-RT Python bindings once at first start, and again when a release pins a new version, so the first start needs internet access.
Troubleshooting
The listener sends a trigger only for an event that passes its rules: see Listener rules. Check that the service is active (running):
systemctl --user status squirrel-sprinkler-automation.service -l
Raise min_score and threshold for Squirrel in Detection settings; the listener adds its own minimum score of 0.6. If that is not enough, train a custom model.
Run sudo loginctl enable-linger $USER once.
Restart the Frigate container with docker restart frigate. The Frigate setup page’s Troubleshooting covers this failure.
Stage 1 of the installer probes the RTSP URL you passed. Start your stream or correct the URL, then run the installer again.
Start Frigate first, or pass --container with your container name (CONTAINER when you run install.sh directly).
Ask in the Sixfab Community forum.
Next steps
License and credits
- Frigate: Frigate NVR, the open-source NVR this project runs in.
- Model:
squirrel-detector-model.dxnnis built on Ultralytics YOLOv8m and licensed under AGPL-3.0. It was trained on two Roboflow datasets under CC BY 4.0. Details are in the squirrel-sprinkler-v1.0.0 release notes. - Code: MIT License.