motionEyeOS
- 4 minutes read - 844 wordsmotionEyeOS
I chose to use motionEyeOS for my security camera OS because it’s:
- purpose built for cameras on the Raspberry Pi
- it has all the features that I was looking for in a home-built security camera, including motion detection
- there’s also a lot of documenation online that can help with questions you might run into
Installation
I am using a Raspberry Pi Zero W and a NoIR camera, so if you’re using something different, you might have a different experience.
There’s no Ethernet connection on the Pi Zero W, so you’ll need to configure your WiFi connection before you boot.
What you’ll need to have before your final configuration:
Your WiFi SSID(s) and password(s)
Do you want to access your camera from outside your home network? In that case, you’ll probably want to set a static IP for your camera. You can do this either by assigning a static IP in the camera configuration (as part of the installation or post install configuration), or set it on your router’s DHCP server settings.
I went through the installation process a few times and I found this flow to work the easiest for me.
-
Follow the installation instructions to write the image on the SD card. See the suppored devices here to get the correct image for your board. The instructions use a script that you’ll run from the command line, but you can also use balenaEtcher if you prefer. I preferred to use Etcher because I wanted to add more networks to the
wpa_supplicant.conf
file. -
If you use Etcher, you’ll need to setup the WiFi connection by hand. Create and copy the
wpa_supplication.conf
file to your SD card. Instructions for creating the file are in the section below.
Wifi Preconfiguration
Create a wpa_supplicant.conf
file that you will copy to your /boot
directory. This will be copied to /data/etc/wpa_supplicant.conf
when the Pi boots, and then this file will be removed from /boot
. The Pi should connect to the SSID you configured.
This is a sample wpa_supplicant.conf
file. You can add additional networks if you’d like to have a failover, or if you take your device to other locations. The higher the priority, the more desirable the network. You can find all the details at the man page
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="YOURSSID_1"
psk="YOURPASSWORD_1"
scan_ssid=1
priority=10
network={
ssid="YOURSSID_2"
psk="YOURPASSWORD_2"
scan_ssid=1
priority=1
}
MontioneyeOS WiFi Preconfiguration instructions
Configure motionEyeOS
Point your browser to the IP address of your Raspberry Pi and login with the default credentials of admin
and no password. You’ll want to set a password. These will also be the credentials you’ll use to ssh to your Pi.
Below, I’ve described a few specific settings you’ll want to consider, but otherwise, play around with the settings and see how you like the results. There is a handy help description for every setting that you can access by hovering with your mouse, and then select the ? question mark.
Extra Motion Options for NoIR Camera
If you have a NoIR camera, you’ll want to go to the Video Device
section and add mmalcam_control_params -awb greyworld
to the Extra Motion Options
box. That will remove the pink tint from your camera images.
Motion Notifications
One of the motionEyeOS features that I wanted to try out is the built-in motion detection. You can set how many motion frames have to be detected before a motion notification is triggered. There are settings that help reduce false alarms like Light Switch Detection
and Auto Noise Detection
. After a bit of tweeking I was able to reduce the false alerts, but I still get a lot, especially from shadows cast by trees when the wind is blowing.
You can configure alerts to notify you by:
- Webhooks
- Commands (these can run scripts)
I chose to use the command notification that calls an API that I wrote and run in AWS. I’ll share that in a future article.
Thoughts and Impressions
I’ve had the motionEyeOS running on my cameras for more than six months and I am very happy with the feature set. They are also very reliable and I’ve not had to reboot them at all.
The issues I have experienced are with the sensitive motion detection, but I think I have some more work I can do there to help reduce the false alerts.
The other issue is with remote access since motionEyeOS only runs http and not https. But I decided to use Cloudflare tunnels for my remote access, and I think that’s a stronger security solution than opening ports on my firewall. Now there are no open ingress ports on my firewall.
Overall, this is a great hobby project and you get a lot of bang for the buck. Speaking of which, consider donatating to the motionEyeOS developer (scroll to the bottom of the page) if you like the software.
In the next article, I’ll share how I have my network configured using security zones and how remote access is controlled by (free) Cloudflare tunnels.
Have you tried motionEyeOS for your security cameras? Do you prefer another OS?