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.

    MMM-Universal-PIR - ‘GPIOcommand exited with error!'

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    5 Posts 2 Posters 50 Views 2 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.
    • S Offline
      smegbadger
      last edited by

      Hi

      With no warning (I haven’t carried out any updates) MMM-Universal-Pir is now failing. It shows under the ‘PIR SENSOR’ heading on the MM screen ‘gpioCommand exited with error!’

      Config is:

                          module: "MMM-Universal-Pir",
                              position: "bottom_right",
                              config: {
                                  gpioCommand: "gpiomon -r -b gpiochip0 23",
                                  onCommand: "wlr-randr --output HDMI-A-1 --on --transform 90",
                                  offCommand: "wlr-randr --output HDMI-A-1 --off",
                                  deactivateDelay: 120 * 1000,
                                  }
      

      and in a terminal gpiomon -r -b gpiochip0 23 shows events when the PIR is triggered and

      wlr-randr --output HDMI-A-1 --on --transform 90 and wlr-randr --output HDMI-A-1 --off still control the screen.

      gpiomon is v1.6.3

      What can have changed?

      Steve

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        smegbadger @smegbadger
        last edited by

        Snag_1ee4e5ea.png

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

          The Docker log shows
          [2026-02-10 11:30:10.955] [ERROR] [MMM-Universal-Pir] stderr: gpiomon: invalid option -- 'r' gpiomon: try gpiomon --help

          but gpiomon -r -b gpiochip0 23 works in a terminal when pasted from the config.js file, very strange

          It’s just stopped working!

          Steve

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

            magicm@magicmirror:/opt/mm/mounts/config $ gpiomon --help
            Usage: gpiomon [OPTIONS] <chip name/number> <offset 1> <offset 2> ...
            
            Wait for events on GPIO lines and print them to standard output
            
            Options:
              -h, --help:           display this message and exit
              -v, --version:        display the version and exit
              -l, --active-low:     set the line active state to low
              -B, --bias=[as-is|disable|pull-down|pull-up] (defaults to 'as-is'):
                            set the line bias
              -n, --num-events=NUM: exit after processing NUM events
              -s, --silent:         don't print event info
              -r, --rising-edge:    only process rising edge events
              -f, --falling-edge:   only process falling edge events
              -b, --line-buffered:  set standard output as line buffered
              -F, --format=FMT      specify custom output format
            
            Biases:
              as-is:        leave bias unchanged
              disable:      disable bias
              pull-up:      enable pull-up
              pull-down:    enable pull-down
            
            Format specifiers:
              %o:  GPIO line offset
              %e:  event type (0 - falling edge, 1 rising edge)
              %s:  seconds part of the event timestamp
              %n:  nanoseconds part of the event timestamp
            magicm@magicmirror:/opt/mm/mounts/config $ gpiomon -v
            gpiomon (libgpiod) v1.6.3
            Copyright (C) 2017-2018 Bartosz Golaszewski
            License: LGPLv2.1
            This is free software: you are free to change and redistribute it.
            There is NO WARRANTY, to the extent permitted by law.
            

            -r is listed in the library help for v1.6.3

            karsten13K 1 Reply Last reply Reply Quote 0
            • karsten13K Offline
              karsten13 @smegbadger
              last edited by

              @smegbadger

              I had no idea about that, but now that you’re using Docker:

              The gpiomon command is called inside the container (doesn’t work) and you call it for testing on the host (does work).

              So I assume you have the newer version of gpiomon running in the container. So update the command in config.js to the new syntax described in the module README and try again (the new command will fail on the host but should work from inside the container).

              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