• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Module error after updating - MMM-Pir: Pir Error detected: EINVAL: invalid argument, write

Scheduled Pinned Locked Moved Solved Troubleshooting
9 Posts 4 Posters 1.0k Views 4 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.
  • J Offline
    Jazz
    last edited by Jazz Jul 2, 2024, 2:50 PM Jul 2, 2024, 2:25 PM

    Hi,

    I’m running on a Raspberry Pi 4…

    jazz@magicmirror:~ $ cat /sys/firmware/devicetree/base/model;echo
    Raspberry Pi 4 Model B Rev 1.5
    

    Please note that my account is a member of the gpio group…

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

    I’ve had a magic mirror up for several months now. Due to the recent reports of problems being discovered with OpenSSH, I decided to do a full system update (that is, I did a ‘sudo apt update’ followed by a ‘sudo apt full-upgrade’) of the system. Note that i’m running raspbian 12…

    jazz@magicmirror:~ $ cat /etc/os-release|grep -e NAME -e VERSION
    PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"
    NAME="Raspbian GNU/Linux"
    VERSION_ID="12"
    VERSION="12 (bookworm)"
    VERSION_CODENAME=bookworm
    

    I then updated the magic mirror software (‘git pull && npm run install-mm’). I then updated my modules, including MMM-Pir (https://github.com/bugsounet/MMM-Pir) via ‘npm run update’ and ‘npm run rebuild’. Everything proceeded as expected, but afterwards when I restarted, I was presented with an error in the notifications section of the magic mirror display saying “MMM-Pir: Pir Error detected: EINVAL: invalid argument, write”.

    Note that i’ve made no changes to the wiring of the PIR sensor or to the module configuration, which looks like…

    {
        module: 'MMM-Pir',
        position: 'top_left',
        config: {
            debug: false,
            delay: 2 * 60 * 1000,
            mode: 10,
            displayCounter: false,
            displayBar: false,
            displayStyle: "Text",
            displayLastPresence: true,
            lastPresenceTimeFormat: "LL H:mm",
            pir_mode: 0,
            pir_gpio: 17,
            pir_reverseValue: false,
            mode6_gpio: 20,
            mode6_clearGpioValue: true,
            xrandrForceRotation: "normal",
            wrandrForceRotation: "normal",
            wrandrForceMode: "1920x1080",
            touchMode: 0
        }
    }
    

    Note that if I do a ‘pm2 logs magic-mirror’, here are some of the last entries in /home/jazz/.pm2/logs/magic-mirror-error.log…

    0|magic-mi | [4347:0702/141938.410247:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
    0|magic-mi | [4347:0702/141938.410629:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
    0|magic-mi | [2024-07-02 14:19:40.939] [ERROR] [MMM-Pir] [LIB] [PIR] Error: EINVAL: invalid argument, write
    0|magic-mi | /home/jazz/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT
    

    Anyone have any ideas on how to resolve the issue? I’ve tried changing the module ‘mode’ values to 9 and 2, but 10 seems to be the right value for my raspberry pi.

    Regards,

    Jazz

    B 1 Reply Last reply Jul 2, 2024, 3:36 PM Reply Quote 0
    • B Offline
      bugsounet Banned @Jazz
      last edited by Jul 2, 2024, 3:36 PM

      @Jazz said in Module error after updating - MMM-Pir: Pir Error detected: EINVAL: invalid argument, write:

      pir_mode: 0,

      Sorry, I have forget to update ReadMe for this error
      Generally happen with x64 system (Rpi 4 and Rpi 5)

      Available pir_mode:
      pir_mode: 0 - use onoff library (For Raspberry Pi 3b+ and 4)
      pir_mode: 1 - use python script with RPI.GPIO library (For Raspberry Pi 3b+ and 4)
      pir_mode: 2 - use python script with gpiozero library (For Raspberry Pi 5, not tested on other Raspberry Pi)
      

      So, Can you try pir_mode: 1, or pir_mode: 2,

      J B 2 Replies Last reply Jul 2, 2024, 3:53 PM Reply Quote 0
      • J Offline
        Jazz @bugsounet
        last edited by Jul 2, 2024, 3:53 PM

        @bugsounet Changing pir_ mode from 0 to 1 has fixed the problem :)

        Thanks for your help.

        Regards,

        Jazz

        1 Reply Last reply Reply Quote 0
        • J Jazz has marked this topic as solved on Jul 2, 2024, 3:53 PM
        • B Offline
          bugsounet Banned @bugsounet
          last edited by Jul 2, 2024, 4:02 PM

          ReadMe Updated

          1 Reply Last reply Reply Quote 0
          • L Offline
            Laca44
            last edited by Jul 9, 2024, 4:07 PM

            Hi everyone,

            I just can’t get it to work guys. Please help.

            GPIO setup:
            VIN - Pin2
            OUT - Pin6
            GND - Pin11

            Configuration:
            module: ‘MMM-Pir’,
            position: ‘top_left’,
            config: {
            debug: false,
            delay: 1 * 30 * 1000,
            mode: 1,
            displayCounter: true,
            displayBar: true,
            displayStyle: “SemiCircle”,
            displayLastPresence: true,
            lastPresenceTimeFormat: “LL H:mm”,
            xrandrForceRotation: “normal”,
            wrandrForceRotation: “normal”,
            touchMode: 2,
            pir_gpio: 17,
            pir_mode: 1,

            I have been playing around with all variations and have tested 3 sensors. Not sure what I’m missing.
            Thank you for your support!

            S 1 Reply Last reply Jul 9, 2024, 4:58 PM Reply Quote 0
            • S Offline
              sdetweil @Laca44
              last edited by sdetweil Jul 9, 2024, 5:03 PM Jul 9, 2024, 4:58 PM

              @Laca44 does it work outside
              MagicMirror?

              there are python scripts to test operation.
              google search
              python pir sensor test

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              L 1 Reply Last reply Jul 9, 2024, 9:19 PM Reply Quote 0
              • L Offline
                Laca44 @sdetweil
                last edited by Jul 9, 2024, 9:19 PM

                @sdetweil said in Module error after updating - MMM-Pir: Pir Error detected: EINVAL: invalid argument, write:

                python pir sensor test
                I’m a newbie and this helped a lot! Thank you!

                S 1 Reply Last reply Jul 9, 2024, 9:41 PM Reply Quote 0
                • S Offline
                  sdetweil @Laca44
                  last edited by Jul 9, 2024, 9:41 PM

                  @Laca44 were you able to solve the problem?

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  L 1 Reply Last reply Jul 10, 2024, 8:20 AM Reply Quote 0
                  • L Offline
                    Laca44 @sdetweil
                    last edited by Jul 10, 2024, 8:20 AM

                    @sdetweil Yes it helped in resolving the issue. I still need to understand what troubleshooting actually helped.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • 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