Raspberry Pi Zero - Dockerized Motion Detection
486
-This a docker image that is build to detect motion and record the footage.
-This image is based on Raspberry pi zero W (arm6l arch).
-This has been tested to work with Logitech C170 USB webcam.
-This is a beta version of the project and many more tweaks to be made.
Raspberry Pi Zero W [Raspberry Pi or Raspberry Pi 3 also should ideally work.]
Docker 18.06.1-ce installed on Pi Zero.
USB webcam.
Sufficient disk space left on your SD to store the footage.
Lots of patience :)
-On your raspberry pi, create a folder to store the footage. Example, name it as surv.
mkdir ~/surv
-Plug in your USB webcam to your Raspberry PI Zero, and then run the following to verify that it is detected.
lsusb
dmesg
-You should ideally see the USB webcam in the dmesg logs and in the lsusb outputs.
To run the docker container, run the following:
docker run -dit --net=host --privileged -v /dev/video0:/dev/video0 -v ~/surv:/footage --name watchtower techantidote/motion motion -n
http://ip-of-your-pi:8081
-If you are testing the configuration, you can try the following:
docker run -dit --net=host --privileged -v /dev/video0:/dev/video0 -v ~/surv:/footage --name watchtower techantidote/motion
Now from inside the container, you can make changes to your configuration files and then start the motion service manually using the following:
service motion start
You can make now changes on the fly and then restart the motion service:
service motion restart
I have already added the configuration files in the docker image. If you need to tweak the setting, below are the two configuration files:
/etc/motion/motion.conf
/etc/default/motion
Log File Location: /var/log/motion/logs
-If you would to view the log files real time, you run the following:
docker exec -it watchtower tail -f /var/log/motion/logs
Base image used for building the image => resin/rpi-raspbian:stretch
If you would like to contribute to this project, feel free to reach out to me at twitter.
https://twitter.com/techantidote
Content type
Image
Digest
Size
170.8 MB
Last updated
over 7 years ago
docker pull techantidote/motion