• 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.

Issues with MMM-Button

Scheduled Pinned Locked Moved Unsolved Troubleshooting
7 Posts 3 Posters 241 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 15 days ago

    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 K 2 Replies Last reply 15 days ago Reply Quote 0
    • S Offline
      sdetweil @schlomm
      last edited by sdetweil 13 days ago 15 days ago

      @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
      • K Online
        KristjanESPERANTO Module Developer @schlomm
        last edited by 15 days ago

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

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

          @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?

          K S 2 Replies Last reply 13 days ago Reply Quote 1
          • K Online
            KristjanESPERANTO Module Developer @schlomm
            last edited by 13 days ago

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

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

              @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 13 days ago

                @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
                • 1 / 1
                1 / 1
                • First post
                  1/7
                  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