Sign inSign up

techantidote/motion

By techantidote

Updated over 7 years ago

Raspberry Pi Zero - Dockerized Motion Detection

Image
0

486

techantidote/motion repository overview

Motion

-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.

Requirements

  • 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 :)

Setting up your Raspberry PI:

-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
  • To view the live stream, open a browser and go to:

http://ip-of-your-pi:8081

Alternative method: (Suited while testing)

-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

Config Files

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 Files:

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

Credits/References:

Contribute to this project.

If you would like to contribute to this project, feel free to reach out to me at twitter.

https://twitter.com/techantidote

GitHub Page

https://gitlab.com/techantidote

Tag summary

Content type

Image

Digest

Size

170.8 MB

Last updated

over 7 years ago

docker pull techantidote/motion