Read the statement by Michael Teeuw here.
MMM-PIR-SENSOR not working
-
That happens when users don’t use a code block to paste their code. Quotes get screwed up.
-
This post is deleted! -
OH nice so now we’re deleting messages…Thanks appreciate that…
-
Hi guys, thanks for the help. Unfortunately that did not fix the issue…
I changed the code like you mentioned. Does anyone have any idea why the monitor never turns off. Googling the topic it seems other people have had a similar issue but no solutions ever been found.Its very strange to me because with a python script I have it printing out when it detects motion and when it detects none and it works flawlessly. I have a feeling that for some reason the MMM-PIR-SENSOR isn’t actually connecting with the rest of my magic mirror when I start things up. Below is my entire config.js file.
modules: [
{ module: "clock", position: "top_left" }, { module: "compliments", position: "lower_center" }, { module: 'MMM-PIR-SENSOR', config: { sensorPIN: 22, powerSavingDelay: 120 // in seconds } }, { module: "newsfeed", position: "bottom_bar", config: { feeds: [ { title: "New York Times", url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml" } ], showSourceTitle: true, showPublishDate: true } }, { module: "MMM-NFL", position: "bottom_left", }, ]
};
-
are u sure, u are using the correct pin?
The Module uses BCM numbering, so if u write in your config to use 22, it is physically 15, and this is GPIO 3!type in console, while u are running through the PIR:
gpio read 3
before detecting it must give out a “0”. WHILE moving through the PIR it must give out a “1”
or simply type
gpio readall
before and while the PIR detects to compare results and see what Pin you are really using.and please check if pm2 gives errors with
pm2 logs
-
@cowboysdude said in MMM-PIR-SENSOR not working:
OH nice so now we’re deleting messages…Thanks appreciate that…
We all are here for some fun. But mentioning “dynamite” several times doesn’t help the user and it does not make your joke better.
-
@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