Turning off power supply of screen from CLI

Turning off power supply of screen from CLI

Postby mackowiakp » Oct 30th, '15, 07:59

I am using laptop as my home server. So it works only in text mode without graphic interface started. I want to turn off display power supply after several minutes from boot. I previous laptop (old one) it worked for me by using such command from root:

Code: Select all
vbetool dpms off


But now I got an error:

Code: Select all
Failed to initialise LRMI (Linux Real-Mode Interface)


What the problem is and how can I resolve it?
Last edited by mackowiakp on Nov 5th, '15, 08:52, edited 1 time in total.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Turning off power spplu of screen from CLI

Postby doktor5000 » Oct 30th, '15, 13:31

Did you now run it as root or normal user? And please show the output as root of

Code: Select all
mount | grep 'dev '
vbetool vbemode get
journalctl -ab| grep -i vbetool
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18032
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Turning off power spplu of screen from CLI

Postby mackowiakp » Oct 31st, '15, 08:54

Of course I run it as root. Below outputs from suggested commands:

Code: Select all
[root@mackowiak ~]# mount | grep 'dev '
devtmpfs on /dev type devtmpfs (rw,nosuid,size=1534760k,nr_inodes=383690,mode=755)
[root@mackowiak ~]# vbetool vbemode get
Failed to initialise LRMI (Linux Real-Mode Interface).
[root@mackowiak ~]# journalctl -ab| grep -i vbetool
[root@mackowiak ~]#
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Turning off power spplu of screen from CLI

Postby mackowiakp » Nov 4th, '15, 10:41

According to https://bugs.mageia.org/show_bug.cgi?id=3910 bug still remains :-(
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Turning off power spplu of screen from CLI

Postby doktor5000 » Nov 4th, '15, 22:26

Not really. For one, that is about the installer, not an installed system. And secondly, running it as root worked there on installed system, see e.g. https://bugs.mageia.org/show_bug.cgi?id=3910#c20
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18032
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Turning off power supply of screen from CLI

Postby mackowiakp » Nov 5th, '15, 09:15

I run it as root but it does not works for me. The last comment to https://bugs.mageia.org/show_bug.cgi?id=3910#c20 is:

"vbetool/libx86 issue fixed, original bug still remains."

My hardware is HP DV6700 and it is possible to turn off laptop screen from KDE. But my PC works without graphical interface (it acts as a server). So, if turning power supply from KDE it should be possible from CLI. Is any workaround?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Turning off power supply of screen from CLI

Postby doktor5000 » Nov 5th, '15, 19:59

Yes, and the original bug is about vbetool not working during Mageia installation, but it works fine in the installed system.

You could try setterm as an alternative: http://tldp.org/HOWTO/Battery-Powered/methods.html#XF86
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18032
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Turning off power supply of screen from CLI

Postby mackowiakp » Nov 5th, '15, 20:46

I dont understand what You mean saying "vbetool not working during Mageia installation, but it works fine in the installed system". Can You explain more?

The alternative You show me is for system running X environment. I use my laptop as a server without any graphical environment. Just ASCII console instead.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Turning off power supply of screen from CLI

Postby doktor5000 » Nov 6th, '15, 20:27

No I can't explain much more clearly then that. Did you actually read the bug report, it's already explained in comment 0 ...
https://bugs.mageia.org/show_bug.cgi?id=3910#c0 wrote:Note that in the installed system itself, the blanking/unblanking functionality works fine.


And for the second one, seems you didn't read there, too. I mentioned setterm, seems using Ctrl+F to find the relevant line is already asked too much.
Let me quote that for you:
If instead you're using the Linux console (not X-Windows), you'll want to use setterm(1):

bash$ setterm -blank 10 # Blank the screen in 10 minutes
bash$ setterm -powersave on # Put the monitor into VESA power saving mode
bash$ setterm -powerdown 20 # Set the VESA powerdown to 20 minutes
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18032
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Turning off power supply of screen from CLI

Postby mackowiakp » Nov 8th, '15, 10:46

I try setterm too. But it does not work for me too:

Code: Select all
[root@mackowiak ~]#  setterm -powerdown 2
[root@mackowiak ~]#  setterm -blank 1
setterm: terminal xterm nie obsługuje --blank
[root@mackowiak ~]# setterm -powersave on
setterm: nie można włączyć/wyłączyć trybu oszczędzania energii: Niewłaściwy ioctl dla urządzenia

Translation:

[root@mackowiak ~]#  setterm -powerdown 2
[root@mackowiak ~]#  setterm -blank 1
setterm:xterm terminal does not support --blank
[root@mackowiak ~]# setterm -powersave on
setterm:You can not turn on / off power saving mode: Inappropriate ioctl for device


In my previous installation of M5 (upgraded form M4) vbetool worked fine and it was possible to blank screen including turning off back light.
In this new installation I can only dim screen but back light is still turn on. I want to turn it off because it produces a lot of heat.
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Turning off power supply of screen from CLI

Postby mackowiakp » Nov 9th, '15, 12:03

I try to play with files located in /sys/class/backlight/acpi_video0

I use such command:

Code: Select all
[root@mackowiak acpi_video0]# cd /sys/class/backlight/acpi_video0
[root@mackowiak acpi_video0]# cat actual_brightness
9
[root@mackowiak acpi_video0]# echo 0 > brightness       
[root@mackowiak acpi_video0]# cat brightness     
0


And - system crashed (?!). After reboot, backlight is very dim and I check the content of /sys/class/backlight/acpi_video0

Code: Select all
[root@mackowiak ~]# cd /sys/class/backlight/acpi_video0
[root@mackowiak acpi_video0]# cat brightness
1


Any advice haw to play with files in /sys/class/backlight/acpi_video0 ?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Turning off power supply of screen from CLI

Postby doktor5000 » Nov 9th, '15, 21:30

Same way as you did already. But the backlight controls can usually not be used to completely disable the display. And you might need to set a kernel option for proper backlight control,
e.g. acpi_backlight or acpi_osi as shown in https://wiki.mageia.org/en/Mageia_3_Err ... regression

You might want to read some documentaton about that topic:
https://www.kernel.org/doc/Documentatio ... ension.txt
https://wiki.archlinux.org/index.php/Backlight
https://wiki.ubuntu.com/Kernel/Debugging/Backlight
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18032
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Video

Who is online

Users browsing this forum: No registered users and 0 guests