MotionEyeOS
Here are some notes of setting up MotionEyeOS on a RaspberryPi Zero with a mounted camera module. I used a camera module without infrared filter (Pi NoIR) so it should be better low light conditions.
See also:
Installation
cd /path/to/directory/ # List partitions lsblk | grep -v loop # Download the write script and make it executable wget https://raw.githubusercontent.com/ccrisan/motioneyeos/master/writeimage.sh chmod +x writeimage.sh # Write the image, and include Wifi settings, BE CAREFUL - ALL DATA WILL BE LOST ON THE DISK sdX! sudo ./writeimage.sh -d /dev/sdX -i "motioneyeos-raspberrypi-20190413.img.xz" -n 'WifiNetworkName:PassKey'
Configure Wifi for headless boot
If not done during 'writeimage.sh'.
Setup Wifi without ssh, monitor or keyboard by creating this file on the FAT boot partition.
sudo nano /boot/wpa_supplicant.conf
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="WeeFee2"
psk="WeeFee2-PassKey-Here"
}
Ssh
ssh admin@192.168.1.0
Setup a key to allow you to login without the password:
Require password
The default password is empty, start the web interface with the admin user and change the password for admin and user there.
Tweaks
Git webpage
Network File Storage
The router (192.168.1.1) has network share capability with Samba, settings in MotionEyeOS admin console:
- Type: Network share
- Server: 192.168.1.1
- SMB Protocol: 1.0
- Share name: rpicam
- User: ***
- Password ***
- Root directory: /
Nautilus file explorer location:
- smb://192.168.1.1/rpicam/
Settings for better picture with low light conditions
The standard settings don't handle low light conditions very well. In order to improve on this, a script was created to apply low light settings between sunset and sunrise. More info:
These settings can be added In the extra motion settings box or in the configuration file. Settings that are controlled by MotionEye will be overwritten and disappear.
Note:
- Higher framerates will make the picture darker
- With daylight these settings may lead to overexposure
- Moving objects may be blurred beyond recognition
Example 1:
mmalcam_control_params -ex night
Example 2:
mmalcam_control_params -ex sports -ev 25 --shutter 256000 auto_brightness on hue 0 saturation 5 brightness 255 contrast 1
These settings can also be modified in the configuration file (thread-1.conf for Camera 1):
nano /data/etc/thread-1.conf
Source:
Writable root or boot partitions
De data (/data) partition is the only writable partition. Whenever you need to change something on either root (/) or boot (/boot) partitions, run the following commands to make them writable:
ssh admin@192.168.1.14
Root:
mount -o remount,rw /
Boot:
mount -o remount,rw /boot
rsync backup restore
- Extract the backup to /path/motioneye-config
- Mount the sdcard
- Check the mountpoint name, you need the data partition, it should be the biggest of the three boot is +-30MB, systtem is +-200MB
- Sync (this will remove any files that are currently in the etc folder:
Backup:
sudo zip -r /home/wilbert/Scripts/motionEyeOs/etc.zip "/media/wilbert/2e0d8f11-bddd-4420-887c-08d58ff5738f/etc/"
Replace:
sudo rsync --info=progress2 --force -rltWDEHXAgoptx --delete "/path/motioneye-config/" "/media/user1/2e0d8f11-bddd-4420-887c-08d58ff5738f/etc/"