Read the statement by Michael Teeuw here.
Issues with MMM-Button
-
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 :)
-
@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
-
@schlomm Did you try the fork on the module list?
https://github.com/MarcLandis/MMM-Buttons -
@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?
-
@schlomm There is a PR that seems to fix the issue: https://github.com/MarcLandis/MMM-Buttons/pull/11
-
@KristjanESPERANTO Argh…I didn’t see that :-/ Nevermind…at least I’ve learned something about the Module…
-
@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