MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    [MMM-Buttons] Not recognizing button presses

    Scheduled Pinned Locked Moved Troubleshooting
    23 Posts 3 Posters 18.1k Views 2 Watching
    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.
    • istepgueuI Offline
      istepgueu @Jopyth
      last edited by istepgueu

      @Jopyth Yes of course !

      M 1 Reply Last reply Reply Quote 1
      • M Offline
        Mar @istepgueu
        last edited by

        @istepgueu So my button registers properly but its not sending out a notification at all. There are no errors and my mirror loads correctly. I’m using the pin5:test code above.

        istepgueuI 1 Reply Last reply Reply Quote 0
        • istepgueuI Offline
          istepgueu @Mar
          last edited by

          @Mar you can you test with this code and capture log from firebug

          {
                          pin: 5,
                          name: "power",
                          longPress: {
                              title: "Power off",
                              message: "Keep pressed for 3 seconds to shut down",
                              imageFA: "power-off",
                              notification: "REMOTE_ACTION",
                              payload: {action: "SHUTDOWN"}
                          },
                          shortPress: undefined
                      }
          
          M 1 Reply Last reply Reply Quote 0
          • M Offline
            Mar @istepgueu
            last edited by

            @istepgueu Alright now this is weird. I have my MM running via HDMI, and also opened it up in a Chrome tab on my laptop. When i press the buttong the inspector shows the log of the button and I get a popup on Chrome. But nothing is happening on the screen connected to the actual pi?

            istepgueuI 1 Reply Last reply Reply Quote 0
            • istepgueuI Offline
              istepgueu @Mar
              last edited by

              @Mar I suppose you have try

              pm2 restart mm
              
              M 1 Reply Last reply Reply Quote 0
              • M Offline
                Mar @istepgueu
                last edited by

                @istepgueu Tried that, also tried a reboot. Doesnt work on the screen connected to the pi, but still does when i access via a browser. Also when i access via a browser I see this show up in the logs “Initialize button power on PIN 5” but this line doesnt show up when restarting MM and accessing via the HDMI.

                istepgueuI 1 Reply Last reply Reply Quote 0
                • istepgueuI Offline
                  istepgueu @Mar
                  last edited by

                  @Mar Ok
                  1 - Your button is connected on PIN N°29 = GPIO 5 ?
                  2 - Which type of button do you have ? It’s a Push button (Button that returns alone) or a button who stay ?

                  Sorry for my english… i’m French :-)

                  M 1 Reply Last reply Reply Quote 0
                  • M Offline
                    Mar @istepgueu
                    last edited by

                    @istepgueu thank you, and not a problem of course. i can understand you perfectly fine.

                    1. correct pin 29, bcm 5
                    2. i have this type of 4 pin button. press to activate and returns to initial position when you let go (alt text)
                    istepgueuI 1 Reply Last reply Reply Quote 0
                    • istepgueuI Offline
                      istepgueu @Mar
                      last edited by

                      @Mar Can you test this :

                      1 - Reboot your Pi
                      2 - If your mirror start automatically, stop it with “pm2 stop mm”
                      3 - Execute the button.py script (adapt to GPIO5)
                      4 - Start MM with “pm2 start mm”
                      5 - Test if it’s working.

                      M 1 Reply Last reply Reply Quote 0
                      • M Offline
                        Mar @istepgueu
                        last edited by

                        @istepgueu no change. the script is recognizing the press, and so is it through the browser on my laptop. But nothing on the HDMI screen attached to the pi.

                        istepgueuI 1 Reply Last reply Reply Quote 0
                        • istepgueuI Offline
                          istepgueu @Mar
                          last edited by

                          @Mar
                          It is completely strange this story. Have you ever managed to have alerts other than the module buttons on the HDMI?

                          M 1 Reply Last reply Reply Quote 0
                          • M Offline
                            Mar @istepgueu
                            last edited by

                            @istepgueu yes im so stumped with this. its obviously working…just not on the instance on the hdmi monitor. Ive not used alerts before this, the only things ive attached to the pi are a pir sensor with a script on boot that turns my monitor on/off along with a few modules (tube status, wunderlist, and system stats) all of which are working fine.

                            istepgueuI 1 Reply Last reply Reply Quote 0
                            • istepgueuI Offline
                              istepgueu @Mar
                              last edited by

                              @Mar
                              Sorry but I have no idea … Maybe @Jopyth the creator of the module could help you?

                              M 2 Replies Last reply Reply Quote 1
                              • M Offline
                                Mar @istepgueu
                                last edited by

                                @istepgueu Well thank you for trying to help, its much appreciated.

                                1 Reply Last reply Reply Quote 1
                                • M Offline
                                  Mar
                                  last edited by Mar

                                  So seems like I only ever get to the “Initialize button power on PIN X” log statement when accessing the MM from a remote browser. Otherwise the pi doesnt hit this part of the script on its own.

                                  Only error I can see so far is this when loading midori from command line (though still initializes the pin via the browser so maybe midori doesnt like this line but chrome ignores it?

                                  ** Message: console message: http://localhost:8080/modules/MMM-Buttons//MMM-Buttons.js @86: SyntaxError: Unexpected token '('. Expected a ':' following the property name 'sendAction'.
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    Mar @istepgueu
                                    last edited by Mar

                                    @istepgueu @Jopyth Whoo hoo got it.

                                    MMM-Buttons.js: Semi colons on line 71/72 and line 86 needs to be changed to:

                                    sendAction: function(description) {
                                    

                                    where as it currently just reads:

                                    sendAction(description) {
                                    
                                    J 1 Reply Last reply Reply Quote 2
                                    • J Offline
                                      Jopyth Moderator @Mar
                                      last edited by Jopyth

                                      @Mar Good thing you found this error. Very strange, that it did not complain on my Pi before.

                                      Helpful sticky: How to troubleshoot

                                      M 1 Reply Last reply Reply Quote 1
                                      • M Offline
                                        Mar @Jopyth
                                        last edited by Mar

                                        This post is deleted!
                                        1 Reply Last reply Reply Quote 0

                                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                        With your input, this post could be even better 💗

                                        Register Login
                                        • 1
                                        • 2
                                        • 1 / 2
                                        • First post
                                          Last post
                                        Enjoying MagicMirror? Please consider a donation!
                                        MagicMirror created by Michael Teeuw.
                                        Forum managed by Sam, technical setup by Karsten.
                                        This forum is using NodeBB as its core | Contributors
                                        Contact | Privacy Policy