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.

    MagicMirror Failing on Raspberry Pi Zero W Rev 1.1

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    43 Posts 3 Posters 10.2k Views 3 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.
    • D Offline
      davidgagne @sdetweil
      last edited by

      @sdetweil npm -v returns 6.14.18 (and it takes a solid 45 seconds to do that, which seems like a very long time for such a simple command, even on a Zero).

      S butchkemperB 2 Replies Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @davidgagne
        last edited by

        @davidgagne do free -m

        pi is small on memory, so running off sd card a lot…

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        D 1 Reply Last reply Reply Quote 0
        • D Offline
          davidgagne @sdetweil
          last edited by

          @sdetweil I was wrong. It’s not working fine.

          It was working fine. Then I rebooted to make sure everything was fine. Comes back up with no problem.

          Then I ssh-ed to it, installed a module, ran npm install inside the new module’s directory, execute pm2 start MagicMirror, and now MM crashes again looking for electron.

          So frustrating.

          S 1 Reply Last reply Reply Quote 0
          • D Offline
            davidgagne @sdetweil
            last edited by

            @sdetweil Can I run sudo npm i -g npm@10 to upgrade to v10?

            Also: Can you help with getting my forum account upgraded so I don’t have all my posts queued for approval?

            S 1 Reply Last reply Reply Quote 0
            • S Do not disturb
              sdetweil @davidgagne
              last edited by

              @davidgagne said in MagicMirror Failing on Raspberry Pi Zero W Rev 1.1:

              pm2 start MagicMirror, and now MM crashes again looking for electron.

              if you do

              cd ~/MagicMirror
              npm start 
              

              what happens?

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              D 1 Reply Last reply Reply Quote 0
              • D Offline
                davidgagne @sdetweil
                last edited by sdetweil

                @sdetweil Here is the output from npm start called from within MM folder:

                > magicmirror@2.28.0 start /home/dvg/MagicMirror
                > ./run-start.sh $1
                
                [2024-08-01 14:22:15.896] [LOG] Starting MagicMirror: v2.28.0
                [2024-08-01 14:22:17.801] [LOG] Loading config ...
                [2024-08-01 14:22:17.876] [LOG] config template file not exists, no envsubst
                [2024-08-01 14:22:37.345] [LOG] Loading module helpers ...
                [2024-08-01 14:22:37.587] [LOG] No helper found for module: alert.
                [2024-08-01 14:22:39.311] [LOG] Initializing new module helper ...
                [2024-08-01 14:22:39.627] [LOG] Module helper loaded: updatenotification
                [2024-08-01 14:22:39.840] [LOG] No helper found for module: clock.
                [2024-08-01 14:22:40.776] [LOG] Initializing new module helper ...
                [2024-08-01 14:22:40.933] [LOG] Module helper loaded: mmm-systemtemperature
                [2024-08-01 14:22:41.119] [LOG] No helper found for module: compliments.
                [2024-08-01 14:22:41.252] [LOG] No helper found for module: weather.
                [2024-08-01 14:22:41.370] [LOG] No helper found for module: weather.
                [2024-08-01 14:22:41.440] [LOG] No helper found for module: weather.
                [2024-08-01 14:22:41.542] [LOG] All module helpers loaded.
                [2024-08-01 14:22:43.350] [LOG] Starting server on port 8080 ...
                [2024-08-01 14:22:44.452] [WARN]  You're using a full whitelist configuration to allow for all IPs 
                [2024-08-01 14:22:46.725] [LOG] Server started ...
                [2024-08-01 14:22:46.942] [LOG] Connecting socket for: updatenotification
                [2024-08-01 14:22:47.186] [LOG] Starting module helper: updatenotification
                [2024-08-01 14:22:47.362] [LOG] Connecting socket for: mmm-systemtemperature
                [2024-08-01 14:22:47.504] [LOG] Starting node helper: mmm-systemtemperature
                [2024-08-01 14:22:47.554] [LOG] Sockets connected & modules started ...
                [2024-08-01 14:22:47.633] [INFO]
                >>> Ready to go! Please point your browser to: http://0.0.0.0:8080 <<<
                Starting chromium browser now, have patience, it takes a minute
                Chromium_browser not installed
                ./run-start.sh: line 79: 11125 Killed                  node serveronly
                
                S 1 Reply Last reply Reply Quote 0
                • S Do not disturb
                  sdetweil @davidgagne
                  last edited by

                  @davidgagne said in MagicMirror Failing on Raspberry Pi Zero W Rev 1.1:

                  Can you help with getting my forum account upgraded so I don’t have all my posts queued for approval?

                  the config I requested for the forum a couple years ago is a reputation of 2, and then posts will not be moderated.
                  https://forum.magicmirror.builders/post/104688

                  this keeps out all the spam, and other nasty stuff…

                  I review every post that goes thru moderation queue. so I am the bottleneck…

                  to improve your rep, takes contributing something that other users like enough to vote up your post…

                  I cannot override that.

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • S Do not disturb
                    sdetweil @davidgagne
                    last edited by

                    @davidgagne said in MagicMirror Failing on Raspberry Pi Zero W Rev 1.1:

                    Starting chromium browser now, have patience, it takes a minute
                    Chromium_browser not installed

                    so you have to install, firefox, midiori, or surf
                    see my scripts doc

                    https://github.com/sdetweil/MagicMirror_scripts?tab=readme-ov-file#switch-to-the-midori-or-firefox-or-surf-browser

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    D 1 Reply Last reply Reply Quote 0
                    • D Offline
                      davidgagne @sdetweil
                      last edited by

                      @sdetweil Right. I did all that – uninstalled chromium, installed Firefox, and edited installers/mm.sh – as part of my installation process. I’m not sure why it’s still looking for chromium; I assume it’s hard coded somewhere in the MM startup script.

                      S 1 Reply Last reply Reply Quote 0
                      • S Do not disturb
                        sdetweil @davidgagne
                        last edited by sdetweil

                        @davidgagne not hard coded…

                            # if not set
                            if [ "$external_browser." == "." ]; then
                                # start chromium
                                echo "Starting chromium browser now, have patience, it takes a minute"
                        

                        it IS case sensitive and ALSO needs the export
                        unlike Windows in linux environment variables are not inherited by default…

                        show me the mm.sh

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        D 1 Reply Last reply Reply Quote 0
                        • D Offline
                          davidgagne @sdetweil
                          last edited by

                          @sdetweil Here’s the entire mm.sh file:

                          #!/bin/bash
                          # This file is still here to keep PM2 working on older installations.
                          cd ~/MagicMirror
                          export external_browser=firefox
                          DISPLAY=:0 npm start
                          
                          S 1 Reply Last reply Reply Quote 0
                          • S Do not disturb
                            sdetweil @davidgagne
                            last edited by

                            @davidgagne hm… no idea really
                            you can test the script with

                            cd ~/MagicMirror
                            installers/mm.sh
                            

                            and

                            cd ~/MagicMirror
                            export external_browser=firefox
                            npm start 
                            

                            never seen it fail tho.

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              davidgagne @sdetweil
                              last edited by

                              @sdetweil If electron hasn’t been required for years, then why does a fresh install of everything generate tens of thousands of “can’t find electron” lines in MagicMirror-error.log?

                              S 1 Reply Last reply Reply Quote 0
                              • S Do not disturb
                                sdetweil @davidgagne
                                last edited by sdetweil

                                @davidgagne the default install is to use electron.

                                We made it optional, so the install would not just fail.
                                and my script makes other browsers available as alternatives.

                                if you do the manual install, there is nothing to fix the package.json still trying to use electron. and it errors out.

                                now you can clear the pm2 logs

                                pm2 flush

                                and then see info from future runs

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                D 1 Reply Last reply Reply Quote 0
                                • D Offline
                                  davidgagne @sdetweil
                                  last edited by

                                  @sdetweil Okay. Next issue is that MagicMirror-out.log is always empty. I recall that I could find lots of information in there the last time I was setting up a MM, but this time it’s always just blank. (The MagicMirror-error.log file is, sadly, useless because it’s just filled with tens of thousands of lines of Error: Cannot find module 'electron'.)

                                  Any idea why MagicMirror-out.log is always empty?

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Do not disturb
                                    sdetweil @davidgagne
                                    last edited by

                                    @davidgagne out is empty cause mm never started

                                    Does
                                    npm run server
                                    Work

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    D 2 Replies Last reply Reply Quote 0
                                    • D Offline
                                      davidgagne @sdetweil
                                      last edited by

                                      @sdetweil I’m sorry, but I don’t understand. What exactly is mm? (MagicMirror is running.)

                                      What does npm run server do? (I can visit the IP address of the Pi on my phone or laptop on my home network.)

                                      S 1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        davidgagne @sdetweil
                                        last edited by

                                        @sdetweil Calling npm run server immediately after connecting via ssh yields:

                                        npm error code ENOENT
                                        npm error syscall open
                                        npm error path /home/dvg/package.json
                                        npm error errno -2
                                        npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/home/dvg/package.json'
                                        npm error enoent This is related to npm not being able to find a file.
                                        npm error enoent
                                        npm error A complete log of this run can be found in: /home/dvg/.npm/_logs/2024-08-05T16_42_00_562Z-debug-0.log
                                        

                                        If I switch to the MagicMirror directory and call it, I get this:

                                        > magicmirror@2.28.0 server
                                        > node ./serveronly
                                        
                                        [2024-08-05 12:43:48.489] [LOG]   Starting MagicMirror: v2.28.0 
                                        [2024-08-05 12:43:48.956] [LOG]   Loading config ... 
                                        [2024-08-05 12:43:49.021] [LOG]   config template file not exists, no envsubst 
                                        [2024-08-05 12:43:56.659] [LOG]   Loading module helpers ... 
                                        [2024-08-05 12:43:56.760] [LOG]   No helper found for module: alert. 
                                        [2024-08-05 12:43:57.912] [LOG]   Initializing new module helper ... 
                                        [2024-08-05 12:43:58.105] [LOG]   Module helper loaded: updatenotification 
                                        [2024-08-05 12:43:58.210] [LOG]   No helper found for module: clock. 
                                        [2024-08-05 12:43:58.475] [LOG]   Initializing new module helper ... 
                                        [2024-08-05 12:43:58.608] [LOG]   Module helper loaded: mmm-systemtemperature 
                                        [2024-08-05 12:43:58.784] [LOG]   No helper found for module: weather. 
                                        [2024-08-05 12:43:58.837] [LOG]   No helper found for module: weather. 
                                        [2024-08-05 12:44:06.841] [LOG]   Initializing new module helper ... 
                                        [2024-08-05 12:44:06.956] [LOG]   Module helper loaded: MMM-ThemeParkWaitTimes 
                                        [2024-08-05 12:44:08.953] [LOG]   Initializing new module helper ... 
                                        [2024-08-05 12:44:09.018] [LOG]   Module helper loaded: MMM-birthdays 
                                        [2024-08-05 12:44:09.067] [LOG]   No helper found for module: MMM-CloneWarsQuotes. 
                                        [2024-08-05 12:44:09.136] [LOG]   Initializing new module helper ... 
                                        [2024-08-05 12:44:09.228] [LOG]   Module helper loaded: MMM-ThemeParkWaitTimes 
                                        [2024-08-05 12:44:09.603] [LOG]   Initializing new module helper ... 
                                        [2024-08-05 12:44:09.673] [LOG]   Module helper loaded: MMM-ImagesPhotos 
                                        [2024-08-05 12:44:09.721] [LOG]   All module helpers loaded. 
                                        [2024-08-05 12:44:11.000] [LOG]   Starting server on port 8080 ...  
                                        [2024-08-05 12:44:11.743] [WARN]  You're using a full whitelist configuration to allow for all IPs 
                                        [2024-08-05 12:44:13.607] [ERROR] Whoops! There was an uncaught exception... 
                                        [2024-08-05 12:44:14.335] [ERROR] Error: listen EADDRINUSE: address already in use 0.0.0.0:8080
                                            at Server.setupListenHandle [as _listen2] (node:net:1872:16)
                                            at listenInCluster (node:net:1920:12)
                                            at doListen (node:net:2069:7)
                                            at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
                                          code: 'EADDRINUSE',
                                          errno: -98,
                                          syscall: 'listen',
                                          address: '0.0.0.0',
                                          port: 8080
                                        } 
                                        [2024-08-05 12:44:14.400] [ERROR] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 
                                        [2024-08-05 12:44:14.422] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues 
                                        [2024-08-05 12:47:35.279] [INFO]  System information:
                                        ### SYSTEM:   manufacturer: Raspberry Pi Foundation; model: Raspberry Pi Zero W Rev 1.1; raspberry: [object Object]; virtual: false
                                        ### OS:       platform: linux; distro: Raspbian GNU/Linux; release: 11; arch: arm; kernel: 6.1.21+
                                        ### VERSIONS: electron: undefined; used node: 20.9.0; installed node: 20.9.0; npm: 10.8.2; pm2: 5.4.2
                                        ### OTHER:    timeZone: America/New_York; ELECTRON_ENABLE_GPU: undefined 
                                        
                                        S 1 Reply Last reply Reply Quote 0
                                        • S Do not disturb
                                          sdetweil @davidgagne
                                          last edited by

                                          @davidgagne mm is my shorthand for MagicMirror

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

                                          1 Reply Last reply Reply Quote 0
                                          • S Do not disturb
                                            sdetweil @davidgagne
                                            last edited by

                                            @davidgagne ok, another instance is already running

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            D 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
                                            • 1 / 3
                                            • 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