this is my first post, so be gantle with me please…
PIR motion works on test but my hdmi connected screen ceeps on, it will not going off.
Some PIR Test info on Python Idle3:
import RPi.GPIO as GPIO
import time
sensor = 4
GPIO.setmode(GPIO.BCM)
GPIO.setup(sensor, GPIO.IN, GPIO.PUD_DOWN)
previous_state = False
current_state = False
while True:
time.sleep(0.1)
previous_state = current_state
current_state = GPIO.input(sensor)
if current_state != previous_state:
new_state = “HIGH” if current_state else “LOW”
print(“GPIO pin %s is %s” % (sensor, new_state))
OUTPUT on waving to PIR:
GPIO pin 4 is HIGH
GPIO pin 4 is LOW
GPIO pin 4 is HIGH
GPIO pin 4 is LOW
GPIO pin 4 is HIGH
GPIO pin 4 is LOW
GPIO pin 4 is HIGH
Config.js:
module: ‘MMM-PIR-Sensor’,
config: {
sensorPIN: 4,
powerSaving: true
}
ON NPM Start:
Loading config …
Loading module helpers …
No helper found for module: alert.
No helper found for module: clock.
Initializing new module helper …
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper …
Initializing new module helper …
All module helpers loaded.
Starting server op port 8080 …
Server started …
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Connecting socket for: MMM-PIR-Sensor
Sockets connected & modules started …
Launching application.
Create new calendar fetcher for url: http://p35-calendars.icloud.com/published/2/xxxxxxxxxxxxxxxxxx - Interval: 300000
Create new news fetcher for url: http://feeds.nos.nl/nosjournaal - Interval: 300000
Whoops! There was an uncaught exception…
{ Error: EBUSY: resource busy or locked, write
at Error (native)
at Object.fs.writeSync (fs.js:786:20)
at Object.fs.writeFileSync (fs.js:1353:24)
at new Gpio (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_modules/onoff/onoff.js:88:8)
at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-PIR-Sensor/node_helper.js:54:18)
at Socket. (/home/pi/MagicMirror/modules/node_modules/node_helper/index.js:98:10)
at emitTwo (events.js:106:13)
at Socket.emit (events.js:191:7)
at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:503:12
at _combinedTickCallback (internal/process/next_tick.js:67:7) errno: -16, code: ‘EBUSY’, syscall: ‘write’ }
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
Settings:
Edit /boot/config.txt
set hdmi_force_unplug=1
sdtv_mo=2 // Normal PAL
sudo su
/var/spool/cron/crontabs
@reboot python /home/pi/Documents/PIR/pir.py &
Also done:
sudo apt-get update
sudo apt-get upgrade
sudo reboot
in MMM-PIR-Sensor folder
npm install
sudo reboot
what O what can it be ?