@ejay-ibm I will take a look as fast as i can. It is deffinitly a problem with the code i added
Edit: Added a pull request which should fix the issue
@ejay-ibm I will take a look as fast as i can. It is deffinitly a problem with the code i added
Edit: Added a pull request which should fix the issue
@sdetweil You are absolutly right. But it is a totally different aproach. Hiding the modules to get the background as dark as possible does not save the same energy as turning off the screen. I am one of the lucky guys that uses a Benq monitor which shuts off in a second after turning off the signal and is back in less than three when turning it on again.
I think your module is the perfect solution for people who are not that lucky
@Stef Hi, yesterday i added two Modules to the Showcase Area. On that monitors GPIO Pins and one which controls the Monitor.
My usecase is exactly like yours. I use an PIR sensor to detect user presence and want the screen to be turned off after a configurable timeout.
If you want to try them:
MMM-Screen-Powersave-Notification
and
MMM-GPIO-Notifications
Hi,
i had the same problem the last weeks.
It looks like pm2 creates the startup script for systemd with wrong parameters.
You should check if there exists a file “/etc/systemd/systemd/pm2-pi.service”
In my case the file existed but contained the following lines:
USER=root which should be USER=pi
Environment=PM2_HOME=/root/.pm2 which should be Environment=PM2_HOME=/home/pi/.pm2
PIDFile=/root/.pm2/pm2.pid which should be PIDFile=/home/pi/.pm2/pm2.pid
If the file does not exist you can create it with:
sudo pm2 startup systemd -u pi
But you need to check the values again after creating it.
In the end you can enable the script with:
sudo systemd enable pm2-pi.service
The parts in described by @Chris are needed as well
@Sean All things i needed are merged now; i archived my repostory and added a hint to yours to the readme
This module is inspired by https://github.com/mboskamp/MMM-PIR and https://github.com/mboskamp/MMM-PIR but is controlled by notifications;
Based on “USER_PRESENCE”, “SCREEN_ON”, “SCREEN_OFF” and “SCREEN_TOGGLE” notifications the screen is controlled; By default “vcgencmd” command is used to turn the screen on or off and also to check the current status but it can be changed in the config file;
After the configured delay (which can be changed during rutime with an “SCREEN_POWERSAVE” notification) the screen will be turned off if no “USER_PRESENCE” notification had been send;
If needed custom scripts can be run after switching the screen on or off;
MMM-Screen-Powersave-Notification
[card:Tom-Hirschberger/MMM-Screen-Powersave-Notification]
spawnSync
and spawn
instead of execSync
and exec
now. the old commands caused “Error: write EFAULT” exceptions in installations with current nodejs and electron versionsxrandr
or tvservice
as an alternative to the default vcgencmd
command to control the screen. xrandr
is the only solution working with current “vc4-kms-v3d” driver used in Raspberry Bullseye operating system.This module monitores multiple configurable GPIO pins for state changes; if one of the pins changes to the configured state the notifcations which are specified will be send.
I wrote this module to send “USER_PRESENCE” notifications based on PIR Sensors.
MMM-GPIO-Notifications
[card:Tom-Hirschberger/MMM-GPIO-Notifications]
I recently added an example on how to connect a HC-SR501 PIR sensor to GPIO4 and send a SCREEN_ON notification to the MMM-Screen-Powersave-Notification module.
forceInfoFileUsage
. If this option is set to true the build in device information will be skipped the usage of the gpioinfo.json
is forced.** rolled back**
gpioinfo
can be used but also named GPIOs.BREAKING CHANGES
gpio_debounce
is now set to 0
gpio_state
and notifications
options is deprecated now. Use notifications_low
and notifications_high
instead.gpio_debounce
and the options delay
, delay_low
and delay_high
to the READMEThis module is based on the ideas of the module https://github.com/thobach/MMM-Gestures but uses a newer version of the “serialport” library. Because of this it does not need an additional webserver but connects directly to multiple, configurable serial ports. If an configured message is received on the configured serial port the configured notifications will be send to all modules.
The repository also contains two Arudino examples (testet on UNO R3 and Mega 2560) which use APDS-9960 and HC-SR04 sensors to send messages.
MMM-Serial-Notifications
[card:Tom-Hirschberger/MMM-Serial-Notifications]
Today (2020-03-29) i added a more complex example with all stuff needed (.ino, wireringplan, description, example configuration) which uses an APDS-9960 and three VL53L1X sensors to detect hand gestures and hand presence with an Arduino Nano v3. The results will be transmitted to the Raspberry via USB Serial Interface and trigger some notifications.
@Sean I wish i had seen your Module a view days earlier. Last week i desided to develop a volume control Module by my self (https://github.com/Tom-Hirschberger/MMM-VolumeControl). Your Module has nearly the same functionaltiy but looks nicer than mine. Mayby we can join forces. I try to take a closer look to your Module the next days. If something is missing i try to add it and make a pull request?