How to Set Up MotionEye Surveillance on Raspberry Pi with an OpenClaw Agent
MotionEye turns a Raspberry Pi into a multi-camera surveillance system with browser-accessible live feeds and motion-triggered recording. Its pixel-change detection catches everything that moves, including shadows and swaying branches. This guide covers installing MotionEye, tuning detection zones, and deploying an OpenClaw agent that triages events through cloud AI to filter false positives and archive the clips that actually matter.
The False Positive Problem in Pi Surveillance
Frigate NVR's custom-trained models report 95-100% detection accuracy when classifying people, vehicles, and animals. That accuracy requires a Coral TPU ($25-60 on top of the Pi itself), Docker, and YAML configuration that goes well beyond what most hobbyist camera projects call for. MotionEye takes the opposite approach. It runs on hardware as modest as a Pi Zero W, boots from an SD card, and gives you a browser-based interface for managing multiple cameras with minimal setup.
The tradeoff is detection quality. MotionEye uses pixel-change analysis: it compares consecutive frames and triggers when enough pixels shift between them. Every shadow crossing your driveway, every tree branch moving in wind, every car headlight sweeping across a wall counts as motion. The result is a notification stream where the events you care about are buried in noise.
An OpenClaw agent bridges this gap without requiring new hardware. Running alongside MotionEye on the same Pi, the agent receives motion-triggered webhooks, sends the captured snapshot to a vision-capable LLM for classification, and decides whether to alert you or archive the event quietly. You keep MotionEye's lightweight stack and add selective intelligence on top.
MotionEye itself is in good shape for 2026. The project migrated to the motioneye-project GitHub organization after the original maintainer stepped away, and the 0.43.x pre-release series introduced Motion 4.4-4.6 support, Argon2 password hashing, and WebDAV network drive storage. MotionEyeOS, the standalone OS image that used to ship as a turnkey surveillance distro, has not been updated since June 2020 and should not be used for new installations. The application version, installed on standard Raspberry Pi OS, is the active and recommended path.
What You Need Before Getting Started
A working MotionEye plus OpenClaw setup needs a Pi with enough headroom to run both services alongside camera processing.
Hardware
- Raspberry Pi 4 (4 GB RAM) or Pi 5 (4-8 GB recommended)
- Camera Module 3 ($25), USB webcam, or IP camera accessible on your network
- MicroSD card, 32 GB minimum (64 GB or larger if you plan to record locally)
- Power supply rated for your model: 5V/3A for Pi 4, 5V/5A for Pi 5
- Optional: USB SSD for better write endurance and faster storage
Software
- Raspberry Pi OS Lite 64-bit (Bookworm or newer)
- Python 3 and pip for MotionEye
- Node.js 24 for OpenClaw
- 2 GB swap file (OpenClaw's gateway benefits from swap on 4 GB boards)
Accounts
- API key for a cloud LLM with vision support (Claude, GPT-4o, or similar)
- Optional: Fastio account for cloud clip storage (the free tier gives you 50 GB, no credit card required)
Pi 5 users should note that the Camera Module 3 uses the libcamera stack instead of the legacy V4L2 interface that MotionEye expects. A v4l2loopback bridge handles the translation, covered in the next section. USB cameras and IP cameras work without the bridge.
Total hardware cost for a Pi 4 with Camera Module 3 comes in under $75. If you already own the Pi, any USB webcam works for testing at no extra cost.
How to Install MotionEye and Add Cameras
Start with a fresh Raspberry Pi OS Lite 64-bit install. Update the system and install MotionEye's dependencies:
sudo apt update && sudo apt upgrade -y
sudo apt install -y python3-pip python3-dev libffi-dev libzbar0 libcurl4-openssl-dev
Install MotionEye and initialize the service:
sudo pip3 install motioneye
sudo motioneye_init
This creates the configuration directory at /etc/motioneye and starts MotionEye as a system service. Open a browser and navigate to your Pi's IP on port 8765 (for example, http://192.168.1.100:8765). The default login is "admin" with an empty password. Change both credentials before doing anything else.
Adding cameras
Click the camera dropdown in the top-left corner and select "add camera." For a directly connected camera (USB or CSI), choose "Local V4L2 Camera" and pick the device from the list. For a network camera, choose "Network Camera" and enter the RTSP or MJPEG stream URL your camera provides.
Pi 5 with Camera Module 3
The Camera Module 3 on Pi 5 does not appear as a V4L2 device by default. Install the v4l2loopback kernel module and pipe the libcamera output through it:
sudo apt install -y v4l2loopback-dkms ffmpeg
sudo modprobe v4l2loopback
libcamera-vid -t 0 --width 1920 --height 1080 --codec mjpeg -o - | \
ffmpeg -i - -f v4l2 /dev/video10
Run this command as a systemd service so it persists across reboots. MotionEye will then see /dev/video10 as a standard V4L2 camera that you can add through the web interface. If you hit permission issues on /dev/video10, add the motioneye user to the video group and restart the service.
Docker alternative
If you prefer containers, MotionEye publishes an official Docker image. This avoids pip dependency conflicts and keeps MotionEye isolated from the rest of your system. Mount your recording directory as a volume so clips persist outside the container.
How to Configure Motion Detection and Reduce False Triggers
MotionEye's motion detection compares consecutive frames for pixel changes. Out of the box, it triggers on nearly everything. Three adjustments bring it down to a useful signal level.
Frame change threshold
In the camera settings under Motion Detection, the "Frame Change Threshold" controls what percentage of the image must change to register as motion. Set this to 5-10% for outdoor cameras where wind and clouds create constant low-level pixel shifts. Use 1-3% for indoor cameras with controlled lighting where any real movement is significant.
Motion masks
Click "Configure Motion Mask" to paint areas MotionEye should ignore. Mask out roads with regular traffic, tree lines, and any zone where expected movement is not worth tracking. This is the single most effective tuning step. Masking a busy sidewalk at the edge of your camera's field of view can eliminate the majority of false triggers from that feed.
Recording and storage
Under "File Storage," set the recording directory. The default path is /var/lib/motioneye on the SD card. If you have a USB drive mounted, point MotionEye there instead to avoid SD card wear from constant write cycles. Enable "Automatic Disk Cleanup" at 80-90% disk usage so the oldest recordings are deleted first.
Set recording mode to "Motion-Triggered" rather than continuous unless you have substantial storage. MotionEye saves both a short video clip and a JPEG snapshot per motion event. The snapshot is what the OpenClaw agent will analyze for classification.
Webhooks for external processing
Under "Motion Notifications," enable "Call a Web Hook" and enter a local URL that the OpenClaw agent listens on. MotionEye sends an HTTP request each time it detects motion, including the camera name and event timestamp. This webhook is the connection point between MotionEye's pixel-level detection and the agent's classification layer.
Search your surveillance clips by what happened, not when
Free 50 GB workspace for your OpenClaw agent's clip archive. Auto-indexing makes every upload searchable by content. No credit card required.
Deploying an OpenClaw Agent for Event Triage
OpenClaw is an open-source, self-hosted AI agent gateway. It connects messaging channels and local services to cloud LLMs through a skill-based architecture. On a Raspberry Pi, it works as a lightweight event processor: receive a webhook, run a skill, route the result.
Installing OpenClaw
The official Raspberry Pi guide recommends a Pi 5 with 4-8 GB RAM and a USB SSD for the best experience. A Pi 4 with 4 GB handles low-traffic setups. The install process covers Node.js 24 setup, swap configuration, and the one-line install script. Configuration persists in ~/.openclaw/ and the gateway starts automatically at boot.
The event triage pattern
The workflow connecting MotionEye to the OpenClaw agent follows four steps:
- MotionEye detects pixel-change motion and fires a webhook to the local OpenClaw gateway
- An OpenClaw skill receives the webhook payload, then fetches the snapshot JPEG from MotionEye's local storage directory
- The skill sends the image to a vision-capable LLM with a classification prompt (for example: "Classify this surveillance frame as person, vehicle, animal, or environmental noise such as shadows or weather")
- Based on the model's response, the skill either pushes an alert through your preferred messaging channel or logs the event silently
OpenClaw supports over 20 messaging channels including WhatsApp, Telegram, Slack, and Discord. A person at your front door triggers an instant notification with the snapshot attached. A shadow crossing the driveway gets archived and ignored.
Building a custom triage skill
The ClawHub marketplace hosts over 13,000 community-built skills, and writing your own for surveillance triage is straightforward. The skill accepts the webhook payload, reads the snapshot file, calls the vision API, and routes the result based on the classification.
You can layer additional logic on top of the basic classify-and-route pattern. Track the number of events per camera per hour and flag unusual spikes. Suppress duplicate alerts within a cooldown window so you are not pinged five times for the same delivery driver walking back and forth. Escalate selectively: low-confidence classifications (the model is unsure whether the shape is a person or a large dog) save the clip for later human review instead of sending an immediate alert. High-confidence detections skip the queue entirely.
The key advantage over replacing MotionEye with Frigate is that you keep MotionEye's simpler setup and lower hardware requirements. The compute-heavy part (image classification) runs in the cloud, not on the Pi.
Persistent Cloud Storage for Surveillance Clips
MotionEye records to local storage by default. SD cards degrade under constant write cycles, and even a 64 GB card fills in days of active motion recording. A cloud archive for the clips that matter solves both the durability and capacity problem.
Local storage as a rolling buffer
Keep MotionEye's automatic disk cleanup enabled so the local drive acts as a short-term buffer. All motion recordings land locally first. The OpenClaw agent triages each event and uploads only the clips classified as significant. This means your cloud storage holds person and vehicle detections, not every shifting shadow from a windy afternoon.
Cloud options compared
S3-compatible storage (AWS, Backblaze B2, Wasabi) works well if you are comfortable managing buckets, IAM policies, and lifecycle rules. Google Drive and Dropbox handle personal setups but hit API rate limits quickly under automated upload patterns.
Fastio provides workspace-based storage designed for agent-driven file workflows. The free tier includes 50 GB, 5,000 API credits per month, and five workspaces with no credit card or trial expiration. Your OpenClaw agent can write clips to a Fastio workspace through the Fastio MCP server, organizing files by camera name, date, and event classification.
Fastio workspaces support Intelligence Mode: once enabled, uploaded files are automatically indexed for semantic search. Instead of browsing timestamp-sorted folders, you can search by content. A query like "front door person detections this week" returns matching clips without manual tagging or folder structures.
The agent-to-human handoff is where a shared workspace pays off. The agent writes clips. You review them in the browser, share specific recordings through branded links with granular permissions, and maintain a full audit trail of who accessed what. If you need to share footage with a property manager or security provider, the access controls are already in place.
For OpenClaw-specific workspace setup and MCP endpoint configuration, see the Fastio MCP documentation.
Frequently Asked Questions
How do I install MotionEye on Raspberry Pi 5?
Install MotionEye via pip on Raspberry Pi OS Bookworm 64-bit. The Pi 5 uses the libcamera stack, so Camera Module 3 users need a v4l2loopback bridge to create a virtual V4L2 device that MotionEye can read. USB cameras and IP cameras work without the bridge. Docker is also a solid option and avoids dependency conflicts with the host system.
Is MotionEye still maintained in 2026?
Yes. The project moved to the motioneye-project GitHub organization and is actively developed. The 0.43.x pre-release series added Motion 4.4-4.6 support, Argon2 password hashing, and WebDAV network drive storage. MotionEyeOS, the standalone OS image, has not been updated since June 2020 and is not recommended for new installs.
How many cameras can MotionEye handle on a Raspberry Pi?
There is no hard-coded camera limit. Practical capacity depends on resolution, frame rate, and your Pi model. A Pi 4 with 4 GB RAM typically handles four to six cameras at 720p and 5 fps without issues. A Pi 5 with 8 GB can manage more. Higher resolutions and frame rates consume proportionally more CPU and memory per camera feed.
What is the difference between MotionEye and Frigate?
MotionEye uses pixel-change motion detection and runs on minimal hardware including the Pi Zero W. Frigate uses ML-based object detection to classify people, cars, and animals, and benefits from a Coral TPU for hardware-accelerated inference. Frigate needs more resources (Pi 4 or better, Docker, YAML config) but is far more accurate at identifying what triggered the motion. MotionEye is simpler to set up and lighter on hardware.
Can OpenClaw run on the same Raspberry Pi as MotionEye?
Yes, on a Pi 4 with 4 GB RAM or any Pi 5 model. OpenClaw's gateway is lightweight because it sends inference requests to cloud LLMs rather than running models on the Pi itself. Both services coexist comfortably on a single board, and the local webhook connection between them avoids network round trips.
What happens to recordings when the internet goes down?
MotionEye continues recording locally regardless of connectivity. Motion detection and local storage work entirely offline. The OpenClaw agent's cloud-based classification pauses until the connection returns, so during an outage you get raw recordings without AI triage. Once connectivity is back, unprocessed events can be run through the agent retroactively.
Related Resources
Search your surveillance clips by what happened, not when
Free 50 GB workspace for your OpenClaw agent's clip archive. Auto-indexing makes every upload searchable by content. No credit card required.