"Client Mode" installation + PIR
I made my first mirror on RPi3 and it worked pretty well. But with an increase in the number of modules, it began to work very unstable. Unfortunately, I don’t have RPi4 and decided to migrate everything to Docker on my server. I was able to run my project and see the “picture” in Chrome on PC.
Now I want to run my finished mirror in “kiosk” mode. I have never done this and I have many questions.
I found several posts on this topic, but they are few and there are no specific solutions.
How to set the system correctly for this mode? Is it possible to just use the browser on the Raspberry or is it better to set it to “Client Only” mode?
If “Client Only” is better, are there any instructions on how to do it right?!? This is a very important question, since the instructions on the site only say “run it with: node clientonly --address 192.168.1.5 --port 8080” and how to install is not described …
I have a PIR sensor. It worked fine (waking up the mirror) when a person walked by (I don’t want to keep the mirror on all the time, including at night). A man approached - the mirror (monitor) turned on. I’m using a monitor connected to the Raspberry’s standard HDMI output. How can I use the sensor in Client Only mode? Can it be connected to PM2?
I found a description of such a Pir-Sensor solution on the forum https://github.com/cowboysdude/Pir-Sensor
If this is not possible, would it be a good idea to put a relay with a motion sensor that will turn off the power to the monitor?
Thanks a lot in advance!
@Kostosso before there was a decent pi browser, client mode was useful. not so.much now.
you can run browser in kiosk mode and never know.
see the run-start.sh here
for the syntax to launch Chromebox midori in kiosk mode. down near the end.
I use this on pi0w where electron is broken
pirbo the pi, w remote, sure
when someone approaches the pi, the remote will wake up. don’t know how to do the pir at the remote browser wakeup.
Thanks for the answer.
If I understand correctly, then it is enough for me to install a minimal system with a graphical interface and Cromium on RPI.
After that, do the following line in autorun
open -a "Google Chrome" http://localhost:$port --args -noerrdialogs -kiosk -start_maximized --disable-infobars --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null
And to wake up the monitor, use any Python script
@Kostosso open is a macOS command
the one above is for chrome or chromium-browser
different names depending on system
yes, and pir connected to pi, which is the UI only system. then python to wake/sleep
localhost means mm server is on the same system?
Okay, then the command on the RPi should look like this?
"chromium-browser" -noerrdialogs -kiosk -start_maximized --new-window --site-per-process --no-zygote --no-sandbox --disable-infobars --app=http://192.168.10.232:8080 --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors --user-data-dir=$r 2>/dev/null
(No, docker with the server is on a different host.)
I’ve read here that there can be problems with Cromium and that automatically restarting pm2 helps solve them. Or is this already “outdated information”?
Thanks a lot
@Kostosso not outdated…
pm2 (node process manager) job is to start (at boot too) AND keep running any number of processes
you can define the process in a json file (so you can have a pretty name vs the name of the script/executable)
see the pm2_MagicMirror.json on my scripts site for the model I use in the install script
or pm2 start xxx.sh (bash scripts MUST have .sh extension) if u start them directly)
you can start your browser and also the python script with pm2…