Farm Guardian
A multi-camera system running on OpenClaw β watching the flock, scoring frames with VLMs, curating the best moments through Discord to Instagram and Facebook.
What This Is
A camera system built with OpenClaw and AI tools, watching the flock across a 13.6-acre hobby farm in Hampton, CT. The Mac Mini M4 Pro sits on the desk next to the chick brooder β its waste heat helps keep the incubator at temperature. The same machine runs every camera feed, scores frames with vision-language models, archives the best moments, and pushes them to Instagram and Facebook.
One machine. Incubator warmer, frame judge, gem curator, bird guardian.
The headline feature isn't predator detection β that was built but is paused. The headline is the VLM image pipeline: cameras watching the birds around the clock, a local model judging every frame, Discord as the human review table, and the best moments reaching the public as gems.
The Pipeline
This is the system that runs every day:
- Cameras see the birds. Five cameras across the property pull frames on a steady cadence β no video encoding, no ffmpeg, just clean JPEGs at a few seconds apart.
- Mac Mini judges the frames. Bubba (the OpenClaw agent on the Mac Mini) runs vision-language models against every frame β scoring for composition, activity, lighting, and share-worthiness. Strong frames get flagged as gems.
- Discord becomes the review table. The best gems land in the
#farm-2026channel. Boss reacts to the ones worth sharing β the single human-in-the-loop filter. Every reacted gem eventually publishes. - The best moments reach the public. Reacted gems post to @pawel_and_pawleen on Instagram and the Yorkies App Facebook Page. Stories, carousels, and reels β all from the same pipeline.
The pipeline has posted hundreds of gems since it went live. The archive grows every day as the chicks grow up β what was a palm-sized fluffball a month ago fills the frame now.
The Hardware
Cameras across the property β named for the hardware, never for where they happen to be pointed. The devices stay; the angles change. The list below is the long-running fleet; the live dashboard above shows whichever ones are reporting frames right now.
| Camera | Hardware | Capabilities | |--------|----------|--------------| | house-yard | Reolink E1 Outdoor Pro | 4K PTZ with spotlight + siren. 11-position patrol, sky-watch lock, HTTP snapshot polling via reolink_aio. The only unit with deterrents. | | s7-cam | Samsung Galaxy S7 running the IP Webcam app | Portrait 1080Γ1920 β optimized for Instagram stories and reels. Fixed tripod, stream endpoint stable. | | usb-cam | USB webcam on the Mac Mini | AVFoundation local capture, 1920Γ1080, snapshot polling with auto white-balance and autofocus warmup. | | mba-cam | MacBook Air 2013 built-in FaceTime HD webcam | 720p via ffmpeg + MediaMTX RTSP bridge on the laptop itself. | | gwtc | Gateway laptop built-in webcam | 720p via ffmpeg + MediaMTX RTSP on Windows; services auto-start via Shawl. |
The Reolink is the only one with deterrents β spotlight to 100% brightness and a siren loud enough to scatter a hawk mid-dive.
How It Watches
The Mac Mini pulls a JPEG from each camera on a steady cadence β no video encoding, no ffmpeg processes, no HLS segments. Still images at a few seconds apart are plenty to see what's happening, and they sail through the Cloudflare tunnel instead of choking it.
It doesn't phone home. No cloud. No subscriptions. No data leaves the network. The dashboard, the camera control, the snapshots β everything runs on that one Mac Mini on the desk next to the birds.
What's running right now:
- Live snapshot feeds from every camera Guardian currently sees, visible here and on the homepage
- VLM scoring pipeline β every frame gets judged, strong ones get archived as gems
- Automated posting to Instagram and Facebook via the gem pipeline
- Manual PTZ on the Reolink β pan/tilt by approximate degrees, or jump to a named preset in one tap
- Five on-camera presets: yard-center, coop-approach, fence-line, sky-watch, driveway
- Spotlight and siren as on-demand deterrents from the web UI
- Full REST API exposed via Cloudflare tunnel
Paused, on the bench:
- YOLOv8 + GLM-4V automated detection. The plumbing is all in
farm-guardian, but it's not running against live frames right now. The cameras are watching; the farmer is watching the cameras. - Automated patrol and deterrent escalation. Both have been written and rewritten; for now the farmer drives the camera directly.
Under the Hood
The system is distributed across the property. The Mac Mini (Bubba) is the brain: it polls each camera's frame endpoint, runs the VLM scoring, serves the dashboard API, archives curated gems, and pushes everything out through a Cloudflare tunnel. A second machine β Larry, an MSI Dominator near the coop β handles gateway camera services and provides compute close to the birds.
The cameras themselves do their own publishing. The Reolink serves HTTP snapshots from its own firmware. The Samsung S7 runs the IP Webcam app. The USB and laptop cameras are published by small Python services on whichever host they're plugged into. Add a camera to Guardian's config on the Mini, restart, and it shows up on this page within thirty seconds β no website redeploy.
The Cloudflare tunnel is outbound-only. There's no port forwarding, no opening of router firewalls, no static IP. The Mac Mini reaches out to Cloudflare's edge network, and guardian.markbarney.net reaches back through that tunnel.
Snapshot polling β JPEG every second-and-change β replaced an earlier video pipeline. Browsers cap concurrent HTTP connections at six per domain, and four MJPEG streams plus the API polling burned through that budget the moment anyone opened the live page. Snapshots are short-lived requests that work cleanly with HTTP/2 multiplexing.
The website is Next.js 16 on Railway, deployed on every push to main. It pulls live data from the Mac Mini's API; static content lives in MDX files in the repo.
When Things Break
The Mac Mini is the single point of failure. If it reboots β power blip, OS update, kernel panic β the live feeds and the gems pipeline go dark until the processes come back up. The Cloudflare tunnel auto-restarts and so do the per-host camera services, but the central Guardian process itself is currently a manually launched daemon.
Sub-host failures recover or don't, depending on the host. The Gateway laptop has a watchdog service that catches the post-reboot Windows-DirectShow-zombie pattern and restarts the publisher. The S7's IP Webcam app drifts its orientation settings whenever it's killed; another watchdog re-applies them every ten minutes.
When a camera goes down, this page notices. The dashboard above filters to cameras the backend reports as currently producing frames, so a frozen phone or a dead laptop disappears from the grid until it recovers. A camera that the Mac Mini can still see but this page briefly can't reach shows a thin amber "RECONNECTING" strip and holds its last good frame.
Where the Code Lives
Both repos are public on GitHub:
- farm-guardian β the backend. Camera capture, VLM scoring, the gems pipeline, the API this page consumes, and the social-media posters that push to Instagram and Facebook from the Mac Mini.
- farm-2026 β this website. Field notes, the flock roster, the live Guardian dashboard above, and the gem gallery.
Built with OpenClaw and AI tools β Claude, GPT, and others, coordinated through the same platform that runs the farm.
The Story
This started because hawks were taking chickens. In the first week of April 2026, we lost four birds β including Birdgit, a Speckled Sussex who followed you around like a dog. A hawk took her on April 8th.
The response was immediate. Within hours, sky-watch mode was built β locking the PTZ camera onto a fixed overhead position. Alert images were upgraded from blurry 1080p RTSP frames to sharp 4K snapshots. The camera doesn't just patrol anymore β it can hold still and stare at the sky.
Reinforcements arrived the same week: 22 new chicks in the brooder, under heat lamps, next to the Mac Mini that watches over them. Birdadette β the first chick to hatch this season β emerged from her egg on the keyboard, two feet from the machine that would become her guardian.