Motion - Support Question 2012x 01x 25x 140642

How to configure to capture only at specified times of day

Question

I would like to start the motion detection after a particular time of the day, say from 5pm until 7 am in the morning the next day. Is there a simple way to do this? I have searched in the FAQ and answered question sections and have not found anything related to capture times. Any help will be greatly appreciated.

thanks

ALV

Environment

Motion version: 3.2.11
ffmpeg version: 0.5.1
Libraries: ffmpeg, mysql, postgresql
Server OS: Ubuntu 10.04
-- AlbertoLopez - 25 Jan 2012

Answer

How do I make time based motion settings?

You use a combination of the Motion remote control and the Linux cron daemon which all Linux
systems have. Let us take the example that we want to enable motion detection at 9:00 in the
morning and turn it off at 18:00. Motion 3.1 must be built with xmlrpc. If you use 3.2 Motion
is remote controlled using a browser.

In the file /etc/crontab we add these lines.

motion 3.1:

0 9 * * * root /usr/local/bin/motion-control detection resume
0 18 * * * root /usr/local/bin/motion-control detection pause

motion 3.2

From motion 3.2 there is no longer a motion-control program. Instead you use a program that
can fetch a webpage. We simply just throw away the html page that Motion returns. Programs
commonly available on Linux machines are wget and lwp-request.

0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null
0 18 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/pause > /dev/null

Most Motion config options can be changed while Motion is running except options related to
the size of the captured images. So only your fantasy sets the limit to what you can change
combining cron and the remote control interface for Motion.
Topic revision: r2 - 13 Feb 2012, DavidHorner
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.