• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

struggle with MMM-Remote-Control and MMM-Buttons

Scheduled Pinned Locked Moved Development
9 Posts 2 Posters 1.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.
  • M Offline
    matyldatait
    last edited by Feb 15, 2023, 12:51 AM

    Hi there.

    Beginner here. I’m finding it a very steep learning curve. I just want a pushbutton (GPIO) to hide/show a module. I thought it would be simple.

    Trawling the forums led me to believe that I can use MMM-Buttons and MMM-Remote-Control. I dont need remote-control through a web interface,but it seemed like the module would still be useful for handling notifications.

    Sorry if this is a bit idiotic - like I said - steep learning curve

    So far I have installed both modules and have this is my config.js:

    {
        module: 'MMM-Remote-Control',
        // uncomment the following line to show the URL of the remote control on the mirror
        position: 'bottom_left',
        // you can hide this module afterwards from the remote control itself
        config: {
            customCommand: {},  // Optional, See "Using Custom Commands" below
            showModuleApiMenu: true, // Optional, Enable the Module Controls menu
            secureEndpoints: true, // Optional, See API/README.md
            // uncomment any of the lines below if you're gonna use it
            //customMenu: "custom_menu.example.json", // Optional, See "Custom Menu Items" below
            // apiKey: "", // Optional, See API/README.md for details
            // classes: {} // Optional, See "Custom Classes" below
        }
    },
    
    {
        module: 'MMM-Buttons', //using GPIO numbers
        config: {
            buttons: [
                       {
                    pin: 25,
                    name: "compliments_visibility",
                    longPress: {
                        notification: "REMOTE_ACTION",
                        payload: {action: "HIDE", module: "compliments"}
                    },
                    shortPress: {
                        notification: "REMOTE_ACTION",
                        payload: {action: "SHOW", module: "compliments"}
                     }
                },
     
                {
                    pin: 7,
                    name: "monitor_control",
                    longPress: {
                        notification: "REMOTE_ACTION",
                        payload: {action: "MONITOROFF"}
                    },
                    shortPress: {
                        notification: "REMOTE_ACTION",
                        payload: {action: "MONITORON"}
                    }
                },
                {
                    pin: 24,
                    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
                }
            ]
        }
    },
    
    
    S 1 Reply Last reply Feb 15, 2023, 3:03 PM Reply Quote 0
    • S Offline
      sdetweil @matyldatait
      last edited by Feb 15, 2023, 3:03 PM

      @matyldatait do the buttons trigger outside using MagicMirror?

      there are python scripts one could use to test

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      M 2 Replies Last reply Feb 16, 2023, 3:45 AM Reply Quote 0
      • M Offline
        matyldatait @sdetweil
        last edited by Feb 16, 2023, 3:45 AM

        @sdetweil good idea as a first step debugging. This scrip suggested doing it with button connected between a GPIO pin and ground:

        http://razzpisampler.oreilly.com/ch07.html

        …and yes - that works

        S 1 Reply Last reply Feb 16, 2023, 4:23 AM Reply Quote 0
        • S Offline
          sdetweil @matyldatait
          last edited by Feb 16, 2023, 4:23 AM

          @matyldatait and is the vpuo.pin numbering the same between the test tool you used and theagic mirror module? there are two different numbering schemes

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          M 1 Reply Last reply Feb 16, 2023, 7:22 AM Reply Quote 0
          • M Offline
            matyldatait @sdetweil
            last edited by Feb 16, 2023, 4:38 AM

            @sdetweil having established that the button is working as connected on pin18,I simplified the button module usage in my config to this:

                module: 'MMM-Buttons', //use GPIO numbers
                config: {
                    buttons: [
                               {
                            pin: 18,
                            name: "test",
                            shortPress: {message: "button pressed"}
                               },
                            ]
                        },
            

            Still nothing. No message in my terminal or on mirror screen.

            1 Reply Last reply Reply Quote 0
            • M Offline
              matyldatait
              last edited by Feb 16, 2023, 4:41 AM

              So, figured I could try reinstalling MMM-Buttons. I get this output on attempting to install. Gibberish tome :(

              matylda@raspberrypi:~/MagicMirror $ cd MMM-Buttons/
              matylda@raspberrypi:~/MagicMirror/MMM-Buttons $ npm install
              npm WARN deprecated har-validator@5.1.5: this library is no longer supported
              npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
              npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
              npm WARN deprecated electron-rebuild@1.11.0: Please use @electron/rebuild moving forward. There is no API change, just a package name change

              Magic-Mirror-Module-Buttons@1.0.0 postinstall
              node_modules/.bin/electron-rebuild -e …/…/node_modules/electron

              An unhandled error occurred inside electron-rebuild
              Unable to find electron’s version number, either install it or specify an explicit version

              Error: Unable to find electron’s version number, either install it or specify an explicit version
              at /home/matylda/MagicMirror/MMM-Buttons/node_modules/electron-rebuild/lib/src/cli.js:87:19
              at Generator.next ()
              at fulfilled (/home/matylda/MagicMirror/MMM-Buttons/node_modules/electron-rebuild/lib/src/cli.js:6:58)
              npm ERR! code 255
              npm ERR! path /home/matylda/MagicMirror/MMM-Buttons
              npm ERR! command failed
              npm ERR! command sh -c – node_modules/.bin/electron-rebuild -e …/…/node_modules/electron

              npm ERR! A complete log of this run can be found in:
              npm ERR! /home/matylda/.npm/_logs/2023-02-16T04_32_03_500Z-debug-0.log

              S 1 Reply Last reply Feb 16, 2023, 1:37 PM Reply Quote 0
              • M Offline
                matyldatait @sdetweil
                last edited by Feb 16, 2023, 7:22 AM

                @sdetweil yes it is - I also tried both numbering schemes to be sure

                1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @matyldatait
                  last edited by Feb 16, 2023, 1:37 PM

                  @matyldatait install problem, yes
                  use my fork which contains a fix for that

                  https://github.com/sdetweil/MMM-Buttons

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  M 1 Reply Last reply Feb 16, 2023, 9:44 PM Reply Quote 0
                  • M Offline
                    matyldatait @sdetweil
                    last edited by Feb 16, 2023, 9:44 PM

                    @sdetweil thanks very much Sam - I will try that

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    1 / 1
                    • First post
                      1/9
                      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