Read the statement by Michael Teeuw here.
I cannot disable screen blanking with MagicMirrorOS
-
Hi
I am running MM via MagicMirrorOS on a RPi4B with an RPi monitor in portrait. I use MMM-Universal-Pir to turn the screen on and off during the day (with
wlr-randrcommands) which works great but the screen switches off for good overnight, the PIR cannot wake it up. I have disabled Screen Blanking withraspi-configbut that makes no difference.If I run
wlr-randrin thelabwccontainer (access viadocker exec -it labwc bash) I normally get (some resolutions removed for brevity):HDMI-A-1 "Raspberry PI RPI MON156 81005568472 (HDMI-A-1)" Make: Raspberry PI Model: RPI MON156 Serial: xxxxxxxxxxxx Physical size: 350x190 mm Enabled: yes Modes: 1920x1080 px, 60.000000 Hz (preferred, current) ... 640x480 px, 59.939999 Hz Position: 0,0 Transform: 90 Scale: 1.000000 Adaptive Sync: disabledHowever, once the display has gone to sleep that same
wlr-randrcommand givesfailed to connect to displaythis make me feel it is something in the docker set up but i see nothing in the docker logs
Note that I also have
RANDR_PARAMS="--output HDMI-A-1 --transform 90"in the.envfile to rotate the display at boot.Cheers
Steve -
@smegbadger said in I cannot disable screen blanking with MagicMirrorOS:
@karsten13 thank you for all the effort you are putting into this issue.
Well, it is a pleasure to have such a good tester as you
I agree, let’s go back to the version that will kill and restart the container if the display doesn’t respond to
wlr-randr(and then waits for aMMM-Universal-Pircycle to sleep it again).for now I did exactly this, but this issue is still working in my brain …
So to revert all the changes done before:
cd /opt/mm git switch master git pullChange the images back to latest in
.env:MM_IMAGE="karsten13/magicmirror:latest" LABWC_IMAGE="karsten13/labwc:latest"Get new images and restart:
cd /opt/mm/run docker compose pull docker compose up -dLast point: You should add the
--transform 90to theonCommandof the MMM-Universal-Pir config:{ module: "MMM-Universal-Pir", position: "top_right", config: { deactivateDelay: 30000, onCommand: "wlr-randr --output HDMI-A-1 --transform 90 --on", } } -
@smegbadger have you turned off screen blanking on the docker host? ubuntu or whatever owns the actual display?
-
Hi
I don’t know where that would be. The RPi boots to a login prompt. Then docker takes over and launches MM in electron. There is no GUI for me to fiddle with
Steve
-
@smegbadger @karsten13 will have to advise
-
the setup is “Raspberry Pi OS Lite” with the normal docker setup and an additional labwc container
I have no idea what is happening. Sounds like the monitor totally cuts the connection to the pi after a while.
Maybe this post contains something helpful.
What is your wlr-randr command for waking up?
-
@smegbadger if you stop mmos does the screen still turn off overnight?
-
@sdetweil I stopped docker at 9:30 last night with
docker compose downleaving the screen at the magicmirror login prompt. This morning the screen was still showing the login prompt . MM was reinstated perfectly withdocker compose up -d --force-recreate. @karsten13 I notice there are now four objects that start:[+] Running 4/4 ✔ Network magicmirror_default Created 0.1s ✔ Container mm Started 0.9s ✔ Container init Started 1.0s ✔ Container labwc Started 1.0sSteve
-
the 4 objects are o.k., one network and 3 containers (
initis only for setting correct permissions in the mount folders, it runs for a very short time, you can disable it in the.envfile if wanted).Question: When the
failed to connect to displayoccurs, how do you get the screen back working? Is adocker rm -f labwc && docker compose up -dsufficient or adocker compose up -d --force-recreate? Or do you have do reboot? Or do you switch the monitor off and on?Other idea is to implement a
wlr-randrcall every 30min. in thelabwccontainer. -
@karsten13 i have disabled the
initcontainer as suggested.When the display fails I can get it back with
docker rm -f labwc && docker compose up -d(docker compose up -d --force-recreatealso works butdocker compose up -don it’s own doesn’t). I am running it today with theMMM-Universal-Pirmodule disabled as another test (although when sitting at a login prompt it never went off).Note that the display fails after a few hours of no PIR trigger, it doesn’t have to be overnight.
Steve
-
@smegbadger said in I cannot disable screen blanking with MagicMirrorOS:
I can get it back with docker rm -f labwc && docker compose up -d
so restarting only the labwc container solves the problem …
I will try to build a labwc container which executes wlr-randr e.g. every 30min. so we can see if this helps.
-
@karsten13 said in I cannot disable screen blanking with MagicMirrorOS:
I will try to build a labwc container which executes wlr-randr e.g. every 30min. so we can see if this helps.
you can now test with a new labwc container which does the wlr-randr call every 15min. but I’m not sure this helps …
For testing change this line in the
.envfileLABWC_IMAGE="karsten13/labwc:develop"and then do a
docker compose pull && docker compose up -d -
@karsten13 unfortunately that change did not prevent the display from dropping. There’s no time timestamp in the docker logs for
labwcbut when i looked this morning there were some 40 calls towlr-randrthat had failed. If they are every 15mins that’s about 10:00 it failed. I will make a more accurate observation tonight -
unfortunately that change did not prevent the display from dropping
I expected this already …
can you post the exact error message of wlr-randr when it fails?
Other point: What happens if you disable MMM-Universal-Pir for a test? Are you still getting the errors or does mm runs correctly over night?
-
for testing I added
wlopmto the current mm-develop docker image.So for another test use this lines in the .env file
MM_IMAGE="karsten13/magicmirror:develop" LABWC_IMAGE="karsten13/labwc:develop"Then change the on/off commands in the
config.jsmodule: "MMM-Universal-Pir", position: "top_right", config: { onCommand: "wlopm --on HDMI-A-1", offCommand: "wlopm --off HDMI-A-1", }and then do a
docker compose pull && docker compose up -d -
@karsten13 I left it running overnight with the MMM-Universal-Pir config lines commented out and the monitor physically switched off and this morning MM was still working fine when I switched the monitor back on again. When I looked at
docker logs labwcthewlr-randrcommand was failing (still being triggered every fifteen mins) which suggests the connection between theMMM-Universal-Pirand the display driver is the issue rather than the display actually going off. I will try your new build today although i will have to add--transform 90to theonCommandto get my screen rotation.magicm@magicmirror:/opt/mm/mounts/config $ docker logs labwc HDMI-A-1 "Raspberry PI RPI MON156 81005568472 (HDMI-A-1)" Make: Raspberry PI Model: RPI MON156 Serial: 81005568472 Physical size: 350x190 mm Enabled: yes Modes: 1920x1080 px, 60.000000 Hz (preferred, current) 1920x1080 px, 60.000000 Hz 1920x1080 px, 59.939999 Hz 1920x1080 px, 50.000000 Hz 1920x1080 px, 48.000000 Hz 1920x1080 px, 47.952000 Hz 1280x720 px, 60.000000 Hz 1280x720 px, 60.000000 Hz 1280x720 px, 59.939999 Hz 1280x720 px, 50.000000 Hz 1280x720 px, 48.000000 Hz 1280x720 px, 47.952000 Hz 720x576 px, 50.000000 Hz 720x480 px, 60.000000 Hz 720x480 px, 59.939999 Hz 640x480 px, 60.000000 Hz 640x480 px, 59.939999 Hz 640x480 px, 59.939999 Hz Position: 0,0 Transform: 90 Scale: 1.000000 Adaptive Sync: disabled failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display failed to connect to display magicm@magicmirror:/opt/mm/mounts/config $ docker exec -it labwc bash pi@c7c64f70849e:/$ wlr-randr failed to connect to display pi@c7c64f70849e:/$Steve
-
@karsten13 my apologies, I see the transform is not needed as you have taken the rotation into account
-
@karsten13 the display failed today as before but we have timestamps in the
labwcdocker logsmagicm@magicmirror:~ $ docker logs labwc 00:00:00.000 [INFO] [seatd/seat.c:48] Created VT-bound seat seat0 00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started 00:00:00.052 [INFO] [seatd/server.c:145] New client connected (pid: 17, uid: 1000, gid: 1000) 00:00:00.052 [INFO] [seatd/seat.c:239] Added client 1 to seat0 00:00:00.052 [INFO] [seatd/seat.c:563] Opened client 1 on seat0 00:00:00.120 [ERROR] [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT" 00:00:00.120 [ERROR] [EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT" executing: wlr-randr --output HDMI-A-1 --transform 90 Sat Mar 29 08:14:25 UTC 2025 HDMI-A-1 "Raspberry PI RPI MON156 81005568472 (HDMI-A-1)" Make: Raspberry PI Model: RPI MON156 Serial: 81005568472 Physical size: 350x190 mm Enabled: yes Modes: 1920x1080 px, 60.000000 Hz (preferred, current) 1920x1080 px, 60.000000 Hz 1920x1080 px, 59.939999 Hz 1920x1080 px, 50.000000 Hz 1920x1080 px, 48.000000 Hz 1920x1080 px, 47.952000 Hz 1280x720 px, 60.000000 Hz 1280x720 px, 60.000000 Hz 1280x720 px, 59.939999 Hz 1280x720 px, 50.000000 Hz 1280x720 px, 48.000000 Hz 1280x720 px, 47.952000 Hz 720x576 px, 50.000000 Hz 720x480 px, 60.000000 Hz 720x480 px, 59.939999 Hz 640x480 px, 60.000000 Hz 640x480 px, 59.939999 Hz 640x480 px, 59.939999 Hz Position: 0,0 Transform: 90 Scale: 1.000000 Adaptive Sync: disabled Sat Mar 29 08:29:25 UTC 2025 HDMI-A-1 "Raspberry PI RPI MON156 81005568472 (HDMI-A-1)" Make: Raspberry PI Model: RPI MON156 Serial: 81005568472 Physical size: 350x190 mm Enabled: yes Modes: 1920x1080 px, 60.000000 Hz (preferred, current) 1920x1080 px, 60.000000 Hz 1920x1080 px, 59.939999 Hz 1920x1080 px, 50.000000 Hz 1920x1080 px, 48.000000 Hz 1920x1080 px, 47.952000 Hz 1280x720 px, 60.000000 Hz 1280x720 px, 60.000000 Hz 1280x720 px, 59.939999 Hz 1280x720 px, 50.000000 Hz 1280x720 px, 48.000000 Hz 1280x720 px, 47.952000 Hz 720x576 px, 50.000000 Hz 720x480 px, 60.000000 Hz 720x480 px, 59.939999 Hz 640x480 px, 60.000000 Hz 640x480 px, 59.939999 Hz 640x480 px, 59.939999 Hz Position: 0,0 Transform: 90 Scale: 1.000000 Adaptive Sync: disabled ... Sat Mar 29 13:14:26 UTC 2025 HDMI-A-1 "Raspberry PI RPI MON156 81005568472 (HDMI-A-1)" Make: Raspberry PI Model: RPI MON156 Serial: 81005568472 Physical size: 350x190 mm Enabled: yes Modes: 1920x1080 px, 60.000000 Hz (preferred, current) 1920x1080 px, 60.000000 Hz 1920x1080 px, 59.939999 Hz 1920x1080 px, 50.000000 Hz 1920x1080 px, 48.000000 Hz 1920x1080 px, 47.952000 Hz 1280x720 px, 60.000000 Hz 1280x720 px, 60.000000 Hz 1280x720 px, 59.939999 Hz 1280x720 px, 50.000000 Hz 1280x720 px, 48.000000 Hz 1280x720 px, 47.952000 Hz 720x576 px, 50.000000 Hz 720x480 px, 60.000000 Hz 720x480 px, 59.939999 Hz 640x480 px, 60.000000 Hz 640x480 px, 59.939999 Hz 640x480 px, 59.939999 Hz Position: 0,0 Transform: 90 Scale: 1.000000 Adaptive Sync: disabled Sat Mar 29 13:29:26 UTC 2025 failed to connect to display Sat Mar 29 13:44:26 UTC 2025 failed to connect to display Sat Mar 29 13:59:26 UTC 2025 failed to connect to display Sat Mar 29 14:14:26 UTC 2025 failed to connect to display Sat Mar 29 14:29:26 UTC 2025 failed to connect to display Sat Mar 29 14:44:26 UTC 2025 failed to connect to display Sat Mar 29 14:59:26 UTC 2025 failed to connect to display Sat Mar 29 15:14:26 UTC 2025 failed to connect to display Sat Mar 29 15:29:26 UTC 2025 failed to connect to display Sat Mar 29 15:44:26 UTC 2025 failed to connect to display Sat Mar 29 15:59:26 UTC 2025 failed to connect to display Sat Mar 29 16:14:26 UTC 2025 failed to connect to displayThere's also a new item in the `mm` docker logs when I restarted the docker containers on my return Gdk-Message: 16:25:24.348: Error reading events from display: Broken pipe [entrypoint 16:25:25.533] [INFO] ***WARNING*** could write to /etc/localtime [entrypoint 16:25:25.539] [INFO] copy default modules [entrypoint 16:25:25.603] [INFO] copy css filesSteve
-
I build another new labwc image. You can revert the changes done to
MM_IMAGEand theon-/offCommandin your setup.The new
karsten13/labwc:developnow runslabwcwith pid=1 (I thought that was already the case) and additionally killslabwcif thewlr-randrcommand fails withfailed to connect to display.Now the container will restart if
labwcis terminated inside the container. This does not address the root issue but should be a good workaround (hopefully).So please do again a
docker compose pull && docker compose up -dto get the latest changes … -
@karsten13, thank you for this. It worked well overnight last night. One question: when the
wlr-randrcommand fails, thelabwccontainer is then killed and then automatically restarts - will the screen be turned on then until the next PIR activity and subsequent timeout ofMMM-Universal-Pir?Steve
-
@smegbadger said in I cannot disable screen blanking with MagicMirrorOS:
the labwc container is then killed and then automatically restarts - will the screen be turned on then until the next PIR activity and subsequent timeout of MMM-Universal-Pir?
yes, I tested this by killing and restarting the labwc-container from outside.
Not nice but I have no idea how to solve this.
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