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
    29 Posts 3 Posters 1.1k 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.
    • A Offline
      atwist
      last edited by

      I upgraded my MagicMirror and now the logs are showing the below errors:

      ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
      ERROR:ui/ozone/platform/wayland/ozone_playform_wayland.cc:202] Failed to initalize Wayland platform
      ERROR:ui/aura/env.cc:257] the platform failed to initalize. Exiting.

      How do i resolve this?

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

        @atwist how does MM get started?

        using pm2?

        if so, find the startup command

        pm2 status
        pm2 info xxxx
        where xxxx is the name or number on the row of the app you want info about

        you need the value next to
        script path

        then examine that file…

        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

          Yes, pm2.

          Here is that file.

          #!/bin/bash

          This file is still here to keep PM2 working on older installations.

          cd ~/MagicMirror
          DISPLAY=:0 npm start

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

            @atwist yes, that is the file, should have started in default mode

            there is an updated version

            can you replace all the lines of text there with this

            #!/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
               DISPLAY=:0 npm start
            fi 
            

            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

              I updated that file but the error still exists.

              0|MagicMirror | [3709:0102/125357.807528:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
              0|MagicMirror | [3709:0102/125357.807690:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:282] Failed to initialize Wayland platform
              0|MagicMirror | [3709:0102/125357.807720:ERROR:ui/aura/env.cc:257] The platform failed to initialize. Exiting.
              0|MagicMirror | /home/twist/MagicMirror/node_modules/electron/dist/electron exited with signal SIGSEGV

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

                @atwist interesting

                can you do this

                cd ~/MagicMirror
                npm start 
                

                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

                  Yes, that starts everything and gets me running like normal. Thanks!

                  So how do I get it to run on reboot moving forward?

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

                    @atwist weird… all the script does is the same thing…

                    can you show me the part of the output from npm start like from my desktop

                    ####  System Information  ####
                    - SYSTEM:   manufacturer: System manufacturer; model: System Product Name; virtual: false; MM: 2.34.0
                    - OS:       platform: linux; distro: Ubuntu; release: 22.04.5 LTS; arch: x64; kernel: 5.15.0-164-generic
                    - VERSIONS: electron: undefined; used node: 22.21.1; installed node: 22.21.1; npm: 10.9.4; pm2: 6.0.14
                    - ENV:      XDG_SESSION_TYPE: x11; MM_CONFIG_FILE: undefined
                                WAYLAND_DISPLAY:  undefined; DISPLAY: :0.0; ELECTRON_ENABLE_GPU: undefined
                    - RAM:      total: 48077.13 MB; free: 36485.14 MB; used: 11591.98 MB
                    - OTHERS:   uptime: 21764 minutes; timeZone: America/Chicago
                    

                    you may have to npm start >somefile.txt
                    then once up, ctrl-q,
                    and edit the somefile.txt

                    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

                      Here is that information.

                      System Information

                      • SYSTEM: manufacturer: Raspberry Pi Foundation; model: Raspberry Pi 4 Model B Rev 1.5; virtual: false; MM: 2.34.0
                      • OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.12.47+rpt-rpi-v8
                      • VERSIONS: electron: 39.2.7; used node: 22.21.1; installed node: 22.21.1; npm: 10.9.4; pm2: 6.0.14
                      • ENV: XDG_SESSION_TYPE: x11; MM_CONFIG_FILE: undefined
                        WAYLAND_DISPLAY: undefined; DISPLAY: :0; ELECTRON_ENABLE_GPU: undefined
                      • RAM: total: 3796.86 MB; free: 2669.80 MB; used: 1127.06 MB
                      • OTHERS: uptime: 3427 minutes; timeZone: America/Chicago
                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        atwist
                        last edited by

                        Do you happen to have any ideas to fix it moving forward? Thanks!

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

                          @atwist how are you starting MagicMirror?

                          pm2? How did you install MagicMirror

                          If my script, then look at
                          ~/MagicMirror/installers/mm.sh

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          1 Reply Last reply Reply Quote 0
                          • C Offline
                            chrisfr1976 @atwist
                            last edited by

                            @atwist
                            You could try this as start script:

                            
                            #!/bin/bash
                            cd ~/MagicMirror
                            
                            export DISPLAY=:0
                            export ELECTRON_OZONE_PLATFORM_HINT=x11
                            
                            npm start
                            
                            

                            The --ozone-platform-hint=x11 flag overrides the automatic detection and forces Electron into X11 mode. Maybe……

                            Regards, Chris.

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

                              I don’t remember how i installed it but I don’t have MagicMirro.sh so i must not have used your script.

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

                                @chrisfr1976 Thanks for the reply. Sorry but how would i do that?

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

                                  @atwist script name error, I made a shortcut for mm and didn’t catch it expanding there

                                  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 ahh okay. I do have that file. What am I looking for in it though.?

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

                                      @atwist can you run this from the command line , and show the results

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

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

                                        nothing is returned

                                        S 1 Reply Last reply Reply Quote 0
                                        • 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

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