MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. rkorell
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    R
    Offline
    • Profile
    • Following 0
    • Followers 1
    • Topics 25
    • Posts 420
    • Groups 1

    Posts

    Recent Best Controversial
    • PIR / MQTT - Presence sensor(s) revived

      Dear MagicMirror-ians

      As may already known I was a real fan of MMM-Pir.
      For also good known reasons this nice module is not longer maintained.

      I have a local clone which runs OK but in the meantime I had switched to MMM-MQTTScreenOnOff wich attaches a “better” (radar-) sensor to my mirror. But I’ve missed the progress bar, the dimming and cron-like functionality. In addition the radar sensor is much slower than PIR- caused by a 5 second update intervall as minimum.

      After plenty of tinkering and testing, and above all torturing AI heavily I’m excited to announce:
MMM-PresenceScreenControl is finally out! 🎉

      This module brings together the best of both worlds:
      • The beloved timer bar and auto-dimming from MMM-Pir,
      • The reliability, MQTT support, and simplicity of MMM-MQTTScreenOnOff,
      • All cleaned up, without unnecessary complexity, cryptic cron strings, or weird build tricks.

      A few highlights:
      • Presence detection with PIR, MQTT, or both (whichever triggers first wins)
      • A visual timer bar so you always know how long the screen will stay on
      • Straightforward “ignore” and newly introduced “always-on” time windows using plain times and days—no cryptic cron needed
      • Customizable screen on/off commands—works on Pi, PC, X11, Wayland, CEC, and more
      • Touch mode for remote or manual override (yes, you can poke your mirror awake remotely!)

      If you’re after spinning circles or relay magic, this isn’t your thing (yet 😉).

      But if you want a solid, readable, and maintainable presence module that just works—even (hopefully) after updates—this is for you.

      Give it a try, share your feedback, open pull requests, or ask questions right here or on GitHub:

      Happy mirroring!

      Ralf

      posted in System
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil thx!

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil Dear Sam,
      I was able to get this done - to my big surprise …
      As announced, I just have pushed it to git and will post a corresponding message tomorrow.
      Do I get it right that it is recommended to edit the modules page as well?
      And the 3rd Party Modules page then will populate by itself, right?
      Thanks!

      Warmest regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @schlomm I’m absolute beginner …
      Had HEAVILY used AI to get this done and have recycled a LOT.

      GPIO part is from old (discontinued) module MMM-Pir from Bugsounet.
      This is reflected in pirLib.js - sliightly modified for my purposes.

      I do have a repository - pushed literally minutes ago …
      Feel free to have a look.

      Buttons should work with some modification. Essentiall for my purposes I simply query state of a single GPIO pin - to which a PIR sensor is connected. Code must be enhanced to handle more than one pin - if you are talking about “butons” - which signals plural…

      As mentioned such modification should be doable with AI as well.

      [ EDIT : My system is a raspi5 / bookworm as well - this is main reason for some difficulties. Some procedures simply doesn’t work anymore with new libraries and I had to change implementation…]

      Good luck!
      Warm regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil yes, indeed …

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil Dear Sam,
      just FYI: I’ve just identified that my main problem is NOT the version mismatch but a major change in node-libgpiod’s handling of GPIO-ressources.
      This was the main reason for mal-function of PIR sensor detection. “Version” was a side effect, not root-cause.
      I’m nearly done with this and it seems that it will work as intended…

      Thanks again for your support!

      Regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil OK; thanks.
      I will stop to handle these mismatches.
      Will try to get the MM-Module runnable .
      Console/terminal runs with node may not be necessary …
      Thanks anyway for your kind support!
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil Dear Sam,
      thanks again for this long explanation!

      My versions (if I interpret correctly) doesn’t mismatch :-(

      0|MagicMir | ### SYSTEM:   manufacturer: ; model: ; virtual: false
      0|MagicMir | ### OS:       platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.12.20+rpt-rpi-2712
      0|MagicMir | ### VERSIONS: electron: 32.2.7; used node: 20.18.1; installed node: 20.18.1; npm: 10.8.2; pm2: 5.4.3
      0|MagicMir | ### OTHER:    timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined 
      

      So I’m not sure at all, what to do.

      pi@MagicMirrorPi5:~ $ n list
      node/20.18.1
      
      

      Does show up exact this version, as well.
      Where are my problems from ???
      Thanks a LOT for any idea!

      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil
      Dear Sam, OK, thanks for this.
      Not fully understood…

      How can I

      1. figure out, how my mirror is started? (looooong ago I‘ve used your install script and (if I remember correctly) I‘ve answered „yes“ to „do you want automatically start your mirror at system startup“ - or something similar. - Never took care about, what is done - it worked (and still works)…)
      2. double check the above „VERSIONS“ - message - is this message in logfile?
      3. can I get „keeping the node versions synched“?

      Thanks for further advise!
      Warmest regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil said

      you should know if you run
      node serveronly, then the bytecode has to match the nodejs standalone engine version

      OK, thanks.
      It seems that rebuild have corrected the error for the module.
      When I try to run a node-command in the shell (terminal) then I get an similar error message as above.
      Is this caused by your explanation part above?
      Different versions needed for either terminal or inside mirror?
      Can you tell me HOW the magic mirror is started (when I have used your install script)?

      Is there a way to test something which had to run in the mirror (like the module) on commandline?

      To illustrate what I mean:
      I have a very short test-script test-gpiod.js

      // test-gpiod.js , Aug 2025, Dr. Ralf Korell
      const { Chip } = require("node-libgpiod");
      try {
        const chip = new Chip(0);
        console.log("Chip label:", chip.getChipLabel());
      } catch (err) {
        console.error("Error loading chip:", err);
      }
      

      which I try to run with

      node test-gpiod.js
      

      But this produces error message:

      /home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/bindings/bindings.js:121
      throw e;
      ^
      
      Error: The module '/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/node-libgpiod/build/Release/node-libgpiod.node'
      was compiled against a different Node.js version using
      NODE_MODULE_VERSION 128. This version of Node.js requires
      NODE_MODULE_VERSION 115. Please try re-compiling or re-installing
      the module (for instance, using `npm rebuild` or `npm install`).
      at Module._extensions..node (node:internal/modules/cjs/loader:1586:18)
      at Module.load (node:internal/modules/cjs/loader:1288:32)
      at Module._load (node:internal/modules/cjs/loader:1104:12)
      at Module.require (node:internal/modules/cjs/loader:1311:19)
      at require (node:internal/modules/helpers:179:18)
      at bindings (/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/bindings/bindings.js:112:48)
      at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/node-libgpiod/lib/misc.js:1:37)
      at Module._compile (node:internal/modules/cjs/loader:1469:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
      at Module.load (node:internal/modules/cjs/loader:1288:32) {
      code: 'ERR_DLOPEN_FAILED'
      }
      
      Node.js v20.18.1
      

      Thanks for any help!
      Warmest regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Need "correct" version of node-libgpiod ....

      @sdetweil Dear Sam,
      thanks for this information.
      Can you please enlighten me?
      I can read what you wrote and I got a light idea - but didn’t understand …

      I definitely have used your install script.
      what is @electron and
      what correlation is between node-libgpiod and @electron ? and what will this

      ../../node_modules/.bin/electron-rebuild
      

      do?

      Sorry for these questions - I would like to understand, what happens.

      If this is “neccessary” I will try to automate this for others with a postinstall script.
      Thanks for your effort!
      warmest regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • Need "correct" version of node-libgpiod ....

      Dear Gurus!
      May one of you got an idea…
      I’m on my way (looooonnnnggggg planned) to re-implement bugsounet’s MMM-Pir, and I am nearly done…
      My last hurdle seems to be the way he has handled the PIR sensor itself. I am not aware if the second way (python script) ever had worked but I stuck with the implementation of the GPIO handler with node-libgpiod.
      This works fine in my environment as-is without any problems.
      Needed dependeny is node-libgpiod.
      I’ve installed this with

      npm install node-libgpiod
      

      In my own - brand new - module folder - Ran without any error.
      But when mirror is restarted I found an error in logfile, stating that there is a version mismatch…

      0|MagicMir | [2025-08-06 21:13:55.302] [ERROR] 2025-08-06T21:13:55 <error> [MMM-Pir] [LIB] [PIR] [GPIOD] Error: The module '/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/node-libgpiod/build/Release/node-libgpiod.node'
      0|MagicMir | was compiled against a different Node.js version using
      0|MagicMir | NODE_MODULE_VERSION 115. This version of Node.js requires
      0|MagicMir | NODE_MODULE_VERSION 128. Please try re-compiling or re-installing
      0|MagicMir | the module (for instance, using `npm rebuild` or `npm install`). (/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/pirLib.js:163 PIR.gpiodDetect) 
      

      My Node Version is:

      pi@MagicMirrorPi5:~ $ node -v
      v20.18.1
      

      Information of Mirror:

      pm2 info MagicMirror
       Describing process with id 0 - name MagicMirror 
      ┌───────────────────┬──────────────────────────────────────────┐
      │ status            │ online                                   │
      │ name              │ MagicMirror                              │
      │ namespace         │ default                                  │
      │ version           │ 2.31.0-develop                           │
      │ restarts          │ 40                                       │
      │ uptime            │ 59s                                      │
      │ script path       │ /home/pi/MagicMirror/installers/mm.sh    │
      │ script args       │ N/A                                      │
      │ error log path    │ /home/pi/.pm2/logs/MagicMirror-error.log │
      │ out log path      │ /home/pi/.pm2/logs/MagicMirror-out.log   │
      │ pid path          │ /home/pi/.pm2/pids/MagicMirror-0.pid     │
      │ interpreter       │ bash                                     │
      │ interpreter args  │ N/A                                      │
      │ script id         │ 0                                        │
      │ exec cwd          │ /home/pi                                 │
      │ exec mode         │ fork_mode                                │
      │ node.js version   │ N/A                                      │
      │ node env          │ N/A                                      │
      │ watch & reload    │ ✔                                        │
      │ unstable restarts │ 0                                        │
      │ created at        │ 2025-08-06T19:42:31.312Z                 │
      └───────────────────┴──────────────────────────────────────────┘
       Divergent env variables from local env 
      ┌────────────────┬─────────────────────────────────────┐
      │ SSH_CONNECTION │ 172.23.56.21 53109 172.23.56.157 22 │
      │ TERM           │ xterm                               │
      │ SHLVL          │ 2                                   │
      │ XDG_SESSION_ID │ 4                                   │
      │ SSH_CLIENT     │ 172.23.56.21 53109 22               │
      │ OLDPWD         │ /home/pi/MagicMirror/splashscreen   │
      └────────────────┴─────────────────────────────────────┘
      
      

      An “idea” is that there is a mismatch between node version in my terminal and node version used by mirror.
      Mirror gave me no information about it’s version…

      Maybe I’m completely on a wrong way…
      Can somebody please guide me?

      Thanks a LOT!

      Warmest regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Cannot access mirror

      @sdetweil …

      ps -ef | ssh
      usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
                 [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
                 [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
                 [-i identity_file] [-J [user@]host[:port]] [-L address]
                 [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
                 [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
                 [-w local_tun[:remote_tun]] destination [command [argument ...]]
      

      …
      I guess you’ve meant a kind of grep …
      From my (very basic) understanding your command tries to pipe process list to ssh …

      BTW: confirmed. Switching the power supply eliminates failure…
      I’m connected whol day long …

      Warmest regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Cannot access mirror

      @sdetweil ,

      ps -ef | grep ssh
      

      edit: fixed command above

      doesn’t work…
      As you can read from this statement: I’m now able to connect and this is remotely …
      It SEEMS I’ve identified the root cause (I’m not that sure but connection is stable longer than the last times. I’s pretty slow but doesn’t disconnect nearly immediatly).

      I’v just a little bit disassebled and connected another power supply …

      This currently fixes issues …
      Be curious how long this lasts…
      But because ssh as well as VNC were disconnected - insufficient power was the most probable explanation
      (despite I doesn’t have ANY clue why this happens! The power supply is 6months old and I cannot imagine any reason why “insufficient” power causes this behaviour: only disrupt “ingoing” requests…

      • If anybody have an idea - highly welcome!!!)
      posted in Troubleshooting
      R
      rkorell
    • RE: Cannot access mirror

      @sdetweil I‘ve rebooted several times. Sometimes I can get access for a very short time after a reboot, get disconnect and after disconnect not able to re-connect…
      IP is always the same - fixed in router.
      So: really strange …

      Shell access currently not possible, so no testing, sorry. Mirror has to be disassebled - which I can perform earliest tomorrow, because I‘m on the road…

      Regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: Cannot access mirror

      @sdetweil web access e.g. from phone or tablet to pi …

      posted in Troubleshooting
      R
      rkorell
    • Cannot access mirror

      Good mornning,
      Desparately asking you guys:
      Since yesterday I cannot access my mirror remotely anymore….

      Network outgoing seems to work: All modues are showing their actual data.
      Currently even web access is possible (browser access).
      I have a modue showing internet access/IP onscreen, both greeen and valid.

      But I cannot access via: VNC and (more urgent) terminal (ssh) as well as ftp (this as sftp).
      Any idea?

      (Pi5 on Pi power supply 27W & no SD card but NVME with 16/228GB used).
      Power supply pretty new but just ordered a new one …

      Thanks for any suggestion!

      Warmest regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: MMM-Pinfo Help

      @plainbroke
      This time actually not a CSS issue :-)

      If I‘m not going wrong and remember correctly, I had a similar problem with MMM-Pinfo.
      There is a configuration option in the module-declaration in config.js.
      I‘ve set containerSize to 180.
      And valueAlign to right.

      This solved the shown overlayed look …

      And your labels are aligned „center“ - this I would set to left (labelAlign is the parameter)

      HTH,
      Warm regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: MMM-Universal-Pir issues

      @eyesallin said:

      I am using a PI 5 with Linux bookworm

      OK, with Pi5/bookworm the wayland standard config should work…
      Or do you have re-configured to X11?

      You can check right syntax for your system by trial&error on commandline in terminal window.
      If you are working headless (remote terminal) you have to place a „DISPLAY:0“ in front of the command you are trying…

      Regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • RE: MMM-Universal-Pir issues

      @eyesallin ,
      MMM-Universal-Pir needs correct configuration for the screen-on / screen-off commands.
      These commands are dependant of your Pi-Model and OS.
      The default is for bookworm/wayland config.
      If your Pi differs you need the correct command.
      For older OS versions this are commands with xrandr …

      Good luck.
      Regards,
      Ralf

      posted in Troubleshooting
      R
      rkorell
    • 1 / 1