Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you control GPIO with raspberry pi when it detects motion? /\ Question #1697

Closed
Damakermiddle opened this issue Oct 29, 2018 · 2 comments
Closed

Comments

@Damakermiddle
Copy link

@Damakermiddle Damakermiddle commented Oct 29, 2018

Preliminary Docs

I confirm that I have read the CONTRIBUTING guide before opening this issue.

I confirm that I have read the FAQ before opening this issue.

motionEyeOS Version

I am running motionEyeOS version: 20180602

Board Model

I am using the following board/model:Raspberry PI 3B+

Camera

I am using the following type of camera: MMAL
My camera model is: Raspberry pi 1.3 Standard.

Network Connection

My motionEyeOS unit is connected to the network via: WIFI

How do you control GPIO with raspberry pi when it detects motion?

@gitgoldberg
Copy link

@gitgoldberg gitgoldberg commented Oct 29, 2018

First check out the Action Buttons example here:
https://github.com/ccrisan/motioneyeos/wiki/Action-Buttons

Then connect to your motioneyeOS Raspberry Pi through the web interface and look for the Motion Notifications option (near the bottom):
Run a command
Run an end command

Create two files in /data/etc contains your bash scripts to control the GPIO, as per the Action Buttons example, one script to make your GPIO HIGH, the other to make it LOW.
Remember to make these script files executable using: chmod +x your_script_name
Finally plug the full path name of each script file into the 'Run a command' and 'Run an end command' boxes in motioneyeOS. Might have to reboot.

I've tested this recently and the 'Run a command' script is executed when motion is first detected, and the 'Run an end command' script is executed when the motion event ends.
Hope this helps.

@Damakermiddle
Copy link
Author

@Damakermiddle Damakermiddle commented Oct 30, 2018

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.