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

      @sdetweil

      I just edited the run-start.sh script and inserted a ten second sleep before the pgrep command. It’s a bit “extreme”, but should hopefully demonstrate if that’s the issue.

      WIthout the sleep, not detecting X simply moves on to a different test instead of trying again at least once before moving on.

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

        @ember1205 yes, adding a sleep would ‘fix’ it

        if only we knew how LONG to sleep… working on it…

        if X is not running then we just launch serveronly and don’t look at its output

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          @sdetweil try 1 second… sleep 1

          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

            Sleep 10 allows the browser to correctly launch. I will drop to 1 second and validate that it will work or not (if not, I will tweak and tune).

            Even with the sleep function ensuring that it allows X to finish initializing, chromium does not start correctly unless I wipe the ~/.config/chromium directory when I shut down.

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

              @ember1205 people are constantly fiddling with stuff, you never know what you’re gonna get anymore.

              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

                Would there be more value in coding in a check for to see if it’s Raspbian or possibly even bullseye and adding a two second sleep if there is?

                raspberry_pi=$(grep ID /etc/os-release | cut -f2 -d=)
                if [ "$raspberry_pi." == "raspbian" ] ; then
                   sleep 2
                fi
                xorg=$(pgrep Xorg)
                

                Maybe there’s a better string to search for, but it might be a stop-gap that would help?

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

                  @ember1205 i don’t think thats right… as we could have the same problem on any other system…

                  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

                    Correct syntax would need to be:

                      raspberry_pi=$(grep ^ID= /etc/os-release | cut -f2 -d=)
                      if [ "$raspberry_pi." == "raspbian" ] ; then
                       sleep 2
                      fi
                    
                    

                    The RPi 3B+ is a little slower to initialize on Bullseye versus Buster. Any time a device is running a slightly heavier OS and needs a little more time to finish booting up, I could see this occurring. The question is, do you solve it with a fix that impacts everyone (“sleep 2” or similar), test for particular OS/HW combo’s, or is there another process to look for that would better indicate when the system should be finished initializing?

                    Right now, it looks for X and just “moves on” when it isn’t found and assumes some sort of mistake or something in the config. Great as a fail-safe, but creates a new occasional issue to be dealt with.

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

                      @ember1205 that test is for when MM is running under docker (with no X running) but using the docker host’s xorg for viewing…

                      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

                        The test I’m referring to checks to see if X is running. If not, it moves on to test for Lubuntu. If that also fails, it assumes server only and moves on.

                        I do recall seeing a specific Docker test at the very beginning of the script, but that’s a fair bit earlier than where I’ve added this check (which is right before the “pgrep Xorg” line).

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