In this DIY manual a quick guide how to install Motion eye on a pi zero 2 w
First download the new pi imager
Go to “Choose OS” and choose PI OS lite (see next image)
Go to settings and enable SSH, set username and password and fill in the settings for your WiFi.
Choose your SD card and Click “write”.
Boot up your PI zero 2 w and check your router for the IP-adress.
Download Putty and connect to your pi
Log in with the username and password set above
Type the next lines in the console off the pi
reference https://github.com/ccrisan/motioneye/wiki/Install-on-Raspbian-Bullseye
Before Proceeding
- Read the general Installation page first.
- These instructions apply only to an up-to-date Raspbian Bullseye.
- Due to changes in Bullseye (specifically changing from raspivid to libcamera) if you are using an MMAL / CSI ribbon cable camera, and it doesn’t work, please use RaspberryPiOS Buster and the Buster install instructions. These changes do not affect USB or Network cameras. These instructions will be updated when RPiFoundation updates Bullseye. (17 Nov 2021)
- All commands require root; use
sudo
before each command or become root usingsudo -i
. - If you want to use the CSI camera module for the Raspberry PI, make sure you have enabled it in
raspi-config
. - Installation instructions confirmed on RaspberryPiOS 20211030 Lite, on 27 Jan 2022 (Bullseye)
- Installation instructions confirmed on RaspberryPiOS 20211030 Desktop, on 27 Jan 2022 (Bullseye)
- Installation instructions confirmed on RaspberryPiOS 20220128 64 bit Lite on 3 Feb 2022 (Bullseye)
- Installation instructions confirmed on RaspberryPiOS 20220128 64 bit Desktop on 3 Feb 2022 (Bullseye)
Instructions
- Install
ffmpeg
and othermotion
dependencies:apt-get install ffmpeg libmariadb3 libpq5 libmicrohttpd12 -y
- Install
motion
:wget https://github.com/Motion-Project/motion/releases/download/release-4.3.2/pi_buster_motion_4.3.2-1_armhf.deb dpkg -i pi_buster_motion_4.3.2-1_armhf.deb
Use https://github.com/Motion-Project/motion/releases/download/release-4.3.2/buster_motion_4.3.2-1_arm64.deb
for 64 Bit OS
Disable motion service, motionEye controls motionsystemctl stop motion systemctl disable motion
- Install the dependencies from the repositories: (do NOT copy as a block, copy/paste as single lines)
apt-get install python2 python-dev-is-python2 -y curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py python2 get-pip.py apt-get install libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev -y
- Install
motioneye
, which will automatically pull Python dependencies (tornado
,jinja2
,pillow
andpycurl
):pip2 install motioneye
note: Ifpillow
installation fails (hangs and ends at 99%),
you can install it from official repos usingapt-get install python-pil -y
and rerunpip2 install motioneye
. - Prepare the configuration directory:
mkdir -p /etc/motioneye cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf
- Prepare the media directory:
mkdir -p /var/lib/motioneye
- Add an init script, configure it to run at startup and start the
motionEye
server:cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service systemctl daemon-reload systemctl enable motioneye systemctl start motioneye
- To upgrade to the newest version of motionEye, just issue:
pip install motioneye --upgrade systemctl restart motioneye
All commands require root; use sudo
before each command or become root using sudo -i
Allright, the installation of MotionEye is done
Connect to your pi in a webbrowser with the IP-adress of the pi, followed bij portnumber 8765 (http://ipadress:8765)
If you want to add SMB support (you want to transfer your footage to a NAS), you have to edit the following file
/etc/motioneye/motioneye.conf
Change the SMB-shares to “true” do this with nano like this, SUDO nano /etc/motioneye/motioneye.conf
Congratulations your instalation is finished.
OH yes nearly forgot it: to activate the CSI camera you have to edit the raspi-config from the console
Enable the camera and update raspi-config from within this screen
For refenrence, here the motioneye.conf:
motioneye.conf
motionEye uses a configuration file (usually called motioneye.conf
) that allows customizing your setup (including paths, logging, various timeouts and other options that cannot be modified through the UI). The default location for this file is /etc/motioneye/motioneye.conf
and can be changed using the -c
command line switch.
Available Options
conf_path
Defines the folder for the various configuration files used by motionEye. These include motion.conf
, thread-*.conf
(both used by the motion daemon). This folder must be writable by the user with which motionEye runs. Defaults to /etc/motioneye
.
run_path
Defines the folder where pid files are created. This folder must be writable by the user with which motionEye runs. Defaults to the first of the following which exists: /run
, /var/run
, /tmp
, /var/tmp
.
log_path
Defines the folder where log files are created. This folder must be writable by the user with which motionEye runs. Defaults to the first of the following which exists: /log
, /var/log
, /tmp
, /var/tmp
, run_path
.
media_path
Defines the folder where the media files are created, by default. This folder must be writable by the user with which motionEye runs. Defaults to /var/lib/motioneye
.
log_level
Changes the log level of motionEye as well as of the motion daemon started by motionEye. Accepted values are quiet
, error
, warning
, info
and debug
. Defaults to info
.
listen
Defines the IP address on which the motionEye server will listen. Use 0.0.0.0
for all interfaces or 127.0.0.1
for localhost. Defaults to all interfaces.
port
Defines the TCP port on which the motionEye server will listen. Defaults to 8765
.
motion_binary
Instructs motionEye to use a specific motion daemon. The path will be automatically detected by default, using the PATH
environment variable.
motion_control_localhost
Set this to false
to restrict the motion daemon’s HTTP control server to listen on all interfaces. Defaults to true
.
motion_control_port
Defines the TCP port for the motion daemon’s HTTP control server. Defaults to 7999
.
motion_check_interval
Configures the interval in seconds at which motionEye checks if motion is running. Defaults to 10
.
motion_restart_on_errors
Configures whether the motion daemon should be restarted when an error occurs while communicating with it. Defaults to false
.
mount_check_interval
Configures the interval in seconds at which motionEye checks the mounted filesystems (notably SMB/network share mounts). Defaults to 300
.
cleanup_interval
Configures the interval in seconds at which the janitor function is called to remove old media files. Defaults to 43200
(twice a day).
remote_request_timeout
Configures the timeout in seconds to wait for response from a remote motionEye server. Defaults to 10
.
mjpg_client_timeout
Configures the timeout in seconds to wait for a MJPEG frame from the motion daemon. Defaults to 10
.
mjpg_client_idle_timeout
Configures the timeout in seconds after which an idle internal MJPEG client is closed and removed (set to 0
to keep clients connected indefinitely). Defaults to 10
.
smb_shares
Set this to true
to enable management of SMB (network) shares (requires motionEye to run as root). Defaults to false
.
smb_mount_root
Sets the directory where the SMB mount points will be created. Defaults to /media
.
wpa_supplicant_conf
Defines the path to the wpa_supplicant
configuration file used by the system. Set this to enable wifi management from the UI. This is disabled by default.
local_time_file
Defines the path to the localtime
configuration file used by the system. Set this to enable time zone management from the UI. This is disabled by default.
enable_reboot
Enables shutdown and rebooting after changing system settings (such as wifi settings or time zone). This option requires motionEye to run as root. Defaults to false
.
smtp_timeout
Configures the timeout in seconds to use when talking to the SMTP server. Defaults to 60
.
list_media_timeout
Configures the timeout in seconds to wait for media files list. Defaults to 120
.
list_media_timeout_email
Configures the timeout in seconds to wait for media files list, when sending emails. Defaults to 10
.
zip_timeout
Configures the timeout in seconds to wait for zip file creation. Defaults to 300
.
timelapse_timeout
Configures the timeout in seconds to wait for timelapse file creation. Defaults to 300
.
add_remove_cameras
Set this to false
to disable adding and removing of cameras from the UI. Defaults to true
.
validate_certs
Controls whether HTTPS/SSL certificates are validated by various clients used by motionEye, or not. Defaults to true
.
password_hook
Sets the full path to an external program to be executed whenever a password changes. The program will be invoked with environment variables MEYE_USERNAME
and MEYE_PASSWORD
set accordingly. This is unset by default.
http_basic_auth
Enables HTTP basic authentication scheme (in addition to, not instead of the signature mechanism). Defaults to false
.
server_name
Overrides the server hostname.