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.

    How I got my Magic Mirror working on a Raspberry Pi 0 (zero)

    Scheduled Pinned Locked Moved Tutorials
    raspberry pipi0zeropizeropi1
    204 Posts 47 Posters 611.2k Views 47 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.
    • M Offline
      mmaino12 @12wsx
      last edited by

      @12wsx That error log means that you already have a server running on port 8080. You need to kill the existing server and then restart your new mirror server with “npm start”.

      1 Reply Last reply Reply Quote 1
      • D Offline
        delusional112
        last edited by

        Hi guys,

        Used the image from @SebTota. MM2 is starting and running. But i can’t get my pi zero W to connect to my wifi. I edited the WPA_supplicant file. Can’t get it to work. Also i tried with a command found on google to scan for networks. But it responds Wlan0 can’t scan.

        Thanks in advance for the help.

        H 1 Reply Last reply Reply Quote 0
        • H Offline
          Hawking @delusional112
          last edited by

          @delusional112
          I didn’t use the image but used my own installation. Therefore In can’t tell for sure. However,where ist the wpa_supplicant.conf you are referring to located? Did you use/create one directly on /boot? This should automatically be copied to the “normal” location and then automatically get deleted.

          My wpa_suplicant.conf file looked like

          ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
          update_config=1
          network={
          ssid="NAMEOFNETWORK"
          psk="WPA2KEY"
          }
          

          (of course you have put your network name and key in, but keep the quotation marks).
          Which editor did you use (not that there is a problem with the line end or something similar)?

          Once it worked, I replaced the clear text psk by a passphrase by using wpa_passphrase.

          `

          1 Reply Last reply Reply Quote 0
          • S Offline
            SebTota
            last edited by

            Man I put the mirror in the closet for a little, came back to finally finish the frame and put it on the wall, updated it and more trouble. Oh gosh.

            1 Reply Last reply Reply Quote 0
            • S Offline
              SebTota @Mitchfarino
              last edited by

              @Mitchfarino Thanks for sharing my link!

              1 Reply Last reply Reply Quote 0
              • S Offline
                SebTota
                last edited by

                Did anyone get this working on the Pi Zero or Pi Zero W after the new update?

                H 1 Reply Last reply Reply Quote 0
                • H Offline
                  Hawking @SebTota
                  last edited by

                  @SebTota
                  Which updates are you referring to? I’m still using Raspbian Jessie Light (I didn’t use the image provided in this thread but my own installation and didn’t update so Stretch yet), which is up to date (according to sudo apt-get update && sudo apt-get upgrade) and the latest version of MagicMirror (according to cd ~/MagicMirror && sudo git pull) and don’t see any (new) issues on my Pi Zero W.

                  What are your problems?
                  `

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    SebTota @Hawking
                    last edited by

                    @Hawking I get an error saying that modules/color is missing or something like that. I’ve been working on it for 3 days but can’t get it to work.

                    H 1 Reply Last reply Reply Quote 0
                    • H Offline
                      Hawking @SebTota
                      last edited by

                      @SebTota

                      • Do you also get this error if you use a very minimal config file like
                      var config = {
                              port: 8080,
                              ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
                              language: "en",
                              timeFormat: 24,
                              units: "metric",
                              modules: [
                                      {
                                              module: "clock",
                                              position: "top_left"
                                      },
                              ]
                      };
                      
                      /*************** DO NOT EDIT THE LINE BELOW ***************/
                      if (typeof module !== "undefined") {module.exports = config;}
                      

                      If this works, you can step by step add the modules you want and see which one causes the problem.

                      • The exact error message would be helpful for an analysis.
                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        SebTota @Hawking
                        last edited by

                        @Hawking
                        module.js:339
                        throw err;
                        ^

                        Error: Cannot find module ‘express’
                        at Function.Module._resolveFilename (module.js:337:15)
                        at Function.Module._load (module.js:287:25)
                        at Module.require (module.js:366:17)
                        at require (module.js:385:17)
                        at Object. (/home/pi/MagicMirror/js/server.js:8:15)
                        at Module._compile (module.js:435:26)
                        at Object.Module._extensions…js (module.js:442:10)
                        at Module.load (module.js:356:32)
                        at Function.Module._load (module.js:311:12)
                        at Module.require (module.js:366:17)

                        and then the browser loads and says it cannot find http://localhost:8080

                        S 1 Reply Last reply Reply Quote 0
                        • S Offline
                          SebTota @SebTota
                          last edited by SebTota

                          @SebTota I went to my old image from before the update and thats still working fine, but when I updated it, it again had the error come up. The only difference is last time I did the update it said Error: Cannot find module ‘colors’

                          H 1 Reply Last reply Reply Quote 0
                          • H Offline
                            Hawking @SebTota
                            last edited by Hawking

                            @SebTota
                            I still don’t understand what update you are referring to.
                            Both error messages sound like there are modules missing (either “express” or “colors”).

                            What happens if you do

                            cd ~/MagicMirror && sudo npm install
                            cd ~/MagicMirror/vendor && npm install
                            
                            S 1 Reply Last reply Reply Quote 1
                            • S Offline
                              SebTota @Hawking
                              last edited by

                              @Hawking My MagicMirror has been sitting for a long time. When I recently finished the frame to get the computer display and rpi zero out of my closet I booted the rpi zero and on the top of the display it said A New Version of Magic Mirror is available or something along those lines. So I went into the MagicMirror folder and used the command “git pull && npm install” as specified in the README file of MagicMirror.

                              1 Reply Last reply Reply Quote 0
                              • H Offline
                                Hawking
                                last edited by

                                @SebTota said in How I got my Magic Mirror working on a Raspberry Pi 0 (zero):

                                git pull && npm install

                                Have there been errors when you did so?

                                I got

                                npm WARN lifecycle magicmirror@2.1.1~install: cannot run in wd %s %s (wd=%s) magicmirror@2.1.1 cd vendor && npm install /home/me/MagicMirror
                                

                                Thats why I then did

                                cd ~/MagicMirror/vendor && npm install
                                

                                in addition (see my post above). Maybe this also solves your problem.

                                S 1 Reply Last reply Reply Quote 0
                                • S Offline
                                  SebTota @Hawking
                                  last edited by

                                  @Hawking Sorry to keep bothering you but I ended up making it work with the two commands you told me to do. Now my problem is when the Pi Zero W is booting it connects to the WiFi but when magic mirror boots the pi disconnects.

                                  H 1 Reply Last reply Reply Quote 0
                                  • H Offline
                                    Hawking @SebTota
                                    last edited by

                                    @SebTota
                                    Just to make sure that I understand the problem correctly:
                                    You see the MagicMirror on the screen (Clock running etc). but you can no longer connect to the Pi Zero (using eg. ssh)?

                                    Just as a test:
                                    What happens if you disable the MagicMirror from autostart (for example by moving the MagicMirror start script from /etc/init.d/ to your home directory) and start it manually while you are already logged in? I don’t know your exact setup or your Linux knowledge, if you need further help how to do this, just let me know.

                                    S 1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      SebTota @Hawking
                                      last edited by

                                      @Hawking I actually eventually got it working. Thanks so much for all your help!

                                      1 Reply Last reply Reply Quote 0
                                      • H Offline
                                        hoggboss22
                                        last edited by

                                        Hello everyone.

                                        I’ve followed the instructions and did everything in the comments (all 12 pages) to make sure I am doing them right. I was able to see MM2 thru the browser but on my screen, it is showing white screen.

                                        Loading config ...
                                        Loading module helpers ...
                                        No helper found for module: alert.
                                        Initializing new module helper ...
                                        Module helper loaded: updatenotification
                                        No helper found for module: clock.
                                        Initializing new module helper ...
                                        Module helper loaded: calendar
                                        No helper found for module: compliments.
                                        No helper found for module: currentweather.
                                        No helper found for module: weatherforecast.
                                        Initializing new module helper ...
                                        Module helper loaded: newsfeed
                                        All module helpers loaded.
                                        Starting server on port 8080 ... 
                                        Server started ...
                                        Connecting socket for: updatenotification
                                        Connecting socket for: calendar
                                        Starting node helper for: calendar
                                        Connecting socket for: newsfeed
                                        Starting module: newsfeed
                                        Sockets connected & modules started ...
                                        
                                        Ready to go! Please point your browser to: http://localhost:8080
                                        Whoops! There was an uncaught exception...
                                        { [Error: listen EADDRINUSE :::8080]
                                          code: 'EADDRINUSE',
                                          errno: 'EADDRINUSE',
                                          syscall: 'listen',
                                          address: '::',
                                          port: 8080 }
                                        MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
                                        If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
                                        

                                        mind helping me out with this?

                                        ? 1 Reply Last reply Reply Quote 0
                                        • ? Offline
                                          A Former User @hoggboss22
                                          last edited by A Former User

                                          @hoggboss22 your mm seems being excuted multiple. Common pitfal is that more than one browser are opened.(maybe your previous test running?)
                                          Or your machine is already using port 8080.

                                          Kill all browsers(and node or npm) and restart. Or change port in your config like 8088.

                                          1 Reply Last reply Reply Quote 0
                                          • H Offline
                                            hoggboss22
                                            last edited by

                                            I thought the same thing, i changed from 8080 to 9090 and it gave me the same error. I ran the net stat command to find the port being in used and guess what… there was nothing that is using 8080 or 9090

                                            Active Internet connections (only servers)
                                            Proto Recv-Q Send-Q Local Address           Foreign Address         State      
                                            tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN     
                                            tcp6       0      0 [::]:tproxy             [::]:*                  LISTEN     
                                            tcp6       0      0 [::]:ssh                [::]:*                  LISTEN     
                                            udp        0      0 0.0.0.0:mdns            0.0.0.0:*                          
                                            udp        0      0 0.0.0.0:49645           0.0.0.0:*                          
                                            udp        0      0 0.0.0.0:bootpc          0.0.0.0:*                          
                                            udp6       0      0 [::]:mdns               [::]:*                             
                                            udp6       0      0 [::]:44605              [::]:*                             
                                            raw6       0      0 [::]:ipv6-icmp          [::]:*                  7          
                                            Active UNIX domain sockets (only servers)
                                            Proto RefCnt Flags       Type       State         I-Node   Path
                                            unix  2      [ ACC ]     STREAM     LISTENING     7951     /var/run/dbus/system_bus_socket
                                            unix  2      [ ACC ]     STREAM     LISTENING     7954     /var/run/avahi-daemon/socket
                                            unix  2      [ ACC ]     STREAM     LISTENING     7957     /run/thd.socket
                                            unix  2      [ ACC ]     STREAM     LISTENING     10463    @/tmp/.X11-unix/X0
                                            unix  2      [ ACC ]     STREAM     LISTENING     5161     /run/systemd/fsck.progress
                                            unix  2      [ ACC ]     STREAM     LISTENING     10321    /run/user/1000/systemd/private
                                            unix  2      [ ACC ]     STREAM     LISTENING     10326    /run/user/1000/gnupg/S.gpg-agent
                                            unix  2      [ ACC ]     STREAM     LISTENING     10329    /run/user/1000/bus
                                            unix  2      [ ACC ]     STREAM     LISTENING     4967     /run/systemd/private
                                            unix  2      [ ACC ]     STREAM     LISTENING     10331    /run/user/1000/gnupg/S.gpg-agent.browser
                                            unix  2      [ ACC ]     STREAM     LISTENING     10363    /run/user/1000/gnupg/S.gpg-agent.ssh
                                            unix  2      [ ACC ]     STREAM     LISTENING     10365    /run/user/1000/gnupg/S.gpg-agent.extra
                                            unix  2      [ ACC ]     STREAM     LISTENING     8845     /var/run/dhcpcd.sock
                                            unix  2      [ ACC ]     STREAM     LISTENING     5005     /run/systemd/journal/stdout
                                            unix  2      [ ACC ]     STREAM     LISTENING     8847     /var/run/dhcpcd.unpriv.sock
                                            unix  2      [ ACC ]     SEQPACKET  LISTENING     5325     /run/udev/control
                                            unix  2      [ ACC ]     STREAM     LISTENING     10464    /tmp/.X11-unix/X0
                                            
                                            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
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 6 / 11
                                            • 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