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.

    Autostarts but doesn't run, will run on restart

    Scheduled Pinned Locked Moved Solved Troubleshooting
    47 Posts 3 Posters 15.0k 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 Offline
      sdetweil @ember1205
      last edited by sdetweil

      @ember1205 yes… i am looking for a test that works if the system is slow…

      i added the rm of ./config folder and my pi 0 now comes up instead of the chrome desktop
      which was random before…

              if [ $(which $b). != '.' ]; then
                   rm -rf ~/.config/$b 2>/dev/null   # add this line
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      E 1 Reply Last reply Reply Quote 0
      • E Offline
        ember1205 @sdetweil
        last edited by

        @sdetweil said in Autostarts but doesn't run, will run on restart:

        … my pi 0 now comes up instead of the chrome desktop
        which was random before…

        Not sure I’m following what this should mean?

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

          @ember1205 you had another problem where chrome comes up to the white screen w the icons. that is the chrome desktop.

          i added the delete of the config folder to the run start script to get it back to just MagicMirror

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          E 1 Reply Last reply Reply Quote 0
          • E Offline
            ember1205 @sdetweil
            last edited by

            @sdetweil

            Oh… now I follow.

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

              @ember1205 can u try this on the reboot problem

              add this

              xprop -root      # add this line
              xorg=$(pgrep Xorg)
              

              then do the reboot test with the debugging still turned on

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              E 1 Reply Last reply Reply Quote 0
              • E Offline
                ember1205 @sdetweil
                last edited by

                @sdetweil

                I removed the check I was running that was ensuring it would start correctly and put in the line you asked. I believe the log info you want is this:

                0|mm       | + '[' -f ./untrack-css.sh ']'
                0|mm       | + grep docker /proc/1/cgroup -qa
                0|mm       | + '[' -z :0 ']'
                0|mm       | ++ uname -m
                0|mm       | + arch=armv7l
                0|mm       | + false=false
                0|mm       | ++ grep -i serveronly:
                0|mm       | ++ awk -F: '{print tolower($2)}'
                0|mm       | ++ tr -d ',"'\''\r'
                0|mm       | ++ grep -v '^[[:blank:]]*//' config/config.js
                0|mm       | ++ sed -e 's/^[[:space:]]*//'
                0|mm       | + serveronly=local
                0|mm       | + serveronly=local
                0|mm       | + xprop -root
                0|mm       | xprop:  unable to open display ':0'
                0|mm       | ++ pgrep Xorg
                0|mm       | + xorg=
                0|mm       | + '[' . == . ']'
                0|mm       | ++ pgrep X
                0|mm       | + xorg=
                0|mm       | ++ uname
                0|mm       | + mac=Linux
                0|mm       | + '[' local. '!=' false. -o armv7l == armv6l ']'
                0|mm       | + '[' local. == true. ']'
                0|mm       | + '[' . == . -a Linux '!=' Darwin ']'
                0|mm       | + node serveronly
                
                

                Here’s the rest that goes with it “just in case”:

                /home/pi/.pm2/pm2.log last 100 lines:
                PM2        | 2022-05-11T08:48:46: PM2 log: PM2 successfully stopped
                PM2        | 2022-05-11T08:49:03: PM2 log: ===============================================================================
                PM2        | 2022-05-11T08:49:03: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
                PM2        | 2022-05-11T08:49:03: PM2 log: Time                 : Wed May 11 2022 08:49:03 GMT-0400 (Eastern Daylight Time)
                PM2        | 2022-05-11T08:49:03: PM2 log: PM2 version          : 4.4.1
                PM2        | 2022-05-11T08:49:03: PM2 log: Node.js version      : 16.15.0
                PM2        | 2022-05-11T08:49:03: PM2 log: Current arch         : arm
                PM2        | 2022-05-11T08:49:03: PM2 log: PM2 home             : /home/pi/.pm2
                PM2        | 2022-05-11T08:49:03: PM2 log: PM2 PID file         : /home/pi/.pm2/pm2.pid
                PM2        | 2022-05-11T08:49:03: PM2 log: RPC socket file      : /home/pi/.pm2/rpc.sock
                PM2        | 2022-05-11T08:49:03: PM2 log: BUS socket file      : /home/pi/.pm2/pub.sock
                PM2        | 2022-05-11T08:49:03: PM2 log: Application log path : /home/pi/.pm2/logs
                PM2        | 2022-05-11T08:49:03: PM2 log: Worker Interval      : 30000
                PM2        | 2022-05-11T08:49:03: PM2 log: Process dump file    : /home/pi/.pm2/dump.pm2
                PM2        | 2022-05-11T08:49:03: PM2 log: Concurrent actions   : 2
                PM2        | 2022-05-11T08:49:03: PM2 log: SIGTERM timeout      : 1600
                PM2        | 2022-05-11T08:49:03: PM2 log: ===============================================================================
                PM2        | 2022-05-11T08:49:04: PM2 log: App [mm:0] starting in -fork mode-
                PM2        | 2022-05-11T08:49:04: PM2 log: App [mm:0] online
                
                
                /home/pi/.pm2/logs/mm-out.log last 100 lines:
                0|mm       |
                0|mm       | > magicmirror@2.13.0 start
                0|mm       | > ./run-start.sh
                0|mm       |
                0|mm       | [2022-05-11 08:49:14.433] [LOG]    Starting MagicMirror: v2.13.0
                0|mm       | [2022-05-11 08:49:14.450] [LOG]    Loading config ...
                0|mm       | [2022-05-11 08:49:14.465] [LOG]    Loading module helpers ...
                0|mm       | [2022-05-11 08:49:15.909] [LOG]    Initializing new module helper ...
                0|mm       | [2022-05-11 08:49:15.914] [LOG]    Module helper loaded: MMM-ImagesPhotos
                0|mm       | [2022-05-11 08:49:15.923] [LOG]    No helper found for module: alert.
                0|mm       | [2022-05-11 08:49:16.037] [LOG]    Initializing new module helper ...
                0|mm       | [2022-05-11 08:49:16.040] [LOG]    Module helper loaded: updatenotification
                0|mm       | [2022-05-11 08:49:16.044] [LOG]    No helper found for module: clock.
                0|mm       | [2022-05-11 08:49:16.351] [LOG]    Initializing new module helper ...
                0|mm       | [2022-05-11 08:49:16.353] [LOG]    Module helper loaded: calendar
                0|mm       | [2022-05-11 08:49:16.401] [LOG]    No helper found for module: currentweather.
                0|mm       | [2022-05-11 08:49:16.576] [LOG]    No helper found for module: weatherforecast.
                0|mm       | [2022-05-11 08:49:16.578] [LOG]    All module helpers loaded.
                0|mm       | [2022-05-11 08:49:18.093] [LOG]    Starting server on port 8080 ...
                0|mm       | [2022-05-11 08:49:18.123] [LOG]    Server started ...
                0|mm       | [2022-05-11 08:49:18.126] [LOG]    Connecting socket for: MMM-ImagesPhotos
                0|mm       | [2022-05-11 08:49:18.127] [LOG]    Starting node helper for: MMM-ImagesPhotos
                0|mm       | [2022-05-11 08:49:18.130] [LOG]    Connecting socket for: updatenotification
                0|mm       | [2022-05-11 08:49:18.132] [LOG]    Connecting socket for: calendar
                0|mm       | [2022-05-11 08:49:18.134] [LOG]    Starting node helper for: calendar
                0|mm       | [2022-05-11 08:49:18.135] [LOG]    Sockets connected & modules started ...
                0|mm       | [2022-05-11 08:49:18.137] [LOG]
                0|mm       | Ready to go! Please point your browser to: http://0.0.0.0:8080
                
                
                
                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @ember1205
                  last edited by

                  @ember1205 said in Autostarts but doesn't run, will run on restart:

                  0|mm | + xprop -root
                  0|mm | xprop: unable to open display ‘:0’

                  thanks… x not up yet…

                  weird, never seen this on any other system pi otherwise…
                  I have 3 pi3, 2 pi4, pi 0w and pi02w and jetson nano, odroid, chromebox, plus desktops…

                  i’ll add another environment variable check
                  u add it to the mm.sh used to launch…

                  let me test it…

                  thanks for your help

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  E 1 Reply Last reply Reply Quote 0
                  • E Offline
                    ember1205 @sdetweil
                    last edited by

                    @sdetweil

                    Happy to have broken it. Again. lol

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

                      @ember1205 ok, do this

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

                      edit the MagicMirror/installers/mm.sh

                      add a line before the npm start

                      export wait_for_x=1 
                      

                      (or true, or ANYTHING)
                      the value can be anything

                      edit the run-start.sh and add the -x on the 1st line again

                      do the pm2 flush
                      pm2 restart

                      just to test
                      then do the reboot test

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      E 1 Reply Last reply Reply Quote 0
                      • E Offline
                        ember1205 @sdetweil
                        last edited by

                        @sdetweil said in Autostarts but doesn't run, will run on restart:

                        export wait_for_x=1

                        That isn’t the mm.sh that my system launches from, though… Mine is ~/mm.sh

                        Does the one you’re referencing get called from one of the other scripts?

                        S 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 3 / 5
                        • 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