Read the statement by Michael Teeuw here.
Problem Adding Buttons & required Remote-Control Modules
-
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. -
-
Dear Mr @sdetweil
I think you are teaching me to fish…Did you see the error message below? Beyond the below, I booted the RPI 3B+, ran the “pinctrl set 6 op dl” command. Started MM and as previously the expected modules were hidden on start up. Pressing pushbutton did not have any affect on the display. I ran the button.py script and the button was sensed as previous. As your time permits I could use another push. Your efforts are VERY appreciated. VR Anthony Baker2024-09-21 13:33:31.232] [LOG] Connecting socket for: MMM-MktIndex
[2024-09-21 13:33:31.234] [LOG] Sockets connected & modules started …
[1856:0921/133334.081312:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.StartServiceByName: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[2024-09-21 13:33:35.622] [LOG] Launching application.
[2024-09-21 13:33:55.076] [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:
OTHER: timeZone: America/New_York; ELECTRON_ENABLE_GPU: undefined
[2024-09-21 13:33:58.321] [ERROR] Whoops! There was an uncaught exception…
[2024-09-21 13:33:58.343] [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-21 13:33:58.345] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[2024-09-21 13:33:58.347] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues
[1976:0921/133401.533219:ERROR:gl_utils.cc(424)] [.WebGL-0x34004b5b00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[2024-09-21 13:34:01.636] [LOG] Create new calendarfetcher for url: http://p134-caldav.icloud.com/published/2/ODY3MDc3ODQxODY3MDc3OIsPCPqyTd7gfFTuhUgnU3E8veSROaMD9lC0bXMqbeTrcdUcRFgL2q0GROkcc6XtdbepSRYxUGbDtoDb3se2UkE - Interval: 604800000 -
@awwbaker i am on my phone, i can’t edit, and it wants to quote whole thing .
the os has changed the rules
i posted a response the other day to a topic that had some workarounds without coding changes
-
Dear Mr @sdetweil
Please see above, it seems “on-off” is throwing errors. It seems it is used by Remote-Control-Modules as well as Buttons. I wnet back and tried buttons. The error is below: Thank you very much. Anthony[2024-09-22 11:34:50.557] [LOG] Launching application.
[2024-09-22 11:35:05.029] [ERROR] ERROR! Could not validate main module js file.
[2024-09-22 11:35:05.037] [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-22 11:35:05.689] [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:
OTHER: timeZone: America/New_York; ELECTRON_ENABLE_GPU: undefined
[2024-09-22 11:35:13.286] [LOG] Initialize button monitor_control on PIN 6
[2024-09-22 11:35:13.293] [ERROR] Whoops! There was an uncaught exception…
[2024-09-22 11:35:13.318] [ERROR] Error: EINVAL: invalid argument, write
at Object.writeFileSync (node:fs:2346:20)
at exportGpio (/home/awwbaker/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:18:8)
at new Gpio (/home/awwbaker/MagicMirror/modules/MMM-Buttons/node_modules/onoff/onoff.js:172:36)
at Class.intializeButton (/home/awwbaker/MagicMirror/modules/MMM-Buttons/node_helper.js:74:19)
at Class.intializeButtons (/home/awwbaker/MagicMirror/modules/MMM-Buttons/node_helper.js:90:18)
at Class.socketNotificationReceived (/home/awwbaker/MagicMirror/modules/MMM-Buttons/node_helper.js:26:18)
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-22 11:35:13.335] -
@awwbaker yes as i posted before
errno: -22,
code: ‘EINVAL’,
syscall: ‘write’
}the os has changed how this needs to be done
i posted a link to suggestions on how to resolve it without code changesthe Log not found is caused by the remotecontrol module
-
Thank you, I tried the pinctrl to no avail. Thank you though! Anthony
-
@awwbaker did you solve this?