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.

    "Client Mode" installation + PIR

    Scheduled Pinned Locked Moved Hardware
    6 Posts 2 Posters 1.7k 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.
    • K Offline
      Kostosso
      last edited by

      Good afternoon.
      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.

      1. 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?

      2. 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 … :(

      3. 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?

      4. I found a description of such a Pir-Sensor solution on the forum https://github.com/cowboysdude/Pir-Sensor

      5. 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!

      S 1 Reply Last reply Reply Quote 0
      • S Away
        sdetweil @Kostosso
        last edited by sdetweil

        @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
        https://github.com/sdetweil/MagicMirror_scripts
        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.

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        K 1 Reply Last reply Reply Quote 0
        • K Offline
          Kostosso @sdetweil
          last edited by

          @sdetweil

          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
          

          Right?

          And to wake up the monitor, use any Python script

          S 1 Reply Last reply Reply Quote 0
          • S Away
            sdetweil @Kostosso
            last edited by sdetweil

            @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?

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            K 1 Reply Last reply Reply Quote 0
            • K Offline
              Kostosso @sdetweil
              last edited by

              @sdetweil
              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
              

              Right?
              (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

              S 1 Reply Last reply Reply Quote 0
              • S Away
                sdetweil @Kostosso
                last edited by sdetweil

                @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…

                Sam

                How to add modules

                learning how to use browser developers window for css changes

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