John
John

Reputation: 11

Raspberry Pi Motion on_motion_detected not running gphoto2 script

I'm trying to get Motion to trigger gphoto2 with on_motion_detected.

I can get this event to run a bash script, I can get it to run a python script. If either of those calls gphoto2 it fails.

Running the bash scrip or python script from the command line works. So the problem is probably something that is too in the weeds for me to figure out. Over on Reddit, a user with a similar problem found a solution by adding Motion as a user to the plugdev group. I tried that, but it didn't work for me.

https://www.reddit.com/r/raspberry_pi/comments/cqnuqh/help_gphoto2_and_motion_as_camera_trigger/

in motion.conf:

on_motion_detected /bin/bash /home/pi/Scripts/script.sh

and the script:

#!/bin/bash
gphoto2 --capture-image

Motion is using a Raspberry Pi Camera Module 2, and I'm trying to trigger a Sony A7Rii with gphoto2. Again, each works on its own separately, just not together.

Upvotes: 0

Views: 258

Answers (0)

Related Questions