Read the statement by Michael Teeuw here.
ClientOnly - toggle monitor power on and off
-
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.
-
@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
-
I figured that was the case. Is it possible to load MM with a config file located somewhere other than the config directory?
-
@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 variablesearch posts w mm_config to see prior discussions
-
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?
-
@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
-
@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…