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

MMM-Remote-Control can not turn ON monitor

Scheduled Pinned Locked Moved Solved Troubleshooting
23 Posts 3 Posters 4.7k Views 3 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.
  • A Offline
    anaghd @sdetweil
    last edited by anaghd Nov 2, 2021, 7:51 PM Nov 2, 2021, 7:49 PM

    @sdetweil I was wondering if we can do something similar to what they have done but modify it for cec utilities, especially in regards to the status command.

    S 1 Reply Last reply Nov 2, 2021, 8:07 PM Reply Quote 0
    • S Offline
      sdetweil @anaghd
      last edited by Nov 2, 2021, 8:07 PM

      @anaghd sorry don’t understand

      if we could do something??

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      A 1 Reply Last reply Nov 2, 2021, 8:36 PM Reply Quote 0
      • A Offline
        anaghd @sdetweil
        last edited by Nov 2, 2021, 8:36 PM

        @sdetweil can we modify this to include cec-utility commands instead of the vcgencmd?

        monitorStatusCommand: ‘if vcgencmd display power | grep 1 >/dev/null 2>&1; then echo true; else echo false; fi’

        S 1 Reply Last reply Nov 2, 2021, 8:48 PM Reply Quote 0
        • S Offline
          sdetweil @anaghd
          last edited by Nov 2, 2021, 8:48 PM

          @anaghd oh… I don’t know the module internals or config at all…

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          A 1 Reply Last reply Nov 3, 2021, 4:22 AM Reply Quote 0
          • A Offline
            anaghd @sdetweil
            last edited by Nov 3, 2021, 4:22 AM

            @sdetweil I finally have a solution that worked for me.

            In the node_helper.js file, there is a function with the name “monitorControl”. In there, I used 2 things as shown below. Essentially, we want it to execute both, vcgen and cec, when we turn the monitor on and off. So I added the cec command to the already existing vcgencmd command. Now it looks like this.

            this.thisConfig.customCommand.monitorOnCommand:
            “vcgencmd display_power 1 && sudo echo 'on 0 | cec-client -s -d 1”;

            this.thisConfig.customCommand.monitorOffCommand:
            “vcgencmd display_power 0 && sudo echo 'standby 0 | cec-client -s -d 1”;

            I did not change anything in the statusCommand part.

            After that, I removed the customCommands from my config so that the module uses the default commands above for turning monitor ON and Off. That worked for me. See if it works for you.

            S S 2 Replies Last reply Nov 3, 2021, 3:40 PM Reply Quote 0
            • S Offline
              sdetweil @anaghd
              last edited by Nov 3, 2021, 3:40 PM

              @anaghd no, but you could have put the same strings in your custom commands

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              A 1 Reply Last reply Nov 3, 2021, 7:07 PM Reply Quote 0
              • A Offline
                anaghd @sdetweil
                last edited by Nov 3, 2021, 7:07 PM

                @sdetweil I tried doing that initially but that did not work for me.

                1 Reply Last reply Reply Quote 0
                • S Offline
                  stevegoble @anaghd
                  last edited by Jan 1, 2022, 11:20 AM

                  @anaghd said in MMM-Remote-Control can not turn ON monitor:

                  “vcgencmd display_power 0 && sudo echo 'standby 0 | cec-client -s -d 1”;

                  I am not a programmer but there seems to be a syntax error in this line of code (and the next one too). Shouldn’t there be a closing ’ after the opening 'standby ?

                  S 1 Reply Last reply Jan 1, 2022, 11:26 AM Reply Quote 1
                  • S Offline
                    stevegoble @stevegoble
                    last edited by Jan 1, 2022, 11:26 AM

                    @anaghd
                    Even adding what I think is the correct syntax I still get an error. I am having the same issue where the TV will not turn back on after it goes to “sleep”. Initially (with unmodified code), as long as it is searching for the HDMI signal it will turn the monitor back on; however, when the signal search stops these commands will not turn the TV back on.
                    Here is the error:
                    Whoops! There was an uncaught exception…
                    0|mm | [01.01.2022 06:21.55.922] [ERROR]
                    0|mm | /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:640
                    0|mm | “vcgencmd display_power 1” && sudo echo ‘on 0’ | cec-client -s -d 1”;
                    0|mm | ^^^^

                    S 1 Reply Last reply Jan 1, 2022, 1:23 PM Reply Quote 0
                    • S Offline
                      sdetweil @stevegoble
                      last edited by Jan 1, 2022, 1:23 PM

                      @stevegoble do you have the cec code installed?

                      do

                      cec-client
                      

                      if you get command not found
                      do

                      sudo apt install cec-utils
                      

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 1
                      • 1
                      • 2
                      • 3
                      • 2 / 3
                      • 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