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-Button

    Scheduled Pinned Locked Moved Solved Troubleshooting
    7 Posts 3 Posters 962 Views 3 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
      schlomm
      last edited by

      Hi all,
      After using my mirror for some some, I would like to add some custom features using the MMM-Buttons modules, forked / developed by @sdetweil
      After downloading and installing the module, pressing a button does not trigger the desired actions.

      Instead, some “beautiful” logs are coming after restarting my MagicMirror using pm2:

      2025-06-08 00:52:32.659] [ERROR] Whoops! There was an uncaught exception... 
      [2025-06-08 00:52:32.667] [ERROR] Error: EINVAL: invalid argument, write
          at Object.writeFileSync (node:fs:2426:20)
          at exportGpio (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:18:8)
          at new Gpio (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:172:36)
          at Class.intializeButton (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:74:19)
          at Class.intializeButtons (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:90:18)
          at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:26:18)
          at Socket.<anonymous> (/home/pi/MagicMirror/js/node_helper.js:91:10)
          at Socket.onevent (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:462:26)
          at Socket._onpacket (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:430:22)
          at /home/pi/MagicMirror/node_modules/socket.io/dist/client.js:214:24
          at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
        errno: -22,
        code: 'EINVAL',
        syscall: 'write'
      } 
      

      I’m using the latest MagicMirror release.
      Do you have any tips, where I can have a look?

      Thanks :)

      S KristjanESPERANTOK 2 Replies Last reply Reply Quote 0
      • S Offline
        schlomm @KristjanESPERANTO
        last edited by

        @KristjanESPERANTO I set up a fresh MagicMirror instance and checked the https://github.com/MarcLandis/MMM-Buttons repository. As a result I get the same issue:

        [2025-06-09 22:57:35.709] [ERROR] Whoops! There was an uncaught exception... 
        [2025-06-09 22:57:35.718] [ERROR] Error: EINVAL: invalid argument, write
            at Object.writeFileSync (node:fs:2426:20)
            at exportGpio (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:18:8)
            at new Gpio (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:172:36)
            at Class.intializeButton (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:89:19)
            at Class.intializeButtons (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:105:18)
            at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:28:18)
            at Socket.<anonymous> (/home/pi/MagicMirror/js/node_helper.js:91:10)
            at Socket.onevent (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:462:26)
            at Socket._onpacket (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:430:22)
            at /home/pi/MagicMirror/node_modules/socket.io/dist/client.js:214:24
            at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
          errno: -22,
          code: 'EINVAL',
          syscall: 'write'
        }
        

        …Yesterday evening I tried to fix the issue of not beingable to control the MagicMirror using some buttons. Digged into the original module, asked help of ChatGPT, debugged some functions and as a result I have a running version for Bookworm.
        I’ll try to put this in a Github Repo - will update this thread as soon as I did :)

        @sdetweil You’ve said that I only need to change some settings in the rasp-config. Do you have any additional information what needs to be changed?

        KristjanESPERANTOK S 2 Replies Last reply Reply Quote 1
        • S Offline
          sdetweil @schlomm
          last edited by sdetweil

          @schlomm the bookworm os requires some configuration for the gpio pins. I think you can do this w raspi-config
          Edit: this is not correct, my mistake (Sam)

          I am not the author. I just fixed the Postinstall process

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • KristjanESPERANTOK Offline
            KristjanESPERANTO Module Developer @schlomm
            last edited by

            @schlomm Did you try the fork on the module list?
            https://github.com/MarcLandis/MMM-Buttons

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

              @KristjanESPERANTO I set up a fresh MagicMirror instance and checked the https://github.com/MarcLandis/MMM-Buttons repository. As a result I get the same issue:

              [2025-06-09 22:57:35.709] [ERROR] Whoops! There was an uncaught exception... 
              [2025-06-09 22:57:35.718] [ERROR] Error: EINVAL: invalid argument, write
                  at Object.writeFileSync (node:fs:2426:20)
                  at exportGpio (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:18:8)
                  at new Gpio (/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:172:36)
                  at Class.intializeButton (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:89:19)
                  at Class.intializeButtons (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:105:18)
                  at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-Buttons/node_helper.js:28:18)
                  at Socket.<anonymous> (/home/pi/MagicMirror/js/node_helper.js:91:10)
                  at Socket.onevent (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:462:26)
                  at Socket._onpacket (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:430:22)
                  at /home/pi/MagicMirror/node_modules/socket.io/dist/client.js:214:24
                  at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
                errno: -22,
                code: 'EINVAL',
                syscall: 'write'
              }
              

              …Yesterday evening I tried to fix the issue of not beingable to control the MagicMirror using some buttons. Digged into the original module, asked help of ChatGPT, debugged some functions and as a result I have a running version for Bookworm.
              I’ll try to put this in a Github Repo - will update this thread as soon as I did :)

              @sdetweil You’ve said that I only need to change some settings in the rasp-config. Do you have any additional information what needs to be changed?

              KristjanESPERANTOK S 2 Replies Last reply Reply Quote 1
              • KristjanESPERANTOK Offline
                KristjanESPERANTO Module Developer @schlomm
                last edited by

                @schlomm There is a PR that seems to fix the issue: https://github.com/MarcLandis/MMM-Buttons/pull/11

                S 1 Reply Last reply Reply Quote 1
                • S Offline
                  schlomm @KristjanESPERANTO
                  last edited by

                  @KristjanESPERANTO Argh…I didn’t see that :-/ Nevermind…at least I’ve learned something about the Module…

                  1 Reply Last reply Reply Quote 1
                  • S Offline
                    sdetweil @schlomm
                    last edited by

                    @schlomm said in Issues with MMM-Button:

                    @sdetweil You’ve said that I only need to change some settings in the rasp-config. Do you have any additional information what needs to be changed?

                    I updated my post, I was incorrect

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

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