Using motion to deactivate screensaver

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

Using motion to deactivate screensaver

Post by /RaspberryPi »


Tl;Dr motion on_event_start action works when starting motion manually from terminal, but action doesn't work when starting motion with cron job

I'm having some trouble setting up my rpi to wake from a screensaver when it detects motion on the webcam.

I've configured the motion.conf file and set the one_event_start command to deactivate the screensaver.

Now, everything works if I start motion manually from the terminal. I'll start motion 'sudo motion', wait for the screensaver to display, move in view of the camera, and the screensaver deactivates. Everything is perfect.

The problem is I want this process to be fully automated. I saved the 'sudo motion' command in a bash script and then set up a cron job to run the bash script 30 seconds after a reboot. It looks like the cron job starts motion because my camera activates, but when I move into the view of the camera, the screensaver doesn't activate.

It only happens when running motion at start up rather than manually executing it. I have tried local user crontab, I have tried sudo crontab, I have played around with run bash scripts versus just running the commands in cron, local user vs sudo when running motion commands, local user vs sudo when running on_event_start actions. I feel like I've tried everything but the right thing. I'm open to any suggestions...
submitted by /u/kalvinc2113
[link] [comments]

Source: https://www.reddit.com/r/raspberry_pi/c ... reensaver/
/RaspberryPi
Post Reply

Return to “Raspberry Pi Forum”