• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

(electron:2910): Gtk-WARNING **: 14:16:40.324: cannot open display: :0

Scheduled Pinned Locked Moved Unsolved Troubleshooting
23 Posts 2 Posters 6.7k Views 2 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.
  • B Offline
    bachoo786
    last edited by Dec 19, 2019, 2:28 PM

    Hi People

    I have just installed magic mirror using the script provided on the github on my new Raspberry Pi 4b+.

    I followed the pm2 and autostart method. However magicmirror keeps on restarting itself every 2-3 seconds.

    I stopped it using pm2 stop Magicmirror and went onto the MagicMirror directory and manually tried to start it by this command “npm start dev”. I get the same errors as before when I check my pm2 logs MagicMirror. These are:

    pi@raspberrypi:~/MagicMirror $ npm start dev
    
    > magicmirror@2.9.0 start /home/pi/MagicMirror
    > sh run-start.sh "dev"
    
    
    (electron:2910): Gtk-WARNING **: 14:16:40.324: cannot open display: :0
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! magicmirror@2.9.0 start: `sh run-start.sh "dev"`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the magicmirror@2.9.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/pi/.npm/_logs/2019-12-19T14_16_40_381Z-debug.log
    

    The xxxxx-debug.log file contains the following:

    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start', 'dev' ]
    2 info using npm@6.13.4
    3 info using node@v10.18.0
    4 verbose run-script [ 'prestart', 'start', 'poststart' ]
    5 info lifecycle magicmirror@2.9.0~prestart: magicmirror@2.9.0
    6 info lifecycle magicmirror@2.9.0~start: magicmirror@2.9.0
    7 verbose lifecycle magicmirror@2.9.0~start: unsafe-perm in lifecycle true
    8 verbose lifecycle magicmirror@2.9.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/MagicMirror/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
    9 verbose lifecycle magicmirror@2.9.0~start: CWD: /home/pi/MagicMirror
    10 silly lifecycle magicmirror@2.9.0~start: Args: [ '-c', 'sh run-start.sh "dev"' ]
    11 silly lifecycle magicmirror@2.9.0~start: Returned: code: 1  signal: null
    12 info lifecycle magicmirror@2.9.0~start: Failed to exec start script
    13 verbose stack Error: magicmirror@2.9.0 start: `sh run-start.sh "dev"`
    13 verbose stack Exit status 1
    13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
    13 verbose stack     at EventEmitter.emit (events.js:198:13)
    13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    13 verbose stack     at ChildProcess.emit (events.js:198:13)
    13 verbose stack     at maybeClose (internal/child_process.js:982:16)
    13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
    14 verbose pkgid magicmirror@2.9.0
    15 verbose cwd /home/pi/MagicMirror
    16 verbose Linux 4.19.75-v7l+
    17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" "dev"
    18 verbose node v10.18.0
    19 verbose npm  v6.13.4
    20 error code ELIFECYCLE
    21 error errno 1
    22 error magicmirror@2.9.0 start: `sh run-start.sh "dev"`
    22 error Exit status 1
    23 error Failed at the magicmirror@2.9.0 start script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 1, true ]
    

    Can someone please help me?

    Thanks.

    S 1 Reply Last reply Dec 19, 2019, 2:32 PM Reply Quote 0
    • S Away
      sdetweil @bachoo786
      last edited by Dec 19, 2019, 2:32 PM

      @bachoo786 you cannot run this over ssh, display 0 is the actual display screen connected to the pi hdmi port

      if u are running in console (text) mode, then you must run in serveronly, and use a browser from some other system …

      I have my 4b running MM without problem, altho I used the updated install script (to be the official version on next release)
      see here https://forum.magicmirror.builders/topic/10171/anyone-want-to-try-updated-installer

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      B 1 Reply Last reply Dec 19, 2019, 2:38 PM Reply Quote 0
      • B Offline
        bachoo786 @sdetweil
        last edited by Dec 19, 2019, 2:38 PM

        @sdetweil I suppose I would look stupid to tell you that at the moment I have not connected my rpi 4b to any display. Could that be answer?

        S 1 Reply Last reply Dec 19, 2019, 2:40 PM Reply Quote 0
        • S Away
          sdetweil @bachoo786
          last edited by Dec 19, 2019, 2:40 PM

          @bachoo786 Hm… could be,that would be no display 0 (i hate it when the computers get it right!)

          if u want to see it from some other system, then do

          cd ~/MagicMirror
          node serveronly
          

          it will tell you what IP address to put into the browser on your other system

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          B 1 Reply Last reply Dec 19, 2019, 2:50 PM Reply Quote 0
          • B Offline
            bachoo786 @sdetweil
            last edited by Dec 19, 2019, 2:50 PM

            @sdetweil right ok make sense.

            to be fair the instrcutions on github on installing MagicMirror are little confusing as the installation script asks you if you want to use pm2 and when you say yes it should automatically run magicmirror via pm2.

            however there is this link (https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror) on the github explaining how to auto starting the magic mirror. And when you follow this link you end up having two instances of magic mirror on pm2 i.e. MagicMirror and mm. Thats confusing!

            Do I still have to follow the autostarting magicmirror link? or is the install script sufficient?

            S 2 Replies Last reply Dec 19, 2019, 2:52 PM Reply Quote 0
            • S Away
              sdetweil @bachoo786
              last edited by Dec 19, 2019, 2:52 PM

              @bachoo786 install script does it for you…

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • S Away
                sdetweil @bachoo786
                last edited by Dec 19, 2019, 2:54 PM

                @bachoo786 could you do me a favor before u plug in a monitor,

                can you do

                pgrep Xorg 
                

                from the ssh terminal…

                I’m guessing it should return nothing…

                my new run-start.sh script in next release, will detect text mode and start your installation in serveronly automagically.,! (pm2 just starts the script)

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                B 1 Reply Last reply Dec 19, 2019, 2:59 PM Reply Quote 0
                • B Offline
                  bachoo786 @sdetweil
                  last edited by bachoo786 Dec 19, 2019, 3:00 PM Dec 19, 2019, 2:59 PM

                  @sdetweil yeah it returned nothing.

                  so shall I follow your script i.e. https://forum.magicmirror.builders/topic/10171/anyone-want-to-try-updated-installer
                  and reinstall MagicMirror?

                  Do I have to worry about installing pm2? will Magic Mirror run automatically if I was to reboot my raspberry? etc?

                  to be fair I want to install and run Magic Mirror on my raspberry. I suppose that is server mode? and not client mode? whats the difference sorry ?

                  S 3 Replies Last reply Dec 19, 2019, 3:01 PM Reply Quote 0
                  • S Away
                    sdetweil @bachoo786
                    last edited by Dec 19, 2019, 3:01 PM

                    @bachoo786 you don’t need to reinstall… you are ok… just need a display on the 4 or run server only…

                    the new code isn’t used on my install except for pi0, which won’t work anymore without some changes

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    B 1 Reply Last reply Dec 19, 2019, 3:02 PM Reply Quote 0
                    • S Away
                      sdetweil @bachoo786
                      last edited by Dec 19, 2019, 3:02 PM

                      @bachoo786 said in (electron:2910): Gtk-WARNING **: 14:16:40.324: cannot open display: :0:

                      yeah it returned nothing.

                      awesome! thanks

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 1 / 3
                      1 / 3
                      • First post
                        1/23
                        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