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.

    update magic mirror

    Scheduled Pinned Locked Moved Solved Troubleshooting
    19 Posts 3 Posters 5.6k 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.
    • S Do not disturb
      sdetweil @Raxos
      last edited by sdetweil

      @Raxos that link is not valid. The scripts have been moved to an external site for a few weeks now. (That exact script has a fatal bug)

      See the scripts here
      https://github.com/sdetweil/MagicMirror_scripts

      Also, the Google drive link is not shared.

      Sam

      How to add modules

      learning how to use browser developers window for css changes

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

        okay, so if i understand, i nedd to do bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/upgrade-script.sh)” apply

        the log: https://drive.google.com/file/d/1t1eFgTcRHwEFOalFnfDFjbiW5g80V6VT/view?usp=sharing

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

          @Raxos ok, can you execute these commands and tell me the results

          LC_ALL=C git status
          
          locale
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • M Offline
            mastadook
            last edited by

            Hi,

            after Update I have this Problem: Any Idea?

            0|MagicMirror | > magicmirror@2.10.1 start /home/pi/MagicMirror
            0|MagicMirror | > ./run-start.sh
            0|MagicMirror | ./run-start.sh: Zeile 66: electron: Kommando nicht gefunden.
            0|MagicMirror | npm
            0|MagicMirror | ERR! code ELIFECYCLE
            0|MagicMirror | npm
            0|MagicMirror | ERR! syscall spawn
            0|MagicMirror | npm ERR! file
            0|MagicMirror | sh
            0|MagicMirror | npm ERR! errno ENOENT
            0|MagicMirror | npm
            0|MagicMirror | ERR! magicmirror@2.10.1 start: ./run-start.sh
            0|MagicMirror | npm ERR! spawn ENOENT
            0|MagicMirror | npm ERR!
            0|MagicMirror | npm
            0|MagicMirror | ERR! Failed at the magicmirror@2.10.1 start script.
            0|MagicMirror | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
            0|MagicMirror | npm ERR! A complete log of this run can be found in:
            0|MagicMirror | npm ERR! /home/pi/.npm/_logs/2020-01-31T15_08_06_616Z-debug.log

            What can I do?

            Regards
            Clemens

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

              @mastadook can u tell us more?
              What version did u upgrade from?

              Show output of
              uname
              npm -v
              node -v

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • M Offline
                mastadook
                last edited by

                Hi Sam,

                here are the requested Infos:
                pi@magicmirror:~ $ uname
                Linux
                pi@magicmirror:~ $ npm -v
                6.13.4
                pi@magicmirror:~ $ node -v
                v10.18.1

                Errormessage after npm install
                0|MagicMirror | path: ‘package.json’ }
                0|MagicMirror | [15:31:05.578] [ERROR]
                0|MagicMirror | { Error: ENOENT: no such file or directory, open ‘package.json’
                0|MagicMirror | at Object.openSync (fs.js:443:3)
                0|MagicMirror | at Object.readFileSync (fs.js:343:35)
                0|MagicMirror | at Object. (/home/pi/MagicMirror/js/app.js:21:32)
                0|MagicMirror | at Module._compile (internal/modules/cjs/loader.js:778:30)
                0|MagicMirror | at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
                0|MagicMirror | at Module.load (internal/modules/cjs/loader.js:653:32)
                0|MagicMirror | at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
                0|MagicMirror | at Function.Module._load (internal/modules/cjs/loader.js:585:3)
                0|MagicMirror | at Module.require (internal/modules/cjs/loader.js:692:17)
                0|MagicMirror | at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
                0|MagicMirror | errno: -2,
                0|MagicMirror | syscall: ‘open’,
                0|MagicMirror | code: ‘ENOENT’,

                It works for some hours, after restart the Errormessage comes back.

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

                  @mastadook said in update magic mirror:

                  /usr/lib/node_modules/pm2/node_

                  can u tell me what modules u have installed? (folder names in MagicMirror/modules, excluding default)

                  there is one module I know of that uses pm2 to launch another component under the covers

                  how did u upgrade to 2.10.1?

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    mastadook
                    last edited by mastadook

                    Hi

                    pi@magicmirror:~/MagicMirror/modules $ ls
                    default MMM-DailyBibleVerse MMM-Domoticz

                    MMM-DailyBibleVerse is not used it´s just there

                    MMM-Domoticz is needed

                    I used this here from another Topic:

                    @Snille said in How to update.:

                    @izanbard Hello, added a restart of the mirror (via pm2) if an npm install has been done and also added “–production” to the npm install command. Sometimes the module-developer have lot’s of extra stuff added in the package list just for developing. :)
                    I’m currently now running this script via CRON every night. :)

                    #!/usr/bin/env bash
                    
                    updated=false
                    
                    cd /home/pi/MagicMirror
                    echo "Checking for MagicMirror updates."
                    git fetch
                    if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]
                    then
                        echo "Found, updating..."
                        git pull
                        npm install
                        updated=true
                        echo "Update done."
                    else
                        echo "No update needed."
                    fi
                    echo ""
                    
                    cd modules
                    
                    for directory in *; do
                        if [[ -d ${directory} && ${directory} != "node_modules" && ${directory} != "default" ]]; then
                            echo "Checking for ${directory} updates."
                            cd ${directory}
                            git fetch
                            if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then
                                echo "Found, updating ${directory}..."
                                git pull
                                if [[ -e "package.json" && -f "package.json" ]]; then
                                    echo "package.joson changed for ${directory}, installing..."
                                    npm install --production 
                                    updated=true
                                    echo "Update done."
                                fi
                            else
                                echo "No update needed."
                            fi
                            echo ""
                            cd ..
                        fi
                    done
                    
                    if $updated; then
                        echo "Restart of MM needed, restarting now."
                        pm2 restart mm
                    fi
                    echo "All done. :)"
                    

                    maybe it was a failure …

                    if I try:
                    pi@magicmirror:~/MagicMirror $ ./run-start.sh
                    ./run-start.sh: Zeile 66: electron: Kommando nicht gefunden.
                    maybe this helps?

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

                      @mastadook run-start.sh wasn’t meant to be executed directly… it depended on npm to setup the path
                      but you can fix this,

                      get the latest

                      cd ~/MagicMirror
                      curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/run-start.sh >run-start.sh
                      

                      or
                      u can edit the line in the script that is changed
                      add the path (node_modules/.bin/) to the invocation of electron like below
                      note the dot in front of bin

                        else  
                          # we can use electron directly	
                          node_modules/.bin/electron js/electron.js $1;               
                        fi
                      

                      can u show me the output of pm2 show mm

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        mastadook
                        last edited by

                        Hi,

                        yes, here is the Output you ask me:

                        pi@magicmirror:~ $ pm2 show 0
                         Describing process with id 0 - name MagicMirror 
                        ┌───────────────────┬──────────────────────────────────────────┐
                        │ status            │ online                                   │
                        │ name              │ MagicMirror                              │
                        │ version           │ 2.10.1                                   │
                        │ restarts          │ 10                                       │
                        │ uptime            │ 3s                                       │
                        │ script path       │ /home/pi/MagicMirror                     │
                        │ script args       │ N/A                                      │
                        │ error log path    │ /home/pi/.pm2/logs/MagicMirror-error.log │
                        │ out log path      │ /home/pi/.pm2/logs/MagicMirror-out.log   │
                        │ pid path          │ /home/pi/.pm2/pids/MagicMirror-0.pid     │
                        │ interpreter       │ node                                     │
                        │ interpreter args  │ N/A                                      │
                        │ script id         │ 0                                        │
                        │ exec cwd          │ /home/pi                                 │
                        │ exec mode         │ fork_mode                                │
                        │ node.js version   │ 10.18.1                                  │
                        │ node env          │ N/A                                      │
                        │ watch & reload    │ ✘                                        │
                        │ unstable restarts │ 0                                        │
                        │ created at        │ 2020-02-05T12:09:50.536Z                 │
                        └───────────────────┴──────────────────────────────────────────┘
                         Actions available 
                        ┌────────────────────────┐
                        │ km:heapdump            │
                        │ km:cpu:profiling:start │
                        │ km:cpu:profiling:stop  │
                        │ km:heap:sampling:start │
                        │ km:heap:sampling:stop  │
                        └────────────────────────┘
                         Trigger via: pm2 trigger MagicMirror <action_name>
                        
                         Divergent env variables from local env 
                        
                        
                         Add your own code metrics: http://bit.ly/code-metrics
                         Use `pm2 logs MagicMirror [--lines 1000]` to display logs
                         Use `pm2 env 0` to display environement variables
                         Use `pm2 monit` to monitor CPU and Memory usage MagicMirror
                        

                        after change run-start.sh the error Message disappeared.
                        But start with pm2 is still not possible.

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

                          @mastadook ok, you are starting in the wrong place with the wrong script…

                          in folder  
                               /home/pi  
                          start this
                              /home/pi/MagicMirror    
                          

                          use my pm2 fixup script…

                          do this

                          pm2 delete 0
                          bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)"
                          

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          1 Reply Last reply Reply Quote 1
                          • M Offline
                            mastadook
                            last edited by mastadook

                            @sdetweil said in update magic mirror:

                            bash -c “$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)”

                            Great :)
                            I think you did it.

                            pi@magicmirror:~/MagicMirror $ pm2 show 0
                             Describing process with id 0 - name MagicMirror 
                            ┌───────────────────┬──────────────────────────────────────────┐
                            │ status            │ online                                   │
                            │ name              │ MagicMirror                              │
                            │ version           │ 2.10.1                                   │
                            │ restarts          │ 0                                        │
                            │ uptime            │ 40s                                      │
                            │ script path       │ /home/pi/MagicMirror/installers/mm.sh    │
                            │ script args       │ N/A                                      │
                            │ error log path    │ /home/pi/.pm2/logs/MagicMirror-error.log │
                            │ out log path      │ /home/pi/.pm2/logs/MagicMirror-out.log   │
                            │ pid path          │ /home/pi/.pm2/pids/MagicMirror-0.pid     │
                            │ interpreter       │ bash                                     │
                            │ interpreter args  │ N/A                                      │
                            │ script id         │ 0                                        │
                            │ exec cwd          │ /home/pi/MagicMirror                     │
                            │ exec mode         │ fork_mode                                │
                            │ node.js version   │ N/A                                      │
                            │ node env          │ N/A                                      │
                            │ watch & reload    │ ✔                                        │
                            │ unstable restarts │ 0                                        │
                            │ created at        │ 2020-02-05T15:00:22.116Z                 │
                            └───────────────────┴──────────────────────────────────────────┘
                             Revision control metadata 
                            ┌──────────────────┬────────────────────────────────────────────────────┐
                            │ revision control │ git                                                │
                            │ remote url       │ https://github.com/MichMich/MagicMirror.git        │
                            │ repository root  │ /home/pi/MagicMirror                               │
                            │ last update      │ 2020-02-05T15:00:23.257Z                           │
                            │ revision         │ 5bf90ae31d600e3f595ffd242b99515fa7905b1a           │
                            │ comment          │ Merge pull request #1872 from MichMich/2.10.1-docs │
                            │                  │                                                    │
                            │                  │ 2.10.1 docs                                        │
                            │ branch           │ master                                             │
                            └──────────────────┴────────────────────────────────────────────────────┘
                             Divergent env variables from local env 
                            ┌────────┬──────────────────────┐
                            │ SHLVL  │ 2                    │
                            │ OLDPWD │ /home/pi/MagicMirror │
                            └────────┴──────────────────────┘
                            
                            

                            No restarts. It seems to run fine now.
                            Will it start automatically now?
                            And Update now with git pull && npm install?

                            Thank you for your help!

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

                              @mastadook use my upgrade script… see here

                              https://github.com/sdetweil/MagicMirror_scripts

                              while sometimes its ok to do the git pull/npm install, sometimes its not (as dependencies impact running modules)…

                              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 @mastadook
                                last edited by

                                @mastadook should, reboot…

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  mastadook
                                  last edited by

                                  Thank you, all works fine now
                                  Best Regards

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

                                    @mastadook cool. Glad you got it!

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    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 / 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