• 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.

Execute bash command/Turn off GPIO (LED) from mirror

Scheduled Pinned Locked Moved Solved Requests
11 Posts 5 Posters 1.3k Views 4 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.
  • B Offline
    BKeyport Module Developer
    last edited by May 12, 2024, 12:00 AM

    I’m looking for a quick and dirty way to turn off an LED once the mirror fully loads - basically getting around the slowness in Electron from all the random little errors on startup and waiting for systems that will never start.

    I don’t care if it’s a quick module I build myself, or something else.

    I’m assuming it can be done with all the abilities to read system info etc - just not sure how to do it myself.

    Thanks!

    The "E" in "Javascript" stands for "Easy"

    R 1 Reply Last reply May 13, 2024, 3:55 PM Reply Quote 0
    • B Offline
      bugsounet Banned
      last edited by May 12, 2024, 12:17 AM

      tip: try to use gpiozero ;)

      B 1 Reply Last reply May 12, 2024, 12:53 AM Reply Quote 0
      • B Offline
        BKeyport Module Developer @bugsounet
        last edited by May 12, 2024, 12:53 AM

        @bugsounet I actually have the bash command I need to run. Just the part of interfacing through the Mirror is what I need help with.

        The "E" in "Javascript" stands for "Easy"

        B M 2 Replies Last reply May 12, 2024, 8:41 AM Reply Quote 0
        • B Offline
          bugsounet Banned @BKeyport
          last edited by May 12, 2024, 8:41 AM

          ah sorry, so exec your code it when all modules are started.

          with ALL_MODULES_STARTED incoming system notification, you can send a notification to node_helper for exec your bash script

          For execute it in node_helper, you can use exec command of child_process library

          See:

          • system notification: about all system notification
          • sendSocketNotification for send a notification to node_helper
          • socketNotificationReceived for read notification in node_helper
          1 Reply Last reply Reply Quote 0
          • M Offline
            MMRIZE @BKeyport
            last edited by May 12, 2024, 9:56 AM

            @BKeyport
            MMM-NotificationTrigger for that purpose.

            W 1 Reply Last reply May 12, 2024, 7:02 PM Reply Quote 0
            • W Offline
              wishmaster270 Module Developer @MMRIZE
              last edited by May 12, 2024, 7:02 PM

              @MMRIZE
              Or https://github.com/Tom-Hirschberger/MMM-Notification-To-Command

              B 1 Reply Last reply May 12, 2024, 9:37 PM Reply Quote 0
              • B Offline
                BKeyport Module Developer @wishmaster270
                last edited by BKeyport May 12, 2024, 9:38 PM May 12, 2024, 9:37 PM

                @wishmaster270 @MMRIZE I figured one of you wizards already figured it out. I had forgotten about the all modules notification, and then I would have realized all the pieces are already there.

                The "E" in "Javascript" stands for "Easy"

                B 1 Reply Last reply May 12, 2024, 10:41 PM Reply Quote 0
                • B Offline
                  BKeyport Module Developer @BKeyport
                  last edited by May 12, 2024, 10:41 PM

                  FWIW, MMM-Notification-To-Command is exactly what I was aiming for.

                  The "E" in "Javascript" stands for "Easy"

                  1 Reply Last reply Reply Quote 1
                  • B BKeyport has marked this topic as solved on May 13, 2024, 1:41 AM
                  • R Offline
                    Ray @BKeyport
                    last edited by May 13, 2024, 3:55 PM

                    @BKeyport you might want to look at raspberry pi 5 I use it to turn LEDs on and off
                    I also use believers are not Dragon NaturallySpeaking which is pretty cool because I can write a letter and also turn LEDs on and off just by voice

                    B 1 Reply Last reply May 13, 2024, 8:57 PM Reply Quote 0
                    • B Offline
                      BKeyport Module Developer @Ray
                      last edited by May 13, 2024, 8:57 PM

                      @Ray pinctrl 17 op dl does the work behind the scenes, I just needed a way to call it from the mirror, which I got with MMM-Notification-to-command.

                      The "E" in "Javascript" stands for "Easy"

                      R 1 Reply Last reply May 14, 2024, 9:13 AM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        1/11
                        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