Read the statement by Michael Teeuw here.
MMM-PIR-Sensor is turning off the screen when it detects user?
-
@cowboysdude Thanks for the tip, it does seem like a lot less hassle.
-
@cowboysdude Trying to give this a shot, cloned it into /home/pi/Pir-Sensor/ and changed the shutdown/startup files and confirmed they work, running with sh.
/opt/vc/bin/tvservice --preferred && sudo chvt 6 && sudo chvt 2
#! /bin/bash /opt/vc/bin/tvservice -o
In my crontab I have:
@reboot python cd /home/pi/Pir-Sensor/pir.py &
but it doenst look like its doing anything on reboot, ive confirmed the sensor is working correctly and i’ve run the chmod commands.
-
@Mar I kept it really simple on mine… no directories just put the files directly into the root directory… that way didn’t have to figure out paths and such.
Also this has to match how your’s is setup… in the pir.py file:
io.setmode(io.BCM) SHUTOFF_DELAY = 20 # seconds PIR_PIN = 17 # Pin 11 on the board
-
@cowboysdude Great i’ll move it across and keep it simple. And yes my sensor is installed to your default pin. Just so I can get an idea if its working, when would the screen shut off? Is this before MM loads or after?
-
@Mar Because it’s not mirror related it will shut off and turn on if the mirror is running or not … :)
Hang in there it took me a bit to get it working … not being sure how the PIR sensor is setup [should be two screw settings on the sensor one is timing the other is sensitivity]…
-
@cowboysdude Perfect, so I should expect it to shut off by the time the system loads to the prompt.
Yes it has two sensors, one for sensitivity and the other for how long to send the active signal. Suppose I’ll just play around a bit. Maybe i’ll try find the logs for wherever it tells you when cron jobs have run. Not having any luck so far. i might be doing the cron part wrong, i’ve never played around with cron jobs before.
Im thinking its the pir.py script as I’ve done the cron job right I think.
edit: locations of the startup and shutdown script in pir.py need to be updated! Doh!
-
Yes you should be able to start everything up… then walk away and see what happens… what I did was once the mirror was loaded I took a towel and covered the PIR Sensor… ;) Then once the screen went out I took it off and waved my hand in front of it and it came back on :)