MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.25.0 is available! For more information about this release, check out this topic.

    UNSOLVED MMM-Buttons only working with the first button

    Troubleshooting
    4
    5
    905
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tomXGames last edited by tomXGames

      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…

      1 Reply Last reply Reply Quote 0
      • L
        La7dan last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • broberg
          broberg Project Sponsor last edited by

          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
          			            }
          			        ]
          			    }
          },
          
          L 1 Reply Last reply Reply Quote 0
          • L
            La7dan @broberg last edited by

            @broberg thats what I though also

            1 Reply Last reply Reply Quote 0
            • Fozi
              Fozi Project Sponsor last edited by

              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.

              HowTo: Replace PIR Sensor with a RCWL-0516 Microwave Sensor

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy