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

ClientOnly - toggle monitor power on and off

Scheduled Pinned Locked Moved Unsolved Troubleshooting
7 Posts 2 Posters 1.3k 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.
  • E Offline
    egzachly
    last edited by Jan 5, 2023, 1:06 AM

    I’d like to run MM in a docker container because it’s easier for me to make changes and deploy. I was hoping I would be able to use a RPi with MM and run it clientOnly to access the docker container. This all works flawlessly. However, I’d like to be able to toggle the monitor power on the RPi running clientOnly remotely (via http request, mqtt, etc), but this only seems possible by using add third party modules which do not load when running clientOnly.

    Alternatively, could I ditch the docker container, and run MM via a config stored on a remote file share? Then I could easily update my config on that file share and use MMM remotecontrol to restart MM when I update my config.

    S 1 Reply Last reply Jan 5, 2023, 1:24 AM Reply Quote 1
    • S Away
      sdetweil @egzachly
      last edited by Jan 5, 2023, 1:24 AM

      @egzachly to turn off the monitor, you need to execute a command. the browser cannot do that.

      this is done by the node_helper of some module

      today the decision logic is in the browser side, the execution is in the helper.

      so client side (browser) only doesn’t work for this

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • E Offline
        egzachly
        last edited by Jan 5, 2023, 2:21 PM

        I figured that was the case. Is it possible to load MM with a config file located somewhere other than the config directory?

        S 1 Reply Last reply Jan 5, 2023, 3:25 PM Reply Quote 0
        • S Away
          sdetweil @egzachly
          last edited by sdetweil Jan 8, 2023, 10:27 PM Jan 5, 2023, 3:25 PM

          @egzachly yes

          u can set the path/name of the config.js

          this also makes it so you could launch multiple instances from the same mm folder w different configs

          export MM_CONFIG=full path to config file, or just name
          edit MMM_CONFG_FILE is the correct env variable

          search posts w mm_config to see prior discussions

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • E Offline
            egzachly
            last edited by Jan 8, 2023, 10:15 PM

            This isnt working for me

            i set up pm2 with a startup script which looks like this

            cd ~/MagicMirror
            export MM_CONFIG=/mnt/magicmirror/config.js
            DISPLAY=:0 npm start
            

            I’ve verified that the config.js is present at that folder location. when I start with pm2 i get the screen that says
            “Please create a config file or check the existing one for errors”

            to test if it was permissions error on the /mnt directory files. I copied the config to ~/mmconfig and edited the script to read

            ...
            export MM_CONFIG=/home/egzachly/mmconfig/config.js
            ...
            

            And I get the same error message.

            I then confirmed that there is not an error with the config.js by copying it to ~/MagicMirror/config/config.js and starting with

            npm start
            

            And it runs flawlessly. Unfortunately, running it from there is not what I want to do. Is there a syntax error in my pm2 shell script?

            S 2 Replies Last reply Jan 8, 2023, 10:26 PM Reply Quote 1
            • S Away
              sdetweil @egzachly
              last edited by Jan 8, 2023, 10:26 PM

              @egzachly my fault…

              export MM_CONFIG_FILE=

              sam@galliumos:~/MagicMirror$ export MM_CONFIG_FILE=/mnt/config.js
              sam@galliumos:~/MagicMirror$ npm start
              
              > magicmirror@2.22.0 start
              > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js
              
              [08.01.2023 16:24.39.762] [LOG]   Starting MagicMirror: v2.22.0
              [08.01.2023 16:24.39.768] [LOG]   Loading config ...
              [08.01.2023 16:24.39.770] [LOG]   config=/mnt/config.js
              

              I added a console print to verify

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • S Away
                sdetweil @egzachly
                last edited by Jan 8, 2023, 10:31 PM

                @egzachly also you can use the ln command to link the config.js to the real file somewhere else… MM doesn’t know the link is not a real file…

                Sam

                How to add modules

                learning how to use browser developers window for css changes

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