Managing HDMI output from console,

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
MadKernel
Posts: 12
Joined: Mon Nov 16, 2020 11:54 pm

Managing HDMI output from console,

Post by MadKernel »

Hi!

As I keep building mi "poor's man monitoring sbc" I now wish I could turn on and off the display depending on various factors.

As I am targeting a console only model (no X server) what I have researched suggests I would require the "vbetool" or "tvservice" packages, but tit seems they are not available for ARM (I am using an Odroid C2, which has aarch64 AKA ARM64 AKA ARMv8 SoC).

"xset" and "randr" work only with Xserver, and !setterm" doesn' t seem to work when in tmux.

So my question is if either vbetool ortvservice could be added to DietPi, or perhaps there is some hard limitation that makes it impossible.

Thanks in advance.
MK
User avatar
Joulinar
Posts: 3836
Joined: Sat Nov 16, 2019 12:49 am

Re: Managing HDMI output from console,

Post by Joulinar »

Of course thinks could be added but as always, more request than time to implement all things. In general DietPi is developed and maintained by a single person, with the help of the community. You are welcome to support implementing stuff ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
MadKernel
Posts: 12
Joined: Mon Nov 16, 2020 11:54 pm

Re: Managing HDMI output from console,

Post by MadKernel »

Joulinar wrote: Sat Nov 28, 2020 4:37 pm Of course thinks could be added but as always, more request than time to implement all things. In general DietPi is developed and maintained by a single person, with the help of the community. You are welcome to support implementing stuff ;)
Hi,

Yes, I know adding things means more work for the developers, and in fact I am not actually making a request (not yet at least) but simply asking about it.

The fact that "vbetool" seems to be available *only* for x86 and no distro seems to have an ARM port available actually made me wonder if it can be even built for ARM at all.

I am very new to DietPi and some of the things I am trying to put together around it in this project, so I still don't know which are voluntary choices and which are hardware limitations.

About community collaboration, I am not a software developer but I might get involved in other ways...

Regards.
MK
User avatar
Joulinar
Posts: 3836
Joined: Sat Nov 16, 2019 12:49 am

Re: Managing HDMI output from console,

Post by Joulinar »

yes vbetool is not available on ARM board.

Regarding setterm: you could try putting it into a service file. This way it could be executed from CLI
  1. create a script file screen-off.sh

    Code: Select all

    #!/bin/bash
    setterm --blank 1 --powerdown 2
  2. create service file /etc/systemd/system/screen-off.service

    Code: Select all

    [Unit]
    Description=Blank screen after 1 min and turn it off after 2 min. Any keypress will turn it back on.
    After=ssh.service
    
    [Service]
    Type=oneshot
    Environment=TERM=linux
    StandardOutput=tty
    TTYPath=/dev/console
    ExecStart=/path_to_your_script/screen-off.sh
    
    [Install]
    WantedBy=local.target
  3. Make the script executable

    Code: Select all

    chmod +x /path_to_your_script/screen-off.sh
  4. start the service

    Code: Select all

    systemctl start screen-off.service
Your screen should blank in 1 minute
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
MadKernel
Posts: 12
Joined: Mon Nov 16, 2020 11:54 pm

Re: Managing HDMI output from console,

Post by MadKernel »

@Joulinar, thank you for all the time you put up helping users in the forum, it doesn' t go unnoticed!

I will check your suggestions, and setterm is an option I haven' t tested enough yet.

I have made a few first attempts though and so far, when issued within a tmux session, I haven't succeeded. For what I gather setterm works on "real" terminals (ttyNN) and tmux panes are more like software/virtual terminals (tttyS), you might see ti as somewhere between a raw hardware console and an emulated "X" terminal.

But I have only tinkered with tmux for a couple of hours yet, so don' t take my word for it
User avatar
Joulinar
Posts: 3836
Joined: Sat Nov 16, 2019 12:49 am

Re: Managing HDMI output from console,

Post by Joulinar »

on my test, using the service was working quite well. At least I could blank my screen by have it running from a SSH session :) However it was not going into power-safe mode.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply