Read the statement by Michael Teeuw here.
Problem Adding Buttons & required Remote-Control Modules
-
Wanted to added hardware buttons to hide and show modules to be specified. I added the MMM-Buttons module and the required Remote Control module. I used the sample scripts to my config.js. Ran config:check which passed. I have pasted the screen output below, the first error am getting is the [108081:0916/150400.265788:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2) but have no idea where to head, any suggestions appreciated. Thank you
VR Anthony Baker[2024-09-16 15:03:59.734] [LOG] Server started …
[2024-09-16 15:03:59.734] [LOG] Connecting socket for: MMM-Buttons
[2024-09-16 15:03:59.735] [LOG] Starting node helper for: MMM-Buttons
[2024-09-16 15:03:59.735] [LOG] Connecting socket for: MMM-Remote-Control
[2024-09-16 15:03:59.736] [LOG] Starting node helper for: MMM-Remote-Control
[2024-09-16 15:03:59.758] [LOG] Connecting socket for: updatenotification
[2024-09-16 15:03:59.758] [LOG] Starting module helper: updatenotification
[2024-09-16 15:03:59.759] [LOG] Connecting socket for: MMM-homeassistant-sensors
[2024-09-16 15:03:59.759] [LOG] Connecting socket for: calendar
[2024-09-16 15:03:59.759] [LOG] Starting node helper for: calendar
[2024-09-16 15:03:59.760] [LOG] Connecting socket for: MMM-MktIndex
[2024-09-16 15:03:59.760] [LOG] Sockets connected & modules started …
[2024-09-16 15:03:59.865] [LOG] Launching application.
[108081:0916/150400.265788:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.266067:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.266298:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.266921:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.267215:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.267316:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.267455:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.270989:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.271174:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.271249:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.271340:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.271393:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.271470:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.271521:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.272998:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.273082:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.273164:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.273223:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.273304:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.273358:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.273453:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.273514:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.273621:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.273702:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.273848:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.273924:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[108081:0916/150400.274049:ERROR:gbm_wrapper.cc(74)] Failed to get fd for plane.: No such file or directory (2)
[108081:0916/150400.274120:ERROR:gbm_wrapper.cc(257)] Failed to export buffer to dma_buf: No such file or directory (2)
[2024-09-16 15:04:00.375] [INFO] System information:SYSTEM: manufacturer: ; model: ; raspberry: undefined; virtual: false
OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.47+rpt-rpi-2712
VERSIONS: electron: 31.1.0; used node: 20.14.0; installed node: 22.8.0; npm: 10.8.3; pm2: 5.4.1
OTHER: timeZone: America/New_York; ELECTRON_ENABLE_GPU: undefined
[2024-09-16 15:04:00.407] [ERROR] ERROR! Could not validate main module js file.
[2024-09-16 15:04:00.408] [ERROR] ReferenceError: Log is not defined
at Object. (/home/awwbaker/MagicMirror/modules/MMM-Jast/MMM-Jast.js:14:6243)
at Module._compile (node:internal/modules/cjs/loader:1373:14)
at Module._extensions…js (node:internal/modules/cjs/loader:1432:10)
at Module.load (node:internal/modules/cjs/loader:1215:32)
at Module._load (node:internal/modules/cjs/loader:1031:12)
at c._load (node:electron/js2c/node_init:2:17025)
at Module.require (node:internal/modules/cjs/loader:1240:19)
at require (node:internal/modules/helpers:179:18)
at Class.loadModuleDefaultConfig (/home/awwbaker/MagicMirror/modules/MMM-Remote-Control/node_helper.js:314:30)
at /home/awwbaker/MagicMirror/modules/MMM-Remote-Control/node_helper.js:268:26
at FSReqCallback.oncomplete (node:fs:198:5)
[2024-09-16 15:04:00.465] [ERROR] ERROR! Could not validate main module js file.
[2024-09-16 15:04:00.466] [ERROR] ReferenceError: Log is not defined
at Object. (/home/awwbaker/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:28:158622)
at Module._compile (node:internal/modules/cjs/loader:1373:14)
at Module._extensions…js (node:internal/modules/cjs/loader:1432:10)
at Module.load (node:internal/modules/cjs/loader:1215:32)
at Module._load (node:internal/modules/cjs/loader:1031:12)
at c._load (node:electron/js2c/node_init:2:17025)
at Module.require (node:internal/modules/cjs/loader:1240:19)
at require (node:internal/modules/helpers:179:18)
at Class.loadModuleDefaultConfig (/home/awwbaker/MagicMirror/modules/MMM-Remote-Control/node_helper.js:314:30)
at /home/awwbaker/MagicMirror/modules/MMM-Remote-Control/node_helper.js:268:26
at FSReqCallback.oncomplete (node:fs:198:5)
[2024-09-16 15:04:01.418] [LOG] Initialize button monitor_control on PIN 25
[2024-09-16 15:04:01.419] [LOG] MMM-Buttons: RPi model Raspberry Pi 5 Model B Rev 1.0
[2024-09-16 15:04:01.419] [LOG] MMM-Buttons: RPi5 detected
[2024-09-16 15:04:01.433] [LOG] Initialize button power on PIN 24
[2024-09-16 15:04:01.434] [LOG] MMM-Buttons: RPi model Raspberry Pi 5 Model B Rev 1.0
[2024-09-16 15:04:01.434] [LOG] MMM-Buttons: RPi5 detected
[108081:0916/150401.539146:ERROR:gl_utils.cc(424)] [.WebGL-0x1400c84d00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[2024-09-16 15:04:01.554] [LOG] Create new calendarfetcher for url: http://p134-caldav.icloud.com/published/2/ODY3MDc3ODQxODY3MDc3OIsPCPqyTd7gfFTuhUgnU3E8veSROaMD9lC0bXMqbeTrcdUcRFgL2q0GROkcc6XtdbepSRYxUGbDtoDb3se2UkE - Interval: 604800000
[108081:0916/150401.561896:ERROR:gl_utils.cc(424)] [.WebGL-0x1400c84d00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[2024-09-16 15:04:01.600] [LOG] Create new calendarfetcher for url: http://p134-caldav.icloud.com/published/2/ODY3MDc3ODQxODY3MDc3OIsPCPqyTd7gfFTuhUgnU3HnE0ZEnCaHErJrwvkzJ3o- - Interval: 604800000
[2024-09-16 15:04:01.602] [LOG] [MKTINDEX] Initialized.
[2024-09-16 15:04:01.610] [LOG] Please consider completing the survey at https://bit.ly/yahoo-finance-api-feedback if you haven’t already; for more info see https://github.com/gadicc/node-yahoo-finance2/issues/764#issuecomment-2056623851.
[2024-09-16 15:04:01.638] [INFO] updatenotification: Updater Class Loaded!
[2024-09-16 15:04:01.639] [INFO] updatenotification: Checking PM2 using…
[108081:0916/150401.673218:ERROR:gl_utils.cc(424)] [.WebGL-0x1400c84d00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[2024-09-16 15:04:01.739] [INFO] Checking git for module: MMM-Buttons
[108081:0916/150401.743566:ERROR:gl_utils.cc(424)] [.WebGL-0x1400c84d00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)
[2024-09-16 15:04:01.746] [LOG] Fetching crumb and cookies from https://finance.yahoo.com/quote/AAPL…
[2024-09-16 15:04:01.785] [INFO] Checking git for module: MMM-Remote-Control
[2024-09-16 15:04:01.808] [INFO] Checking git for module: MMM-homeassistant-sensors
[2024-09-16 15:04:01.832] [INFO] updatenotification: [PM2] You are not using pm2
[2024-09-16 15:04:01.842] [INFO] Checking git for module: MMM-MktIndex
[2024-09-16 15:04:01.889] [INFO] Checking git for module: MMM-TomTomTrafficIncidents
[2024-09-16 15:04:01.933] [INFO] Checking git for module: MMM-RAIN-MAP
[2024-09-16 15:04:01.948] [INFO] Checking git for module: MagicMirror
[2024-09-16 15:04:02.253] [ERROR] We expected a redirect to guce.yahoo.com, but got https://finance.yahoo.com/quote/AAPL/
[2024-09-16 15:04:02.254] [ERROR] We’ll try to continue anyway - you can safely ignore this if the request succeeds
[2024-09-16 15:04:02.256] [LOG] Success. Cookie expires on Tue Sep 16 2025 21:04:02 GMT-0400 (Eastern Daylight Time)
[2024-09-16 15:04:02.261] [LOG] fetch https://query1.finance.yahoo.com/v1/test/getcrumb
[2024-09-16 15:04:03.131] [INFO] Calendar-Fetcher: Broadcasting 165 events from http://p134-caldav.icloud.com/published/2/ODY3MDc3ODQxODY3MDc3OIsPCPqyTd7gfFTuhUgnU3HnE0ZEnCaHErJrwvkzJ3o-.
[2024-09-16 15:04:03.918] [INFO] Calendar-Fetcher: Broadcasting 281 events from http://p134-caldav.icloud.com/published/2/ODY3MDc3ODQxODY3MDc3OIsPCPqyTd7gfFTuhUgnU3E8veSROaMD9lC0bXMqbeTrcdUcRFgL2q0GROkcc6XtdbepSRYxUGbDtoDb3se2UkE.
[2024-09-16 15:04:03.923] [LOG] New crumb: 4yVwhCInEsF
[2024-09-16 15:04:28.977] [LOG] Shutting down server…
[2024-09-16 15:04:28.978] [LOG] Stopping module helper: MMM-Buttons
[2024-09-16 15:04:28.978] [LOG] Stopping module helper: updatenotification
[2024-09-16 15:04:28.978] [LOG] Stopping module helper: MMM-homeassistant-sensors
[2024-09-16 15:04:28.979] [LOG] Stopping module helper: calendar
[2024-09-16 15:04:28.979] [LOG] Stopping module helper: MMM-MktIndex
[2024-09-16 15:04:28.979] [LOG] Node_helpers stopped …
[108081:0916/150429.048417:ERROR:shared_image_manager.cc(326)] SharedImageManager::ProduceMemory: Trying to Produce a Memory representation from a non-existent mailbox.
awwbaker@raspberrypi:~/MagicMirror/config $ ^C
awwbaker@raspberrypi:~/MagicMirror/config $ npm start -
@sdetweil Yeah you’re right, that one might be more difficult. But I do have MMM-ModuleToggleButton working with pinctrl. Here’s the updated node_helper.js file just in case anyone’s interested.
node_helper.js
const NodeHelper = require('node_helper'); // eslint-disable-line import/no-extraneous-dependencies //const Gpio = require('onoff').Gpio; const { exec } = require("child_process"); module.exports = NodeHelper.create({ start() { this.started = false; }, socketNotificationReceived(notification, payload) { if (notification === 'TOGGLE_BUTTON_CONFIG' && !this.started) { const self = this; this.config = payload; //const button = new Gpio(this.config.buttonGpioPin, 'in', 'both', { persistentWatch: true, debounceTimeout: this.config.debounceTimeoutInMilliseconds }); //button.watch((err, state) => { // if (state === 1) { // self.sendSocketNotification(self.config.notificationName, true); // } //}); //this.started = true; // Set up GPIO as input using pinctrl command const pin = this.config.buttonGpioPin; const debounceTimeout = this.config.debounceTimeoutInMilliseconds; const notificationName = this.config.notificationName; let lastState = null; // Function to read the pin state using pinctrl const checkPinState = () => { exec(`pinctrl get ${pin}`, (err, stdout, stderr) => { if (err) { console.error(`Error reading GPIO state: ${err.message}`); return; } // Parse the pin state from stdout const state = stdout.includes("hi") ? 1 : 0; // Handle state change with debounce if (state !== lastState && state === 1) { this.sendSocketNotification(notificationName, true); } // Update last state lastState = state; }); }; // Set up an interval to check the pin state with debounce setInterval(checkPinState, debounceTimeout || 100); // Defaults to 100ms if debounce is not defined } } });
-
@awwbaker
that is a garbage message from electron we can’t suppress@awwbaker said in Problem Adding Buttons & required Remote-Control Modules:
this is all from MMM-RemoteControl loading the modules JS file in a different context than was intended… its not fatal> [2024-09-16 15:04:00.407] [ERROR] ERROR! Could not validate main module js file. > [2024-09-16 15:04:00.408] [ERROR] ReferenceError: Log is not defined > at Object. (/home/awwbaker/MagicMirror/modules/MMM-Jast/MMM-Jast.js:14:6243) > at Module._compile (node:internal/modules/cjs/loader:1373:14) > at Module._extensions…js (node:internal/modules/cjs/loader:1432:10) > at Module.load (node:internal/modules/cjs/loader:1215:32) > at Module._load (node:internal/modules/cjs/loader:1031:12) > at c._load (node:electron/js2c/node_init:2:17025) > at Module.require (node:internal/modules/cjs/loader:1240:19) > at require (node:internal/modules/helpers:179:18) > at Class.loadModuleDefaultConfig (/home/awwbaker/MagicMirror/modules/MMM-Remote-Control/node_helper.js:314:30) > at /home/awwbaker/MagicMirror/modules/MMM-Remote-Control/node_helper.js:268:26 > at FSReqCallback.oncomplete (node:fs:198:5) > [2024-09-16 15:04:00.465] [ERROR] ERROR! Could not validate main module js file. > [2024-09-16 15:04:00.466] [ERROR] ReferenceError: Log is not defined > at Object. (/home/awwbaker/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js:28:158622) > at Module._compile (node:internal/modules/cjs/loader:1373:14) > at Module._extensions…js (node:internal/modules/cjs/loader:1432:10) > at Module.load (node:internal/modules/cjs/loader:1215:32) > at Module._load (node:internal/modules/cjs/loader:1031:12) > at c._load (node:electron/js2c/node_init:2:17025) > at Module.require (node:internal/modules/cjs/loader:1240:19) > at require (node:internal/modules/helpers:179:18) > at Class.loadModuleDefaultConfig (/home/awwbaker/MagicMirror/modules/MMM-Remote-Control/node_helper.js:314:30) > at /home/awwbaker/MagicMirror/modules/MMM-Remote-Control/node_helper.js:268:26 > at FSReqCallback.oncomplete (node:fs:198:5)
-
Thank you so much for the info…I am a running a RPI-5.
-
@awwbaker said in Problem Adding Buttons & required Remote-Control Modules:
[2024-09-16 15:04:01.418] [LOG] Initialize button monitor_control on PIN 25
[2024-09-16 15:04:01.419] [LOG] MMM-Buttons: RPi model Raspberry Pi 5 Model B Rev 1.0
[2024-09-16 15:04:01.419] [LOG] MMM-Buttons: RPi5 detected
[2024-09-16 15:04:01.433] [LOG] Initialize button power on PIN 24
[2024-09-16 15:04:01.434] [LOG] MMM-Buttons: RPi model Raspberry Pi 5 Model B Rev 1.0
[2024-09-16 15:04:01.434] [LOG] MMM-Buttons: RPi5 detecteddid you test to make sure the buttons work outside MM?
-
it seems that the MMM-Jast module is throwing the error:
[2024-09-16 15:04:00.408] [ERROR] ReferenceError: Log is not defined at Object. (/home/awwbaker/MagicMirror/modules/MMM-Jast/MMM-Jast.js:14:6243)
-
@MarcLandis its because MagicMirror-remote-control is doing a require() on the module js
-
Mr @sdetweil
I tested my button press using:import RPi.GPIO as GPIO
import timeGPIO.setmode(GPIO.BCM)
GPIO.setup(6, GPIO.IN, pull_up_down=GPIO.PUD_UP)while True:
input_state = GPIO.input(6)
if input_state == False:
print(‘Button Pressed’)
time.sleep(0.2)That worked fine. I found the module MMM-ModuleToggleButton which seemed a bit simpler and directly what wanted to do. The demo script used GPIO 6 so used default. Do i need to use a pull_down resister? Thank Thank you again! VR Anthony
PS: Sam I looked for a link to buy you a cup of coffee, not found, but if you have one, please forward?
-
Mr @sdetweil, I also noted the below error ? Thank you!
[2024-09-20 16:36:07.413] [LOG] Sockets connected & modules started …
[2024-09-20 16:36:10.523] [LOG] Launching application.
[2024-09-20 16:36:15.920] [INFO] System information:SYSTEM: manufacturer: ; model: ; raspberry: undefined; virtual: false
OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.47+rpt-rpi-v8
VERSIONS: electron: 31.1.0; used node: 20.14.0; installed node: 22.9.0; npm: 10.8.3; pm2: 5.4.1
OTHER: timeZone: America/New_York; ELECTRON_ENABLE_GPU: undefined
[2024-09-20 16:36:20.989] [ERROR] Whoops! There was an uncaught exception…
[2024-09-20 16:36:21.019] [ERROR] Error: EINVAL: invalid argument, write
at Object.writeFileSync (node:fs:2346:20)
at exportGpio (/home/awwbaker/MagicMirror/modules/MMM-ModuleToggleButton/node_modules/onoff/onoff.js:18:8)
at new Gpio (/home/awwbaker/MagicMirror/modules/MMM-ModuleToggleButton/node_modules/onoff/onoff.js:172:36)
at Class.socketNotificationReceived (/home/awwbaker/MagicMirror/modules/MMM-ModuleToggleButton/node_helper.js:20:22)
at Socket. (/home/awwbaker/MagicMirror/js/node_helper.js:98:11)
at Socket.emit (node:events:519:28)
at Socket.emitUntyped (/home/awwbaker/MagicMirror/node_modules/socket.io/dist/typed-events.js:69:22)
at /home/awwbaker/MagicMirror/node_modules/socket.io/dist/socket.js:704:39
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
errno: -22,
code: ‘EINVAL’,
syscall: ‘write’
}
[2024-09-20 16:36:21.022] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[2024-09-20 16:36:21.027] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues
[2024-09-20 16:36:21.066] [LOG] Create new calendarfetcher for url: http://p134-caldav.icloud.com/published/2/ODY3MDc3ODQxODY3MDc3OIsPCPqyTd7gfFTuhUgnU3E8veSROaMD9lC0bXMqbeTrcdUcRFgL2q0GROkcc6XtdbepSRYxUGbDtoDb3se2UkE - Interval: 604800000
[2024-09-20 16:36:21.372] [LOG] Create new calendarfetcher for url: http://p134-caldav.icloud.com/published/2/ODY3MDc3ODQxODY3MDc3OIsPCPqyTd7gfFTuhUgnU3HnE0ZEnCaHErJrwvkzJ3o- - -
@awwbaker ps: i don’t accept coffee etc. i do this because i truly enjoy it.
i love the challenge, the great people here, and the fascinatingly huge amount of differences among all your designs. -