Read the statement by Michael Teeuw here.
MMM-Pir toggling
-
Hi,
MMM-Pir v2 is under coding
Unfortunately, it is not possible to use mode 6 and 7 at the same time (same GPIO)This module send
USER_PRESENCE
notification withtrue
orfalse
payload (it’s the screen state)
You can trigger it with this module MMM-NotificationTrigger and exec a personal script for thisNote:
- python
RPi.GPIO
will be deleted (in next release) because there is a compatibility problem with pi5 and with bookworm too. - I will try to recode it with
gpiod
library for both compatibility
- python
-
Would it be possible to create a mode in which a relay is switched when detected on the PIR and after the new timer has expired.
So an on off toggle, so to speak. This would make it possible to switch any monitor using the Stanfby button. HDMI on/off would then not be necessary, simply a relay on the monitor button and all monitors could be used.
Unfortunately, I’m not that good at cascading the module.
Thank you for your great work -
Thank you very much, I spent the whole day trying to understand notification triggers and producing a config, unfortunately without success.
Maybe you can help me out. how do I do the config so that the trigger can be taken over by mmmpir? I’ve already created a small py script with a gpio pin that goes on and off, it’s in the root directory.
But I just can’t get the execut function to be implemented.{
module: “MMM-NotificationTrigger”,
config: {
triggers:[
{
trigger: “USER_PRESENCE”,
fires: [
{
exec: “/neu1.py”
}
],
},
]
}
}, -
@ttt126 said in MMM-Pir toggling:
exec: “/neu1.py”
that means in the root system folder’if you meant YOUR home folder
that would be , replace username with really logged on user for home folder/home/username/neu1.py
there may have been messages posted to the MM startup output
-
Even with /home/pi/neu1.py it is not responding.
Do I have to devine true and fals state in the config as well? -
@ttt126 can you execute the script manually from the terminal window?
-
Yes, this I can.
Kliking - exexute, relay klliks on an off once. -
@ttt126 ok, i was checking for permissions
did you check the messages from npm start location, see if any errors were posted
-
@sdetweil said in MMM-Pir toggling:
npm start location
pi@MagicMirro-2:~/MagicMirror/config $ npm startmagicmirror@2.29.0 start
DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js[2024-10-23 17:12:16.266] [LOG] Starting MagicMirror: v2.29.0
[2024-10-23 17:12:16.334] [LOG] Loading config …
[2024-10-23 17:12:16.341] [LOG] config template file not exists, no envsubst
[2024-10-23 17:12:17.515] [INFO] Checking config file /home/pi/MagicMirror/conf ig/config.js …
[2024-10-23 17:12:17.711] [INFO] Your configuration file doesn’t contain syntax errors :)
[2024-10-23 17:12:17.712] [INFO] Checking modules structure configuration …
[2024-10-23 17:12:17.959] [INFO] Your modules structure configuration doesn’t c ontain errors :)
[2024-10-23 17:12:17.967] [LOG] Loading module helpers …
[2024-10-23 17:12:18.020] [LOG] Initializing new module helper …
[2024-10-23 17:12:18.022] [LOG] Module helper loaded: MMM-Pir
[2024-10-23 17:12:18.026] [LOG] Initializing new module helper …
[2024-10-23 17:12:18.028] [LOG] Module helper loaded: MMM-NotificationTrigger
[2024-10-23 17:12:18.031] [LOG] No helper found for module: alert.
[2024-10-23 17:12:18.042] [LOG] Initializing new module helper …
[2024-10-23 17:12:18.043] [LOG] Module helper loaded: updatenotification
[2024-10-23 17:12:18.044] [LOG] No helper found for module: clock.
[2024-10-23 17:12:18.298] [LOG] Initializing new module helper …
[2024-10-23 17:12:18.299] [LOG] Module helper loaded: calendar
[2024-10-23 17:12:18.300] [LOG] No helper found for module: MMM-WebView.
[2024-10-23 17:12:18.303] [LOG] No helper found for module: weather.
[2024-10-23 17:12:18.306] [LOG] No helper found for module: MMM-RAIN-MAP.
[2024-10-23 17:12:18.488] [LOG] Initializing new module helper …
[2024-10-23 17:12:18.489] [LOG] Module helper loaded: newsfeed
[2024-10-23 17:12:18.490] [LOG] All module helpers loaded.
[2024-10-23 17:12:18.522] [LOG] Starting server on port 8080 …
[2024-10-23 17:12:20.761] [ERROR] Whoops! There was an uncaught exception…
[2024-10-23 17:12:20.816] [ERROR] Error: listen EADDRINUSE: address already in u se ::1:8080
at Server.setupListenHandle [as _listen2] (node:net:1904:16)
at listenInCluster (node:net:1961:12)
at GetAddrInfoReqWrap.doListen [as callback] (node:net:2135:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:111:8) {
code: ‘EADDRINUSE’,
errno: -98,
syscall: ‘listen’,
address: ‘::1’,
port: 8080
}
[2024-10-23 17:12:20.818] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[2024-10-23 17:12:20.824] [ERROR] If you think this really is an issue, please o pen an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues
[13489:1023/171222.609717:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.619958:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.622864:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.623145:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.623492:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.623703:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.623989:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.624237:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.624616:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.627519:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.631965:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.632229:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.632531:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.632730:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.634239:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.637235:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.639949:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.643515:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.647036:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.647506:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.648316:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.648593:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.648900:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.649075:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.649295:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.649472:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[13489:1023/171222.649704:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[13489:1023/171222.649858:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[2024-10-23 17:12:24.158] [INFO] System information:SYSTEM: manufacturer: ; model: ; virtual: false
OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.51+rpt-rpi-v8
VERSIONS: electron: 31.7.1; used node: 20.18.0; installed node: 20.9.0; npm: 10.1.0; pm2: 5.4.2
OTHER: timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined
I think no errors according to the problem.
-
@ttt126 that means you started MM AGAIN…
if you are using PM2, then you need to use the pm2 commands
pm2 status
pm2 stop x
where x is the name or number of the row of the app you want control
and then pm2 start xor you can do
pm2 restart x
I STRONGLY recommend using manual start while you are developing your mm solution
changing config, adding modulespm2 stop all cd ~/MagicMirror npm start
to stop MM in this mode, hit ctrl-q on the MM screen
if you do this over ssh cause you have no keyboard on the mm system (like me all the time) press ctrl-c in the ssh window where you did npm start
(if you do this when PM2 is controlling, it will do its job, “keep the app running”,
you stop it, and pm2 will restart it… )