Read the statement by Michael Teeuw here.
Unknown Error after initializing buttons
-
@changaud the error is that the gpio pin is in input only mode not output
-
@changaud looking at the code there is a field used for a button that is not defined
activeLow
can you add this to your button definitions
after pin:
activeLow: true or false depending on how you have it wired
if the signal is high when pressed, then false.
if it has a pull up resistor then true, it will be pulled down when pressedyou said your python is reporting high sll the time
-
@sdetweil
I tried{ module: 'MMM-Buttons', //position: "middle_center", config: { buttons: [ { pin: 5, activeLow = false, name: "test_button", longPress: { notification: "PAUSE_STOPWATCHTIMER", payload: {action: "PAUSE_STOPWATCHTIMER"} }, shortPress: { notification: "START_STOPWATCH", payload: {action: "START_STOPWATCH"} } } ] } } and I get this error:
[ERROR] WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/group6/MagicMirror/config/config.js:117
activeLow = false,
^^^^^^^^^^^^^^^^^SyntaxError: Invalid shorthand property initializer
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1160:20)
at Module._compile (node:internal/modules/cjs/loader:1212:27)
at Module._extensions…js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1098:32)
at Module._load (node:internal/modules/cjs/loader:945:12)
at c._load (node:electron/js2c/node_init:2:13672)
at Module.require (node:internal/modules/cjs/loader:1122:19)
at require (node:internal/modules/helpers:130:18)
at loadConfig (/home/group6/MagicMirror/js/app.js:117:14)
at App.start (/home/group6/MagicMirror/js/app.js:250:18)
at Object. (/home/group6/MagicMirror/js/electron.js:193:7)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions…js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1098:32)
at Module._load (node:internal/modules/cjs/loader:945:12)``t
-
@changaud said in Unknown Error after initializing buttons:
activeLow = false,
not =
activeLow : false
-
@sdetweil That did not fix the error :(
-
-
@sdetweil Yes I do. I think I will just implement it with TouchButtons. But thank you so much for all your help.
-
@changaud which same error are we talking about? the syntax error or the einval write error