Read the statement by Michael Teeuw here.
Running Magic Mirror remotely from source on a pi
-
Hi @devtech8 Yes, its definitely possible. I had mine running like that for a while.
Take a look at this thread: https://raspberrypi.stackexchange.com/questions/38515/auto-start-chromium-on-raspbian-jessie-11-2015
I don’t remember what script I used in the end. But that’s the way to do it. :)
You will have to “kill” chromium from time to time. It tends to “hang”. Don’t know why… -
Thanks for the reply. My issue isn’t with running Chromium in a Pi, but what do I need to do on the MM side to make this the way it should. For instance, when I run
npm start
, it pulls up Electron and browses from there. What config do I need to make this happen? Is it possible to use the Electron viewer inside Pi rather than Chromium? I do not have preference for Chromium in this case, but wasn’t sure how I could basically runnpm start
, then have it start Electron or Chromium in the pi, but then if I also wanted to, be able to test out new modules within the VM and such? -
@devtech8 Hmm… It’s two different things. Either you run the mirror as a “local” mirror = The picture come out via the HDMI port on the RPi using Electron. Or you can run the mirror on “any” server (computer in your network) then start is as a “server” = The you can open the mirror on any machine on your network. Even if you run the fist way, you can also open the mirror on any other machine in you network (depending on the access rules in your config of course). However, a RPi is not a powerful machine, so it will be fairly slow if you want it both on your “local” screen and on a networked machine at the same time.
To start as a “server” you runnode serveronly
instead ofnpm start
.
Then I recommend you to use pm2 as the “manager” for your mirror. It’s easier to troubleshoot then. :)Not sure if I answered your question. :)
I myself is running 3 different mirrors. One on a RPi (local display), one on a server with the same config as the RPi and one more on the same server on another port for development. :)
-
Thanks. The plan isn’t to run it on RPI at all at this time. But I do just want to showcase it via the RPI. That said, was there something special you have to do if you run it on RPI in Electron from a VM on another machine?
@Snille - can you share your config for how you have that setup on 3 mirrors and maybe explain the just behind it?
What is pm2?
Thanks much. Glad I found this and hope to contribute as well as I have some great ideas, but had been exploring similar software that didn’t seem as robust or maintained any longer.
-
@devtech8 Ok…
So, first I have a normal RPi with a Jessie Lite installation (just to keep everything to a minimal).
Then I followed this guide to get it running. When that guide is done. You have a fully working MM on the RPi (local installation). The config and all other information of my build you can find here.Then after that I’m running a normal Ubuntu server 16.04 (in a container (a sort of VM)) with two instances of MM running om two different ports, I followed this guide (manual installation) and in server mode two times and just put them in different folders.
Here you can find my dev and server config. The server config is basically the same as my RPi config. I’m just using it for testing before adding stuff to the RPi.To display a page in Electron that resides on another server (not the RPi) I’m not sure how to do. I have not done that. When I displayed my MM from the server on the RPi, I used Chromium in “Kiosk-mode” (as mentioned before).
This forum is full of GREAT people you can ask anything! I scavenged the forum (and tested stuff on a dev mirror) for moths before I actually built my mirror. :)
pm2 is used in this case to start and stop and troubleshoot the mirror. Otherwise it’s an extremely powerful tool in a “node” environment. I will go so far as to say that it is almost mandatory to use if you want to have control of you node apps. :)