Read the statement by Michael Teeuw here.
MMM-PIR-SENSOR not working
-
i can switch off and on my display by simply typing
sudo tvservice -o
andsudo tvservice -p
-
why are you using a MM module?
This is not related to the mirror itself. Use @cowboysdude (how funny is that in this context ;) ) script.
You can find it in his github respository. By the way, this dude creates really cool stuff, so its worth to have a closer look to it.If your PIR is cabled well, it should work easily.
-
mba , I had the same issue but only because you have to force one detection, just the first time after you start magic mirror software. Then everything should be ok and working. So, after magic mirror is up and running, try to pass an hand in front of the sensor, then wait to see if it will turn off.
-
I had the same problems and I dont know why. So I searched for another solution. Now it works perfect.
I wrote one bash script for the power off and one for the power on.Script Power on:
vcgencmd display_power 1Script Power off:
vcgencmd display_power 0than I used this Pyhton for the PIR
#!/usr/bin/env python import sys import time import RPi.GPIO as io import subprocess io.setmode(io.BCM) SHUTOFF_DELAY = 300 # seconds PIR_PIN = 25 # 22 on the board LED_PIN = 16 # 36 on the board def main(): io.setup(PIR_PIN, io.IN) io.setup(LED_PIN, io.OUT) turned_off = False last_motion_time = time.time() while True: if io.input(PIR_PIN): last_motion_time = time.time() io.output(LED_PIN, io.LOW) print ".", sys.stdout.flush() if turned_off: turned_off = False turn_on() else: if not turned_off and time.time() > (last_motion_time + SHUTOFF_DELAY): turned_off = True turn_off() if not turned_off and time.time() > (last_motion_time + 1): io.output(LED_PIN, io.HIGH) time.sleep(.1) def turn_on(): subprocess.call("sh /home/pi/MagicMirror/pir/monitor_on.sh", shell=True) def turn_off(): subprocess.call("sh /home/pi/MagicMirror/pir/monitor_off.sh", shell=True) if __name__ == '__main__': try: main() except KeyboardInterrupt: io.cleanup()
I tryed to upload but not enough privileges
-
@sek_is_back hi know this is old but where do you save the scripts to, to make them function?