MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Issues with MMM-PIR

    Scheduled Pinned Locked Moved Solved Troubleshooting
    22 Posts 7 Posters 10.1k Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      eyesallin @sdetweil
      last edited by

      @sdetweil
      Many thanks I’ll give it a try. Will report back.

      E 1 Reply Last reply Reply Quote 0
      • E Offline
        eyesallin @eyesallin
        last edited by

        @eyesallin

        50% unfortunately the top error is still there, any other help would be appreciated.
        EINVAL: Invalid argument, write.

        bugsounetB 1 Reply Last reply Reply Quote 0
        • bugsounetB Offline
          bugsounet Banned @eyesallin
          last edited by

          @eyesallin hi, eventually can I have the result of this commands in a terminal:

          groups
          

          thanks

          E 1 Reply Last reply Reply Quote 0
          • E Offline
            eyesallin @bugsounet
            last edited by

            @bugsounet Apologies but I don’t understand what you are asking for?

            bugsounetB 1 Reply Last reply Reply Quote 0
            • bugsounetB Offline
              bugsounet Banned @eyesallin
              last edited by

              @eyesallin

              like that:

              pi@raspberrypi:~ $ groups
              pi adm dialout cdrom sudo audio video plugdev games users input render netdev lpadmin gpio i2c spi
              pi@raspberrypi:~ $ 
              

              I have to see if you are in gpio group :)

              E 1 Reply Last reply Reply Quote 0
              • I Offline
                ingo916
                last edited by ingo916

                @bugsounet said in Issues with MMM-PIR:

                groups

                I am also getting the error
                MMM-Pir
                Error detected: EINVAL:invalid argument, write

                pi@raspberrypi:~ $ groups
                pi adm dialout cdrom sudo audio video plugdev games users input render netdev lpadmin gpio i2c spi
                pi@raspberrypi:~ $
                IMG_013.jpg IMG_0130.jpg

                I 2 Replies Last reply Reply Quote 0
                • I Offline
                  ingo916 @ingo916
                  last edited by

                  @ingo916

                  pi@raspberrypi:~/MagicMirror/modules $ git clone https://github.com/bugsounet/MMM-Pir
                  Cloning into 'MMM-Pir'...
                  remote: Enumerating objects: 546, done.
                  remote: Counting objects: 100% (136/136), done.
                  remote: Compressing objects: 100% (111/111), done.
                  remote: Total 546 (delta 79), reused 47 (delta 24), pack-reused 410
                  Receiving objects: 100% (546/546), 287.37 KiB | 2.79 MiB/s, done.
                  Resolving deltas: 100% (308/308), done.
                  pi@raspberrypi:~/MagicMirror/modules $ cd MMM-Pir/
                  pi@raspberrypi:~/MagicMirror/modules/MMM-Pir $ npm install
                  npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
                  
                  > MMM-Pir@1.1.2 preinstall
                  > installer/preinstall.sh -d 'unclutter cec-utils ddcutil build-essential'
                  
                  
                  Welcome to MMM-Pir v1.1.2
                  
                  No root checking...
                  Checking MMM-Pir: pi/pi
                  Checking MagicMirror: pi/pi
                  
                  Checking OS...
                  OS Detected: linux-gnu (debian 12 aarch64)
                  
                  Checking all dependencies...
                  Updating package...
                  Missing package: unclutter
                  Missing package: cec-utils
                  Missing package: ddcutil
                  Installing missing package...
                  Hit:1 http://deb.debian.org/debian bookworm InRelease
                  Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease
                  Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
                  Hit:4 http://archive.raspberrypi.com/debian bookworm InRelease
                  Reading package lists... Done
                  Reading package lists... Done
                  Building dependency tree... Done
                  Reading state information... Done
                  The following additional packages will be installed:
                    libcec6 libp8-platform2 unclutter-startup
                  The following NEW packages will be installed:
                    cec-utils ddcutil libcec6 libp8-platform2 unclutter unclutter-startup
                  0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
                  Need to get 549 kB of archives.
                  After this operation, 2,084 kB of additional disk space will be used.
                  Get:1 http://deb.debian.org/debian bookworm/main arm64 libp8-platform2 arm64 2.1.0.1+dfsg1-4 [20.9 kB]
                  Get:2 http://deb.debian.org/debian bookworm/main arm64 ddcutil arm64 1.4.1-1 [286 kB]        
                  Get:3 http://deb.debian.org/debian bookworm/main arm64 unclutter arm64 8-25 [15.6 kB]
                  Get:4 http://deb.debian.org/debian bookworm/main arm64 unclutter-startup all 8-25 [8,860 B]  
                  Get:5 http://archive.raspberrypi.com/debian bookworm/main arm64 libcec6 arm64 6.0.2-5+rpt2 [188 kB]
                  Get:6 http://archive.raspberrypi.com/debian bookworm/main arm64 cec-utils arm64 6.0.2-5+rpt2 [30.0 kB]
                  Fetched 549 kB in 1s (469 kB/s)     
                  Preconfiguring packages ...
                  Selecting previously unselected package libp8-platform2:arm64.
                  (Reading database ... 154590 files and directories currently installed.)
                  Preparing to unpack .../0-libp8-platform2_2.1.0.1+dfsg1-4_arm64.deb ...
                  Unpacking libp8-platform2:arm64 (2.1.0.1+dfsg1-4) ...
                  Selecting previously unselected package libcec6:arm64.
                  Preparing to unpack .../1-libcec6_6.0.2-5+rpt2_arm64.deb ...
                  Unpacking libcec6:arm64 (6.0.2-5+rpt2) ...
                  Selecting previously unselected package cec-utils.
                  Preparing to unpack .../2-cec-utils_6.0.2-5+rpt2_arm64.deb ...
                  Unpacking cec-utils (6.0.2-5+rpt2) ...
                  Selecting previously unselected package ddcutil.
                  Preparing to unpack .../3-ddcutil_1.4.1-1_arm64.deb ...
                  Unpacking ddcutil (1.4.1-1) ...
                  Selecting previously unselected package unclutter.
                  Preparing to unpack .../4-unclutter_8-25_arm64.deb ...
                  Unpacking unclutter (8-25) ...
                  Selecting previously unselected package unclutter-startup.
                  Preparing to unpack .../5-unclutter-startup_8-25_all.deb ...
                  Unpacking unclutter-startup (8-25) ...
                  Setting up libp8-platform2:arm64 (2.1.0.1+dfsg1-4) ...
                  Setting up unclutter (8-25) ...
                  update-alternatives: using /usr/bin/unclutter-classic to provide /usr/bin/unclutter (unclutter) in auto mode
                  Setting up libcec6:arm64 (6.0.2-5+rpt2) ...
                  Setting up unclutter-startup (8-25) ...
                  Setting up ddcutil (1.4.1-1) ...
                  Setting up cec-utils (6.0.2-5+rpt2) ...
                  Processing triggers for man-db (2.11.2-2) ...
                  Processing triggers for libc-bin (2.36-9+rpt2+deb12u3) ...
                  All Dependencies needed are installed !
                  
                  Installing @sdetweil sandbox fix...
                  fixing sandbox permissions
                  
                  > MMM-Pir@1.1.2 postinstall
                  > installer/postinstall.sh -r -m
                  
                  
                  Minify Main code...
                  Found: 8 files to minify
                  
                  Process File: ../MMM-Pir.js
                  Process File: ../node_helper.js
                  Process File: ../components/screenLib.js
                  Process File: ../components/screenDisplayer.js
                  Process File: ../components/progressbar.js
                  Process File: ../components/pirLib.js
                  Process File: ../components/parseData.js
                  Process File: ../components/loadLibraries.js
                  Done
                  
                  Try to Disable screen saver...
                  Found: screen saver in gsettings
                  gsettings screen saver already disabled
                  Found: screen saver in lightdm
                  screensaver via lightdm already disabled but need to be updated
                  Found: screen saver in lxsession
                  lxsession screen saver already disabled but need to updated
                  Found: screen saver in wayland
                  disable screensaver via wayfire.ini
                  
                  [WARN] There is some change for disable screen saver
                  [WARN] Please, don't forget to reboot your OS for apply the new configuration!
                  Done
                  
                  Rebuild MagicMirror...
                  make: Entering directory '/home/pi/MagicMirror/modules/MMM-Pir/node_modules/epoll/build'
                    CXX(target) Release/obj.target/epoll/src/epoll.o
                    SOLINK_MODULE(target) Release/obj.target/epoll.node
                    COPY Release/epoll.node
                  make: Leaving directory '/home/pi/MagicMirror/modules/MMM-Pir/node_modules/epoll/build'
                  Done
                  
                  MMM-Pir is now installed !
                  
                  added 218 packages in 53s
                  
                  43 packages are looking for funding
                    run `npm fund` for details
                  pi@raspberrypi:~/MagicMirror/modules/MMM-Pir $ 
                  
                  1 Reply Last reply Reply Quote 0
                  • I Offline
                    ingo916 @ingo916
                    last edited by

                    @ingo916
                    Config

                    		{
                    			module: 'MMM-Pir',
                    			position: 'top_left',
                    			config: {
                    				debug: false,
                    				delay: 2 * 60 * 1000,
                    				turnOffDisplay: true,
                    				mode: 10,
                    				ecoMode: true,
                    				displayCounter: false,
                    				//displayCounter: true,
                    				displayBar: false,
                    				//displayBar: true,
                    				displayStyle: "Circle",
                    				displayLastPresence: false,
                    				//displayLastPresence: true,
                    				lastPresenceTimeFormat: "LL H:mm",
                    				mode6_gpio: 20,
                    				mode6_clearGpioValue: true,
                    				pir_gpio: 22,
                    				//pir_gpio: 21,
                    				pir_reverseValue: false,
                    				xrandrForceRotation: "normal",
                    				wrandrForceRotation: "normal"
                    			}
                    		},
                    
                    1 Reply Last reply Reply Quote 0
                    • E Offline
                      eyesallin @bugsounet
                      last edited by

                      @bugsounet

                      Thanks for your patience, this is what i get.

                      admin@garyspi:~ $ groups
                      admin adm dialout cdrom sudo audio video plugdev games users input render netdev lpadmin gpio i2c spi
                      admin@garyspi:~ $

                      E 1 Reply Last reply Reply Quote 0
                      • S Offline
                        schris88
                        last edited by

                        your config looks good thus far, if you´re not getting it to run you can try my solution which is currently running like a charm

                        I installed it with MMM-Pir-Sensor-light and changed the code to use wayland,
                        to toggle the display on Pi5 this is working on a fresh OS install

                        WAYLAND_DISPLAY=“wayland-1” wlr-randr --output HDMI-A-1 --off
                        WAYLAND_DISPLAY=“wayland-1” wlr-randr --output HDMI-A-1 --on

                        possible outputs HDMI-A-1 (the one right next to usb-c), HDMI-A-2

                        If you monitor turns back on by itself after ~10 secs add “vc4.force_hotplug=1”(1=hmdi1 / 2=hdmi2 / 3=both) to the end of your /boot/firmware/cmdline.txt without creating a new line

                        All I did was change the command in activate and deactivate display function in the node_helper.js and added the cmdline parameter (dont forget to reboot)

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 2 / 3
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy