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.

    Failed to Connect to Wayland Display

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    58 Posts 7 Posters 4.1k Views 6 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 @atwist
      last edited by

      @atwist ok, weird, that is the command set I use on mm.sh to determine if Wayland is running or not

      Does your mm.sh have those commands listed?

      Sam

      How to add modules

      learning how to use browser developers window for css changes

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

        @sdetweil

        Yes it does:

        if [ $(ps -ef | grep -v grep | grep -i -e xway -e labwc | wc 
           # if WAYLAND_DISPLAYis set, use it, else set to -0
           export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:=wayland-0}
           npm run start:wayland
        else
           DISPLAY=:0 npm start
        fi
        
        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @atwist
          last edited by

          @atwist
          So it shouldn’t be trying to start using wayland
          And npm start on 2.34.0 uses x11

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • A Offline
            atwist
            last edited by

            weird. Any suggestionon what to do?

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

              @atwist move the script to another name
              Try this instead

              #!/bin/bash
              npm start
              

              Save that as mm.sh then do

              chmod +x mm.sh

              Then try
              pm2 start MagicMirror

              Sam

              How to add modules

              learning how to use browser developers window for css changes

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

                @sdetweil thanks. It shows that the process started successfully but it doesn’t appear on the screen.

                S 2 Replies Last reply Reply Quote 0
                • S Offline
                  sdetweil @atwist
                  last edited by

                  @atwist you are on the pi directly, right? Not via ssh or vnc

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

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

                    @atwist try adding these two lines in front of the

                    export DISPLAY=:0
                    export ELECTRON_OZONE_PLATFORM_HINT=x11
                    

                    npm start line

                    And try the
                    ./MagicMirror.sh again.

                    May need to reboot before retry

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

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

                      @sdetweil yes directly on it

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

                        @sdetweil the file you are referring to is in the installers folder. Correct?

                        It does start the interface with your suggestions. Is it able to start it in reboot since it no longer does?

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

                          @atwist

                          pm2 status
                          Then
                          pm2 start xxx

                          Where xxx is the name or number of the row in the status output

                          Then pm2 save

                          And the sudo reboot

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

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

                            @sdetweil Unfortunately, it still doesn’t start after reboot. It does continue to work if i start it manually.

                            Log file
                            |MagicMir | [2991:0228/201716.146315:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:282] Failed to initialize Wayland platform
                            0|MagicMir | [2991:0228/201716.146344:ERROR:ui/aura/env.cc:257] The platform failed to initialize. Exiting.
                            0|MagicMir | /home/twist/MagicMirror/node_modules/electron/dist/electron exited with signal SIGSEGV
                            0|MagicMir | [3075:0228/201721.692197:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)

                            S H 2 Replies Last reply Reply Quote 0
                            • S Offline
                              sdetweil @atwist
                              last edited by

                              @atwist do this

                              pm2 status
                              pm2 info xxxx
                              

                              where xxxx is the name/number on the row that contains the MagicMirror app

                              see the line in the output (example from my Mac, )

                               script path       │ /Users/sam/MagicMirror/installers/mm.sh
                              

                              is it pointing to the correct sh file??

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              1 Reply Last reply Reply Quote 0
                              • H Offline
                                hrt13 @atwist
                                last edited by

                                @atwist
                                I know this may be a bit late, I had the same problem on my Raspberry Pi3 after I updated to the latest MM.
                                I spent some time trying to get Wayland running, but wasn’t really successful. Finally, I changed my mm.sh script to:

                                #!/bin/bash
                                cd ~/MagicMirror

                                npm run start:x11

                                And that got it working again using: pm2 start|restart mm

                                S V 2 Replies Last reply Reply Quote 1
                                • S Offline
                                  sdetweil @hrt13
                                  last edited by

                                  @hrt13 yes, the release notes indicate that the npm start defaults to Wayland now…

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  H 1 Reply Last reply Reply Quote 0
                                  • V Offline
                                    VinGroot @hrt13
                                    last edited by

                                    @hrt13

                                    @hrt13 said:

                                    @atwist
                                    I know this may be a bit late, I had the same problem on my Raspberry Pi3 after I updated to the latest MM.
                                    I spent some time trying to get Wayland running, but wasn’t really successful. Finally, I changed my mm.sh script to:

                                    #!/bin/bash
                                    cd ~/MagicMirror

                                    npm run start:x11

                                    And that got it working again using: pm2 start|restart mm

                                    I got something similar, my version of mm.sh:

                                    #!/bin/bash
                                    cd /home/pi/MagicMirror
                                    DISPLAY=:0 node --run start:x11
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • H Offline
                                      hrt13 @sdetweil
                                      last edited by

                                      @sdetweil I modified your script from earlier to:

                                      #!/bin/bash
                                      cd ~/MagicMirror
                                      
                                      if [ $(ps -ef | grep -v grep | grep -i -e xway -e labwc | wc -l) -ne 0 ]; then
                                         # if WAYLAND_DISPLAYis set, use it, else set to -0
                                         export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:=wayland-0}
                                         npm run start:wayland
                                      else
                                         npm run start:x11
                                      fi
                                      
                                      S 1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        sdetweil @hrt13
                                        last edited by sdetweil

                                        @hrt13 yes, I fixed it the same way for new installs

                                        Need some time to fix for existing

                                        I have fixed upgrade to update mm.sh for start:x11 if wayland is not running

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

                                          @sdetweil

                                          I’m having a similar issue and I’ve been following this post but I still can’t resolve the error.

                                          [94483:0406/164800.222694:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
                                          [94483:0406/164800.222815:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:281] Failed to initialize Wayland platform
                                          [94483:0406/164800.222849:ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
                                          /home/ferguson/MagicMirror/node_modules/electron/dist/electron exited with signal SIGSEGV
                                          [94821:0406/164812.960910:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
                                          [94821:0406/164812.962540:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:281] Failed to initialize Wayland platform
                                          [94821:0406/164812.962598:ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
                                          

                                          I’m currently using the following lines in mm.sh

                                          #!/bin/bash
                                          cd ~/MagicMirror
                                          
                                          if [ $(ps -ef | grep -v grep | grep -i -e xway -e labwc | wc -l) -ne 0 ]; then
                                             # if WAYLAND_DISPLAYis set, use it, else set to -0
                                             export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:=wayland-0}
                                             npm run start:wayland
                                          else
                                             npm run start:x11
                                          fi
                                          

                                          Running the PM2 shows the status is online.

                                          Any help would be greatly appreciated.

                                          Cheers!

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

                                            @Scruffy
                                            Can you open a terminal window and run this command string

                                            ps -ef | grep -v grep | grep -i -e xway -e labwc

                                            Then do

                                            pm2 stop all
                                            cd MagicMirror 
                                            npm run start:x11
                                            

                                            Does MagicMirror start now?

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            S 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