Read the statement by Michael Teeuw here.
MMM-Pir toggling
-
@ttt126 generally youwould open an issue on the module githib page
@bugsounet can you please add an issues tab to the module? so we can keep track of things like this without you having to troll the forum too…
-
Thanks for your answer. I don’t want to troll anything here.
On Github I can make a pull request under mmm-pir. I think that’s not the point. I can’t find a new issue there.
So here are my questions. -
@ttt126 troll wasn’t indended for you. he is a busy guy. PIR is busted all over the place with bookworm.
-
Thanks, opened an issue here:
https://github.com/KristjanESPERANTO/MagicMirror-3rd-Party-Modules/issues
Will see
-
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_PRESENCEnotification withtrueorfalsepayload (it’s the screen state)
You can trigger it with this module MMM-NotificationTrigger and exec a personal script for thisNote:
- python
RPi.GPIOwill be deleted (in next release) because there is a compatibility problem with pi5 and with bookworm too. - I will try to recode it with
gpiodlibrary 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 startto 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… ) -
so this is the aktual config
the command python3 /home/pi/neu1.py is acting the relay if executed in termnal
I use fire and exec both with no action.
maybe there is no trigger natification.module: "MMM-NotificationTrigger", config: { triggers:[ { trigger: "USER_PRESENCE", fires: [ { fire:"python3 /home/pi/neu1.py", exec: (payload) => { return "python3 /homr/pi/neu1.py " + payload.option } }, ], }, ] } -
I got it working, many thanks for your Help :-)
-
@ttt126 what was the issue? might help others in the same predicament
-
@ttt126 said in MMM-Pir toggling:
config: {
triggers:[
{
trigger: “USER_PRESENCE”,
fires: [
{
exec: (payload) => {
return "python3 /homr/pi/neu1.py " + payload.option
}
},
],
},
]
}The pathon3 comand was missing. I´m not quite firm with programming.
But a serce for executing a py script brought the answere! -
@ttt126 ok… two things…
- when posting config or logs info in the forum, please use the code-block wrapper
to use
paste the text you want to post, blank line above and below
select the text you just pasted
hit the </> button above the editor to add the wrapper- on linux, you can specify the program to launch to execute a ‘script/program’
you do this by adding a special first line
#!/path_to_executable/programnameso in your case
from a terminal window dowhich python3the which pgm returns the full path to the 1st instance of the program specified as located along the path . on my desktop that is
which python3 /home/sam/anaconda3/bin/python3then in you editor of your script, make this the 1st line
#!path_from_whichso it looks like this
#!/home/sam/anaconda3/bin/python3the linux execution code does all this stuff under the covers, reads the 1st line and invokes that pgm with the arguments passed to the script
and of course, if no #! then the script USER has to specify it like you did -
S sdetweil has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login