Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


How to switch off the Local Display using a linux command
#1
Hello Everyone,
I set up a Moode installation with an USBBridge Sig and a Katana DAC powered with a Shanti PS: the total boot time is around 40-50 seconds before my 5.5" Waveshare AMOLED displays something. So I would like to let my electronic setup always on while I would switch off the display and all other running operations (e.g. the play of a song) with a GPIO Switch  (this way, it will be much quicker to use).

So my question is: is it possible to do that using some batch or python commands (i.e. display switch on/off) ?

Thank you in advance,
Best regards,
Reply
#2
(02-14-2021, 05:20 PM)pkdick Wrote: Hello Everyone,
I set up a Moode installation with an USBBridge Sig and a Katana DAC powered with a Shanti PS: the total boot time is around 40-50 seconds before my 5.5" Waveshare AMOLED displays something. So I would like to let my electronic setup always on while I would switch off the display and all other running operations (e.g. the play of a song) with a GPIO Switch  (this way, it will be much quicker to use).

So my question is: is it possible to do that using some batch or python commands (i.e. display switch on/off) ?

Thank you in advance,
Best regards,
This worked when I used my 7 inch display. I had this in my .lircrc file to turn the display off when not using.

sudo DISPLAY=:0.0 xset dpms force on

sudo DISPLAY=:0.0 xset dpms force off
Reply
#3
(02-18-2021, 03:44 PM)Macdelf Wrote:
(02-14-2021, 05:20 PM)pkdick Wrote: Hello Everyone,
I set up a Moode installation with an USBBridge Sig and a Katana DAC powered with a Shanti PS: the total boot time is around 40-50 seconds before my 5.5" Waveshare AMOLED displays something. So I would like to let my electronic setup always on while I would switch off the display and all other running operations (e.g. the play of a song) with a GPIO Switch  (this way, it will be much quicker to use).

So my question is: is it possible to do that using some batch or python commands (i.e. display switch on/off) ?

Thank you in advance,
Best regards,
This worked when I used my 7 inch display. I had this in my .lircrc file to turn the display off when not using.

sudo DISPLAY=:0.0 xset dpms force on

sudo DISPLAY=:0.0 xset dpms force off
Thank you for this piece of advice ! Do you think that these commands would work in a bash script ? Moreover, would you have the related commands to switch off the touch capability of my display ? By the way I also found that the localui.service created by Tim handles also the display, but I do not know how to stop it using a bash command.

Best regards
Reply
#4
@pkdick

Yes, the two commands @Macdelf showed you can be rolled into a bash script.

Disabling and enabling the touchscreen from the command line is possible too but it requires additional steps.


1. install the xinput utility

Code:
sudo apt install xinput


2. find the input id for the touchscreen, looking for the raspberrypi-ts entry

Code:
DISPLAY=:0.0 xinput --list


3. Now you can disable/enable the touchscreen input with

Code:
sudo DISPLAY=:0.0 xinput disable <id>
sudo DISPLAY=:0.0 xinput enable <id>

---

So, for example, on one of my moOde players with the official 7" LCD touch display (and a USB volume control knob and a FLIRC USB device)

Code:
pi@moodeLD:~ $ DISPLAY=:0.0 xinput --list
⎡ Virtual core pointer                    id=2 [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              id=4 [slave  pointer  (2)]
⎜   ↳ flirc.tv flirc Consumer Control          id=7 [slave  pointer  (2)]
⎜   ↳ Arduino LLC iWit USB Controller Mouse    id=11 [slave  pointer  (2)]
⎜   ↳ Arduino LLC iWit USB Controller Consumer Control id=12 [slave  pointer  (2)]
⎜   ↳ raspberrypi-ts                          id=9 [slave  pointer  (2)]
⎣ Virtual core keyboard                    id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard              id=5 [slave  keyboard (3)]
    ↳ flirc.tv flirc Keyboard                  id=6 [slave  keyboard (3)]
    ↳ flirc.tv flirc System Control            id=8 [slave  keyboard (3)]
    ↳ flirc.tv flirc Consumer Control          id=10 [slave  keyboard (3)]
    ↳ Arduino LLC iWit USB Controller Consumer Control id=13 [slave  keyboard (3)]
    ↳ Arduino LLC iWit USB Controller Keyboard id=14 [slave  keyboard (3)]

I can disable the touchscreen with

Code:
sudo DISPLAY=:0.0 xinput disable 9

and enable it again with

Code:
sudo DISPLAY=:0.0 xinput enable 9

Note that this works independently of the display, e.g., you can turn the touchscreen off and on whether the display is on or off. This can lead to confusion Tongue

Regards,
Kent
Reply
#5
Thank you Kent and Macdelf !

As I said the boot from my Moode setup takes almost one minute. Your solution should help me to leave always on my system and to get access to it very quickly!

Best regards,
Reply


Forum Jump: