Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

xrandr Not Finding HDMI-1 Without Display Being Set #8

@john3300

Description

@john3300

I was just testing your module and was having trouble with thexrandr commands not having any effect. I added some additional logging to the exec() command to capture stderr and found this for both turning the display on and off:

[ERROR] stderr: warning: output HDMI-1 not found; ignoring

After a bit of playing around I was able to get it to work by changing the exec() lines in node_helper.js from:
exec("xrandr --output " ...
to:
exec("DISPLAY=:0 xrandr --output " ...

With this change in place, both on and off are working. I don't know why my system needs that to work, but I thought I would share it with you in case this is something you haven't seen before. Maybe something to add to your implementation? I can submit a PR with the change if you would like.

Here's my system information if you're interested:

pi@magicmirror:~/MagicMirror $ lsb_release -r
Release:	11
pi@magicmirror:~/MagicMirror $ uname -a
Linux magicmirror 6.1.21-v7+ #1642 SMP Mon Apr  3 17:20:52 BST 2023 armv7l GNU/Linux
pi@magicmirror:~/MagicMirror $ cat /proc/cpuinfo | grep Model
Model		: Raspberry Pi 3 Model B Plus Rev 1.3

And here's my config.js entry:

{
    module: "MMM-PIR-Sensor-Lite",
    position: "bottom_left",
    config: {
        sensorPin: 4,
        rotation: "right",
        deactivateDelay: 1 * 60 * 1000,
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions