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.

    Installing on a Pi Zero

    Scheduled Pinned Locked Moved Troubleshooting
    175 Posts 33 Posters 248.9k Views 33 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.
    • A Offline
      andyc7687
      last edited by andyc7687

      Hi everyone…

      After lot’s of tinkering I finally got this to work on a Pi Zero W. I have answered a couple of people in the forum about this, so I thought I would put up a link to my github where I have put in each of the files I used.

      Edit:
      I have also tried making a single installer script for Pi Zero/2B/3B; if you have both platforms and the time to do it, please run bash -c "$(curl -sL https://raw.githubusercontent.com/ac2799/MagicMirror/master/installers/raspberry.sh)" from the terminal and let me know how you get on… I have tested on the Pi Zero and it appears to work fine but advice or feedback still welcomed.

      Edit2:
      Here is a pdf guide for the process.

      Some people reported difficulties when installing over SSH. The guide does tell you how to do it headless too (TL;DR: use SSH to enable VNC Server using raspi-config && download RealVNC Connect && connect headless using RealVNC Connect/VNC Viewer)

      Andrew

      idoodlerI 1 Reply Last reply Reply Quote 10
      • yawnsY Offline
        yawns Moderator
        last edited by

        Thank you. I did not test it as I do not own a Pi Zero, but it looks good. I pinned it to the top

        1 Reply Last reply Reply Quote 0
        • A Offline
          aidandon
          last edited by

          I can confirm this works. To run server cd MagicMirror then run command node server only.

          Appreciate this work!

          A 1 Reply Last reply Reply Quote 0
          • R Offline
            Ramez
            last edited by

            great :raising_hands: i think your zero repository should be mentioned in the main MM readme

            A 1 Reply Last reply Reply Quote 0
            • A Offline
              andyc7687 @Ramez
              last edited by

              @ramez Thanks Ramez, I was hoping someone might say that; don’t know who is the contributors to the main repository. Happy for a link to be passed, or for my repo to be placed back in the MM repo.

              1 Reply Last reply Reply Quote 0
              • A Offline
                andyc7687 @aidandon
                last edited by

                @aidandon you will only need to cd MagicMirror and run node server only immediately after first install if you want it straight away. Otherwise when you reboot it will go automatically (after about a 1 minute or so wait)

                1 Reply Last reply Reply Quote 0
                • idoodlerI Offline
                  idoodler Module Developer @andyc7687
                  last edited by

                  @andyc7687 Nice work. I think you should fork the MagicMirror repository, add merge your scripts with the installers/raspberry.sh script for direct implementation in the project.

                  A 1 Reply Last reply Reply Quote 0
                  • A Offline
                    andyc7687 @idoodler
                    last edited by

                    @idoodler Thanks for that advice, I have forked the original MagicMirror repo, but no idea how to merge scripts on github…

                    idoodlerI 1 Reply Last reply Reply Quote 0
                    • idoodlerI Offline
                      idoodler Module Developer @andyc7687
                      last edited by

                      @andyc7687 You need to do the following:

                      • Clone your forked repository to your local machine
                      • Adopt installers/raspberry.sh to include your Raspberry Pi Zero specific code
                      • Commit and push your changes to Github
                      • Test it on a Raspberry Pi Zero by execute bash -c "$(curl -sL https://raw.githubusercontent.com/ac2799/MagicMirror/master/installers/raspberry.sh)"
                      • Create a Pull Request on the original MagicMirror repository

                      Just contact me if you need any help, I can also test your changes, I have a spare Raspberry Pi Zero W on hand.

                      A 1 Reply Last reply Reply Quote 1
                      • A Offline
                        andyc7687 @idoodler
                        last edited by

                        @idoodler Great! I think I may have done it! I have tested most of it I think on a Pi Zero W and on a Pi 3B+; is anyone able to check whether any of my changes have affected usability on the Pi 3B and Pi 2 before I submit the pull request?

                        idoodlerI E 3 Replies Last reply Reply Quote 1
                        • idoodlerI Offline
                          idoodler Module Developer @andyc7687
                          last edited by

                          @andyc7687 I am able to try it today, I will contact you again.

                          1 Reply Last reply Reply Quote 0
                          • idoodlerI Offline
                            idoodler Module Developer @andyc7687
                            last edited by

                            @andyc7687 I just noticed, is this a server only installation?

                            A 1 Reply Last reply Reply Quote 0
                            • A Offline
                              andyc7687 @idoodler
                              last edited by

                              @idoodler I didn’t really understand what was the difference between server only and not. This installs magic mirror, runs it as server only and runs three chromium browser on start-up to display it all… functionally I couldn’t tell the difference, but there might be something I’m missing

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                dazza120
                                last edited by

                                Pi 3B+ can run the normal magic mirror load file no need to include it in the server only script, just means you need the full fat OS on the Pi

                                A 1 Reply Last reply Reply Quote 0
                                • A Offline
                                  andyc7687 @dazza120
                                  last edited by

                                  @dazza120 thanks, did you test my script? I was looking at a single installer that would auto detect 2B/3B Or Zero and install the appropriate script, thereby meaning a single repo for all platforms.

                                  It’s able to detect 3B+ and Zero and does full install for 3B+ and server only for Zero, I don’t have a 3B though to make sure it works on that.

                                  D 1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    dazza120 @andyc7687
                                    last edited by

                                    @andyc7687 no mate I done a normal install from the magic mirror bash,I’ve done it twice as I was trying to make the install as light as possible so I was trying to use Stretch with just the basic but it wouldn’t have any of it so had to install the fat version and purge all the bloat ware but from what I’ve looked at so far doesn’t use that much more ram than the lite version, only thing I ended up doing was installing PM2 manually as for some reason it wouldn’t work from the bash after restart.

                                    1 Reply Last reply Reply Quote 0
                                    • 1 Offline
                                      12wsx
                                      last edited by

                                      after install on piZero (no W version) everything is ok but serveronly and browser does not start automatically. When I send from terminal:
                                      cd ~/MagicMirror;
                                      node serveronly
                                      server start properly, In browser manually start localhost:8080 showing MagicMirror website properly. What m i missing?

                                      A 1 Reply Last reply Reply Quote 0
                                      • A Offline
                                        andyc7687 @12wsx
                                        last edited by

                                        @12wsx straight after installation did you restart the pi zero? It should run, it’s quite a slow start up process though… if you run pm2 show MagicMirror what does it say? It takes a good minute to fire up sometimes…

                                        1 Reply Last reply Reply Quote 0
                                        • 1 Offline
                                          12wsx
                                          last edited by

                                          Yes i have rebooted and wait about 10min and nothing.
                                          pm2 show MagicMirror says:

                                          root@raspberrypi:/home/pi/MagicMirror# pm2 show MagicMirror
                                          [PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
                                          [PM2] PM2 Successfully daemonized
                                          [PM2][WARN] MagicMirror doesn't exist
                                          root@raspberrypi:/home/pi/MagicMirror#
                                          

                                          :confused_face:

                                          A 1 Reply Last reply Reply Quote 0
                                          • A Offline
                                            andyc7687 @12wsx
                                            last edited by andyc7687

                                            @12wsx Did you change the default user to be called root? I’m confused as to why your prompt says root@raspberrypi, but the home directory (/home/pi/MagicMirror) is that instead of /home/root/MagicMirror

                                            As I remember, the shell script refers directly to a home drive using the user pi; if you wish to change this on your installation, issue:
                                            EDIT: I just noticed I think you’re running off my installer rather than the forked magic mirror repository that I have been testing more recently. The edits are the same, except instead of being in ~/MagicMirror/installers it’ll be in ~/MagicMirror/PiZero, and the files won’t have Pi0 on the end of their names

                                            sudo nano ~/MagicMirror/installers/startMagicMirror.sh
                                            

                                            change the bottom line so instead of pi it is the correct user’s home drive e.g.

                                            sh /home/root/MagicMirror/installers/chromium_startPi0.sh
                                            

                                            Also check pm2_MagicMirrorPi0.json and chromium_startPi0.sh in case they also are pointing to the pi user folder.

                                            then do

                                            sudo chmod a+x ~/MagicMirror/installers/startMagicMirrorPi0.sh;
                                            sudo chmod a+x ~/MagicMirror/installers/pm2_MagicMirrorPi0.json;
                                            sudo chmod a+x ~/MagicMirror/installers/chromium_startPi0.sh;
                                            

                                            to make all the files executable (just in case they aren’t already)

                                            Now run:

                                            sudo su -c "env PATH=$PATH:/usr/bin pm2 startup systemd -u pi --hp /home/pi"
                                            pm2 start ~/MagicMirror/installers/pm2_MagicMirrorPi0.json
                                            pm2 save
                                            

                                            changing the /home/pi to ensure you are in the correct user.
                                            Then restart and let me know what happens.

                                            That’s the only thing that I can think it could be at the moment

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 8
                                            • 9
                                            • 1 / 9
                                            • 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