Read the statement by Michael Teeuw here.
MMM-Buttons only working with the first button
-
Hi!
I set up MMM-Buttons with one button attached to pin 17. It all worked just fine.
But now I want to have five buttons, so I attached another four. These don’t work, only the first one…I’ve configured the module like this:
{ module: 'MMM-Buttons', config: { buttons: [ { pin: 17, name: "Tom", shortPress: { notification: "CURRENT_PROFILE", payload: "Tom" }, }, { pin: 27, name: "Alice", shortPress: { notification: "CURRENT_PROFILE", payload: "Alice" }, }, { pin: 22, name: "default", shortPress: { notification: "CURRENT_PROFILE", payload: "default" }, }, { pin: 18, name: "Jimmy", shortPress: { notification: "CURRENT_PROFILE", payload: "Jimmy" }, }, { pin: 15, name: "Max", shortPress: { notification: "CURRENT_PROFILE", payload: "Max" }, } ] } },
Thanks for helping!
Edit: The button clicks don’t get registered…
-
first check you wiring and make sure you connect the circut perfictly. secondly, try to work button by button see how it goes.
check your buttons by trying this python script on python idle
https://raspberrypihq.com/use-a-push-button-with-raspberry-pi-gpio/
then add your other buttons then check them if they give you the alert after that check back on magic mirror. -
I’m not sure, but I think you have to define the longpress option for each button
{ module: 'MMM-Buttons', config: { buttons: [ { pin: 17, name: "Tom", shortPress: { notification: "CURRENT_PROFILE", payload: "Tom" }, longPress: undefined }, { pin: 27, name: "Alice", shortPress: { notification: "CURRENT_PROFILE", payload: "Alice" }, longPress: undefined }, { pin: 22, name: "default", shortPress: { notification: "CURRENT_PROFILE", payload: "default" }, longPress: undefined }, { pin: 18, name: "Jimmy", shortPress: { notification: "CURRENT_PROFILE", payload: "Jimmy" }, longPress: undefined }, { pin: 15, name: "Max", shortPress: { notification: "CURRENT_PROFILE", payload: "Max" }, longPress: undefined } ] } },
-
@broberg thats what I though also
-
Also make sure you are using a pull-down resistor with each button to avoid a floating status of the GPIO pin. I currently have no link at hand, but if you search the forum or Google you‘ll find a scheme how wire the pull-down.