Read the statement by Michael Teeuw here.
MMM-PIR-SENSOR not working
-
@cruunnerr I’m using the correct pin. I made a python script shown below:
from gpiozero import MotionSensor
pir = MotionSensor(22)
while True:
if pir.motion_detected:
print(“motion detected”)
else:
print(“NOTHING”)With this it will print nothing until i wave my hand in front of it then motion detected until i stop. So I know for a fact the PIR sensor is connected and working properly. Also there are no errors when I start magic mirror the only thing that is mentioned about MMM-PIR-Sensor is it says no helper found for module: MMM-PIR-SENSOR. Anyone have any idea
-
have u tried to delete the Pir Folder in your modules direction and start a simple new installation of the module?
or just go into the MMM-PIR-Sensor folder and type
npm install
again? -
@cruunnerr I just deleted the entire module and downloaded it again, following the instructions directly from the page.
To summarize, I know the sensor is working properly and connected to the right pin listed in the config file. I know nothing is wrong with the module i just downloaded it from github. I’ve posted the exact copy of my config file, no one seems to have a problem with that. What else could it be? For some reason the monitor wont shut off.
Its a Benq monitor connected to the raspberry pi via an hdmi cord.
Im not sure if this helps but when i type /opt/vc/bin/tvservice -s:
state 0x12000a [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive -
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?