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 19.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.
    • 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
            • S Offline
              sdetweil @ember1205
              last edited by

              @ember1205 whatever script…

              if you used my setup script it uses the one already in installers

              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

                Ok… Modified the ~/mm.sh script

                pm2 restart mm failed to start Chromium correctly - landed on the Chrome Desktop.
                Purged the config directory and started mm without issue.

                Restarted the mirror and everything came up clean multiple times, but there is clearly still something weird happening with Chromium in that I have to continue wiping the config directory before it will start up correctly.

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

                  @ember1205 the new script wipes the config folder already

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

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

                    @sdetweil

                    Whatever it’s doing, it isn’t doing it correctly. “pm2 restart mm” lands me on the Chrome Desktop every time. I have to wipe the config folder by hand.

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

                      @sdetweil

                      Its trying to wipe a non-existent directory

                      0|mm  | + rm -rf /home/pi/.config/chromium-browser
                      
                      S 2 Replies Last reply Reply Quote 0
                      • S Offline
                        sdetweil @ember1205
                        last edited by

                        @ember1205 ah. I ‘assumed’ folder name matched executable…doah…

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        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:

                          cd ~
                          rm -rf .config/chromium
                          rm -rf .config/electron
                          

                          This was what you had mentioned earlier in the thread and worked, and it’s what I built my config wipe based on.

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

                            @ember1205 do the curl again

                            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

                              Seems to be working reliably. Even why I simply do a “shutdown now” without any of my shutdown process items, it starts up correctly.

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

                                @ember1205 cool… thanks for the feedback…
                                i merged the changes into the master branch for all updates from now 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

                                  Now I have to find something else to break… sigh… :)

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

                                    @ember1205 thanks!.. this exposed another problem , using the script on an ubuntu system it opened the MM page in the running chrome instance and THEN DIDN’T WAIT… so the script ‘failed’ and pm2 restarted it , over and over and over…

                                    So, i just fixed THAT too… (didn’t break the prior! lol)

                                    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

                                      As long as you got it all fixed, then it was a good day!

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