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.

    My MagicMirror screen keeps turning off

    Scheduled Pinned Locked Moved Solved Troubleshooting
    20 Posts 4 Posters 9.1k Views 4 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 Do not disturb
      sdetweil @EhsanMomeni81
      last edited by

      @EhsanMomeni81 does the tv or monitor have a power off function? Sleep maybe?

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      E 1 Reply Last reply Reply Quote 0
      • evroomE Offline
        evroom @EhsanMomeni81
        last edited by

        @EhsanMomeni81

        120 minutes seems a long time for a screensaver or so.
        Normally that would be 5 to 15 minutes.

        Which exact file did you edit?

        There are, for example, multiple autostart files on your system and only one of them will work, depending on your debian version.
        To locate them:

        sudo find / -name autostart -type f
        

        MagicMirror version: 2.33.0
        Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
        Raspbian GNU/Linux 12 (bookworm)

        Test environment:
        MagicMirror version: v2.33.0
        Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
        Raspbian GNU/Linux 12 (bookworm)

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

          @sdetweil It’s the official RPi 7" screen, and what I can see no power off/sleep function

          1 Reply Last reply Reply Quote 0
          • E Offline
            EhsanMomeni81 @evroom
            last edited by

            @evroom
            I edited the autostart which was stated in the MagicMirror guide

            sudo nano /etc/xdg/lxsession/LXDE/autostart
            
            evroomE 1 Reply Last reply Reply Quote 0
            • evroomE Offline
              evroom @EhsanMomeni81
              last edited by evroom

              @EhsanMomeni81
              For Debian buster that seems to be right.
              For Debian stretch it is

              /home/pi/.config/lxsession/LXDE-pi/autostart
              

              On my Debian buster Pi with official RPI 7 inch screen, I have this for screen off after15 minutes.
              So, your xset settings seem right; have them like that on my other MagiMirror install (on Debian stretch) too.

              pi@raspberrypi:~ $ cat /etc/xdg/lxsession/LXDE-pi/autostart
              @lxpanel --profile LXDE-pi
              @pcmanfm --desktop --profile LXDE-pi
              @xscreensaver -no-splash
              point-rpi
              @xset s 900
              @xset s blank
              @xset -dpms
              

              @sdetweil made install scripts, so I guess he knows a bit more.

              MagicMirror version: 2.33.0
              Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
              Raspbian GNU/Linux 12 (bookworm)

              Test environment:
              MagicMirror version: v2.33.0
              Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
              Raspbian GNU/Linux 12 (bookworm)

              S E 2 Replies Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @evroom
                last edited by

                @evroom not for screen stuff yet

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • E Offline
                  EhsanMomeni81 @evroom
                  last edited by

                  @evroom
                  Sorry, but Debian buster and Debian stretch?

                  I have a cronjob to turn off the screen at 11 pm until 6 am, which works, but other than that I want the screen to be on. Is it possible to change 900 to 61 200 (17 h) instead?

                  1 Reply Last reply Reply Quote 0
                  • evroomE Offline
                    evroom
                    last edited by evroom

                    @EhsanMomeni81 said in My MagicMirror screen keeps turning off:

                    Sorry, but Debian buster and Debian stretch?

                    I guess you downloaded and installed an image with Debian, like from
                    https://www.raspberrypi.org/downloads/raspbian/
                    Debian Buster is the latest Debian version.

                    With lsb_release -ayou can find out which version you have.

                    If your cronjob works for turning on / off the screen, then I guess you do not need to use the @xset parameters to turn off the screen.

                    This is what I currently have:

                    For Debain Stretch (screen always on):

                    $ cat /home/pi/.config/lxsession/LXDE-pi/autostart
                    @lxpanel --profile LXDE-pi
                    @pcmanfm --desktop --profile LXDE-pi
                    @xscreensaver -no-splash
                    @point-rpi
                    @unclutter -display :0 -idle 3 -root -noevents
                    @xset s noblank
                    @xset s off
                    @xset -dpms
                    

                    For Debian Buster (screen off after 900 seconds):

                    $ cat /etc/xdg/lxsession/LXDE-pi/autostart
                    @lxpanel --profile LXDE-pi
                    @pcmanfm --desktop --profile LXDE-pi
                    @xscreensaver -no-splash
                    point-rpi
                    @xset s 900
                    @xset s blank
                    @xset -dpms
                    

                    Not sure what the other entries do, I just appended the @xset lines to the existing entries.
                    Will try what happens when I remove them a bit later.

                    MagicMirror version: 2.33.0
                    Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                    Raspbian GNU/Linux 12 (bookworm)

                    Test environment:
                    MagicMirror version: v2.33.0
                    Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                    Raspbian GNU/Linux 12 (bookworm)

                    evroomE 1 Reply Last reply Reply Quote 0
                    • evroomE Offline
                      evroom @evroom
                      last edited by evroom

                      @evroom said in My MagicMirror screen keeps turning off:

                      Not sure what the other entries do

                      To answer myself.

                      lxpanel        0.10.0-2+rpt4 armhf        LXDE panel
                      pcmanfm        1.3.1-1+rpt7 armhf        extremely fast and lightweight file manager
                      point-rpi      0.20160905   armhf        Locate the mouse pointer over the menu button
                      xscreensaver - not installed
                      

                      Using Debian Buster and a RPI 7 inch display, these settings should work for ‘screen always on’:

                      @point-rpi          # locate the mouse pointer over the menu button
                      @xset s off         # don't activate screensaver
                      @xset -dpms         # disable DPMS (Energy Star) features.
                      @xset s noblank     # don't blank the video device
                      

                      I left @point-rpias it sounds useful somehow; for screensaver settings not needed though.
                      Will test it now.

                      MagicMirror version: 2.33.0
                      Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                      Raspbian GNU/Linux 12 (bookworm)

                      Test environment:
                      MagicMirror version: v2.33.0
                      Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                      Raspbian GNU/Linux 12 (bookworm)

                      evroomE 1 Reply Last reply Reply Quote 0
                      • evroomE Offline
                        evroom @evroom
                        last edited by

                        @evroom

                        Talking to myself :-)

                        The settings for Buster are not working.
                        My display goes to sleep after 10 minutes.
                        Perhaps because it isn’t a HDMI connected monitor.

                        I found 2 interesting files though:

                        pi@raspberrypi:~ $ ls -als /home/pi/.xsession-errors
                        4 -rw------- 1 pi pi 2426 Aug  1 12:30 /home/pi/.xsession-errors
                        pi@raspberrypi:~ $ ls -als /home/pi/.cache/lxsession/LXDE-pi/run.log
                        20 -rw------- 1 pi pi 17988 Aug  1 12:30 /home/pi/.cache/lxsession/LXDE-pi/run.log
                        

                        Also see that this file is being used, so that seems right:

                        /etc/xdg/lxsession/LXDE-pi/autostart
                        

                        MagicMirror version: 2.33.0
                        Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                        Raspbian GNU/Linux 12 (bookworm)

                        Test environment:
                        MagicMirror version: v2.33.0
                        Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                        Raspbian GNU/Linux 12 (bookworm)

                        evroomE 1 Reply Last reply Reply Quote 0
                        • evroomE Offline
                          evroom @evroom
                          last edited by

                          @evroom

                          This works (running for 100 minutes at the moment of posting):

                          $ sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
                          @touch /home/pi/.started_etc_xdg_lxsession_LXDE-pi_autostart
                          @point-rpi
                          @xset -dpms
                          @xset s off
                          @xset s noblank
                          

                          Note: the autostart file does not like comments.

                          Reboot:

                          $ sudo reboot
                          

                          After reboot is finished, check:

                          $ ls -als /home/pi/.started_etc_xdg_lxsession_LXDE-pi_autostart
                          

                          That will tell if the autostart file was used (timestamp should match reboot time).
                          Then check for set errors:

                          $ grep xset /home/pi/.cache/lxsession/LXDE-pi/run.log
                          

                          It should say 3 times Launching xset, with 3 times exit 0 (for every set entry in the autostart file).

                          Works for Raspberry Pi 7" Touchscreen Display.

                          $ lsb_release -a
                          No LSB modules are available.
                          Distributor ID:	Raspbian
                          Description:	Raspbian GNU/Linux 10 (buster)
                          Release:	10
                          Codename:	buster
                          

                          MagicMirror version: 2.33.0
                          Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                          Raspbian GNU/Linux 12 (bookworm)

                          Test environment:
                          MagicMirror version: v2.33.0
                          Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                          Raspbian GNU/Linux 12 (bookworm)

                          E 1 Reply Last reply Reply Quote 0
                          • E Offline
                            EhsanMomeni81
                            last edited by

                            @evroom said in My MagicMirror screen keeps turning off:

                            sleep after 10 minutes.
                            Perhaps because it isn’t a HDMI connected monitor.
                            I found 2 interesting files though:

                            Wow, that’s a lot to take in. Thank you so much for your help, I’m going to try this during the week.

                            1 Reply Last reply Reply Quote 0
                            • E Offline
                              EhsanMomeni81 @evroom
                              last edited by

                              @evroom said in My MagicMirror screen keeps turning off:

                              @evroom

                              This works (running for 100 minutes at the moment of posting):

                              $ sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
                              @touch /home/pi/.started_etc_xdg_lxsession_LXDE-pi_autostart
                              @point-rpi
                              @xset -dpms
                              @xset s off
                              @xset s noblank
                              

                              I tried the code above, and it works on stretch, I screen doesn’t turn off. But my cronjob acts funny. Last night when I look at it after it was supposed to be turned off, the backlight was on but everything else was dark. Don’t really know whats going on, but I’ll take a new look tonight.

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

                                @evroom I’m stuck :(
                                I tried the code above, and it works, the screen doesn’t turn off, but now I can’t see the desktop, it’s black when I minimize the MM-window, and I can’t connect to my MM via VNC which I could before and that’s how I changed in the first place.

                                evroomE 1 Reply Last reply Reply Quote 0
                                • evroomE Offline
                                  evroom @EhsanMomeni81
                                  last edited by evroom

                                  @EhsanMomeni81

                                  Is here something useful ?
                                  https://forum.magicmirror.builders/topic/1801/get-back-to-desktop
                                  https://forum.magicmirror.builders/topic/5619/how-to-find-and-use-key-commands-in-mm-for-absolute-beginners

                                  I personally only use VNC to “look” at the screen remotely and never use the Pi for anything else then displaying MM.
                                  Not interested in the desktop.
                                  I always login to the Pi using a ssh client, like for example PuTTY, or on my Mac the iTerm2.

                                  If you use Windows, then I would recommend PuTTY.
                                  It is small and simple.

                                  MagicMirror version: 2.33.0
                                  Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                                  Raspbian GNU/Linux 12 (bookworm)

                                  Test environment:
                                  MagicMirror version: v2.33.0
                                  Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                                  Raspbian GNU/Linux 12 (bookworm)

                                  E 1 Reply Last reply Reply Quote 0
                                  • E Offline
                                    EhsanMomeni81 @evroom
                                    last edited by

                                    @evroom
                                    Thanks ever so much. I googled and found something that worked. Now everything is running as it should. Still have problems with VNC, but I installed TeamViewer, but I’m going to give ssh a shot soon. Thank you again

                                    1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      TvE
                                      last edited by

                                      So I have also been searching a lot for an answer to this question and been wondering why it have been so difficult to find a CLI based solution to this task.

                                      I am using the “Raspberry Pi Imager” tool (on Window$) to prepare a USB stick (or SD card) and hereafter configure everything via SSH.

                                      I know I could just use RDP or VNC to access and thus make this change via a GUI. But that’s to annoying, hence my need for a CLI based solution

                                      Finally I found it in this thread (thank you @evroom !)

                                      So this is just to help others with the same search that this [1] still works on the current latest RPI OS bullseye:

                                      pi@magicmirror:~ $ lsb_release -a
                                      No LSB modules are available.
                                      Distributor ID: Raspbian
                                      Description:    Raspbian GNU/Linux 11 (bullseye)
                                      Release:        11
                                      Codename:       bullseye
                                      

                                      Without this [1] change the screen goes black after 600s (10m)
                                      Which can also be identified by the “timeout value” returned by this command.

                                      pi@magicmirror:~ $ DISPLAY=:0 xset q
                                      ...
                                      Screen Saver:
                                        prefer blanking:  yes    allow exposures:  yes
                                        timeout:  600    cycle:  600
                                      ...
                                      

                                      After fixing it the value gets set to ‘0’
                                      Right now I still see the screen after 16m (and counting…)

                                      How to
                                      The config change can be applied in many ways (vi, nano etc) but I prefer this method (as it can be copy-pasted or be made part of a config-script).

                                      [1] I “just” add the three required lines to the config file:

                                      printf "@xset -dpms\n@xset s off\n@xset s noblank" | sudo tee -a /etc/xdg/lxsession/LXDE-pi/autostart
                                      

                                      PS.: Before I found this I also tried these solutions (which all failed to solve the problem

                                      A. in /etc/lightdm/lightdm.conf:
                                      xserver-command=X -s 0 dpms
                                      
                                      B. Enable VNC as a workaround for mutter
                                      

                                      I found (but did not try)

                                      C. install xscreensaver and configure it to not kick in
                                      

                                      HTH (my first post here :-)

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Do not disturb
                                        sdetweil @TvE
                                        last edited by

                                        @tve I wonder if my screensaver-off script would have done it.

                                        see
                                        https://github.com/sdetweil/MagicMirror_scripts

                                        down at the bottom of the page

                                        this is part of the install too, but the script is added in case u change your mind or need help. it checks 4 or 5 ways screensaver is done

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

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

                                          @sdetweil It most likely would!

                                          My one -file-only-edit solution have the added bonus that I know exactly what needed to be changed thus not relying on a 100+ line script.

                                          I see that you are so kind to log what the script is doing, so you don’t leave the user in the dark (pun intended :-) ) I like that design!

                                          I should have read your script earlier though (I read through the looong ticket regarding making the installer scripts external to MM2 and remember many of your posts!)

                                          Actually, while browsing the MM repo I also stumbled across the exact same solution
                                          https://github.com/MichMich/MagicMirror/wiki/Configuring-the-Raspberry-Pi#disabling-the-screensaver

                                          Why either of those were never returned to my by google-foo I can only wonder about

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