Loving MagicMirror so far! I built a picture frame for my wife using a Raspberry Pi 4 and a random screen that was laying around. Got it working with MMM-GooglePhotos so we can drop pictures into a shared folder and have them show up, MMM-Pir to turn the screen off when nobody is around and back on when somebody walks in, MMM-MoonPhase, and the default calendar and weather modules. I’m trying to use the MMM-Buttons module to use a momentary push switch to hide all of the modules I have normally displayed and show MMM-Breathwork in the center of the screen for one minute. Breathwork works fine permanently displayed with the rest of the modules.
So, I’ve got the switch hooked up to GPIO 24 and ground, but can’t get any reaction using the button. I’ve been trying to test it with the example setup and MMM-Remote-Control. It looks like this:
{
module: "MMM-Buttons",
config: {
buttons: [
{
pin: 24,
name: "monitor_control",
longPress: [
{
notification: "REMOTE_ACTION",
payload: {action: "MONITOROFF"}
}
],
shortPress: [
{
notification: "REMOTE_ACTION",
payload: {action: "MONITORTOGGLE"}
}
]
},
]
}
},
I have found an error in the logs and tried unsuccessfully to sort it out.
0|MagicMir | at new Gpio (/home/magicmirror2/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:172:36)
0|MagicMir | at Class.intializeButton (/home/magicmirror2/MagicMirror/modules/MMM-Buttons/node_helper.js:89:19)
0|MagicMir | at Class.intializeButtons (/home/magicmirror2/MagicMirror/modules/MMM-Buttons/node_helper.js:105:18)
0|MagicMir | at Class.socketNotificationReceived (/home/magicmirror2/MagicMirror/modules/MMM-Buttons/node_helper.js:28:18)
0|MagicMir | at Socket.<anonymous> (/home/magicmirror2/MagicMirror/js/node_helper.js:91:10)
0|MagicMir | at Socket.onevent (/home/magicmirror2/MagicMirror/node_modules/socket.io/dist/socket.js:462:26)
0|MagicMir | at Socket._onpacket (/home/magicmirror2/MagicMirror/node_modules/socket.io/dist/socket.js:430:22)
0|MagicMir | at /home/magicmirror2/MagicMirror/node_modules/socket.io/dist/client.js:214:24
0|MagicMir | at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
0|MagicMir | errno: -22,
0|MagicMir | code: 'EINVAL',
0|MagicMir | syscall: 'write'
0|MagicMir | }
So it appears to have to do with onoff. At some point in my several hours of troubleshooting I also found this error:
The module '/home/magicmirror2/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build/Release/epoll.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 131. This version of Node.js requires
NODE_MODULE_VERSION 128. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
I resorted to having ChatGTP try and help me, but it seemed to be working off of old information as it suggested node.js version 16 and I see 20 or 22+ now. I have 20 installed. I also tried 22 and 23. I did re-install epoll and MMM-Buttons dependencies and stuff.
Any help would be greatly appreciated. I’m just a tinkerer and not a programmer or anything, so the fix may be obvious to someone more knowledgeable in this sort of thing than me. If the answer is wait for an update to come out from someone or another I’m perfectly fine with that, but figured I’d ask and maybe get a fix or at least the knowledge that an update will come out at some point. Thanks!