Recently I embarked on a “fun” project quest to set up a “security” camera to observe the walkway to my front door. My door doesn’t have a peephole, although I might eventually add one, and by the time some stranger has rung my doorbell, it’s too late to see them through the nearest window.
So, the RPi Zero W (for WiFi) with the Pi Camera V1.2 integrated into the case seemed like a good place to start. The RPi Zero (which I’ll abbreviate to “RPi0”) is tiny - only half the area of a 3in X 3in (7.5cm X 7.5cm) Post-It note.
I installed RPiOS (Bullseye), and the MotionEye
package (not MotionEyeOS
, which is apparently defunct), and prerequisites/dependencies. However, I couldn’t seem to get MotionEye
fully functional, so I eventually opted to just use the motion
package without it. (MotionEye
, as far as I can tell, is just a configuration interface for the motion
package, with some added useful features.)
I learned that Bullseye
introduced some changes that affect Pi camera operation - use of libcamerify
instead of raspivid
, etc. - so I’ve been reading up on how to set it up for motion-activated video and stills. I adjusted the motion.conf
settings, attached (via Velcro) the RPi0 to a slat in an upstairs window blind, angled it down at the approach to my door, and started libcamerify motion
via ssh
from my other Pi, which is powered on 24/7, screen locked.
Success:
Motion-activated video clips and still pictures get saved to a small USB drive I’ve attached to the RPi0, which I can access across my LAN via sftp
.
I’m not concerned about physical security of this USB drive and the stored pictures, as my goal is simply to know who is, or was, at my door. Using the USB drive will prevent a lot of wear and tear on the RPi0’s micro-SD card, and I’ve set a cron
job to periodically auto-delete the image and video files older than 1 day from the USB drive: 0 0 * * * find /media/my_home-folder/USBdrive -type f -mtime +1 -delete
)
Failure:
I haven’t been able to successfully stream video, i.e. live, from the camera to any of my machines, whether in Firefox (LibreWolf, actually), or in VLC Media Player.
It seems there are plenty of people with the same problem posting all over the internet, but trying to sift through all the noise and outdated recommendations, (Buster
vs. Bullseye
and such), has gotten me nowhere so far. Hope springs eternal, though! Ideas welcome!
Could also be Improved:
Across my LAN, I can open and view my image and video files over sftp
from any of my computers, even the Librem 5 ( ):
I generally have at least one computer powered on when I’m at home, so I can access the files at will.
I need to set up some form of auto-notification for detected motion, though, because the stored image directory doesn’t refresh itself, meaning I have to manually refresh it to see if there are any newly captured images, i.e. if anybody is at my door. (Hence the need to get streaming working.)
It can take quite some time to repopulate the many, many files that might have been stored throughout the day, so it’s not ideal to have to refresh the directory… unless I want everybody who rings my doorbell to go away before I get to the door. (If that were the case, I could just avoid ever answering the bell and not even bother with the camera. )
I know it’s possible to set up alerts by email, or with certain messenger applications, and possibly get pop-up notifications over the LAN (?), so I’ll be researching those more, especially if I don’t figure out streaming. (Ideas welcome here, too.)
Incidentally, I don’t intend to expose the camera to the internet at large, so no worries there.
===
Somewhat related threads: Home security cameras and Security: Anyone Using Security Cameras w/ L5?