pimoroni / hyperpixel

Setup for the Pimoroni Hyper Pixel 800x480 pixel multi-touch display
https://shop.pimoroni.com/products/hyperpixel
MIT License
96 stars 29 forks source link

Prevent HyperPixel from going to sleep #28

Closed snobu closed 6 years ago

snobu commented 6 years ago

I've tried everything but seems that after 10-15 minutes no matter what i do with xset or what parameters i pass to Xorg, the HyperPixel goes to sleep and only wakes up if i manually call:

xset s activate

What i've tried:

Xorg -dpms -nocursor 2>&1 > /dev/null &
xset s noblank
xset s 0
xset s off
xset -dpms

Is there a flag i can set in config.txt to prevent power saving from happening? Is it expected behavior? I really mean power saving not blanking because the LCD back light goes off as well.

Other than this, the HyperPixel is probably the best thing ever built for the Pi. Period.

snobu commented 6 years ago

To clarify, it goes to sleep only with no keyboard activity not randomly.

Gadgetoid commented 6 years ago

I'm not entirely sure how to accomplish this, there's an alternate solution documented here though:

https://www.raspberrypi.org/forums/viewtopic.php?t=158976

Add:

Section "ServerFlags"
Option "blank time" "0"
Option "standby time" "0"
Option "suspend time" "0"
Option "off time" "0"
EndSection 

Into /etc/X11/xorg.conf

Which might work!

snobu commented 6 years ago

Hmm I naively assumed xset does exactly that but it may not touch the scope of that Xorg that I manually launch. Let me give it a shot. Thanks!

snobu commented 6 years ago

Those ServerFlags seem to have no effect on my Xorg setup (i did check and it was picking up the right configuration file). Could be the right solution but just didn't work for me.

I fixed it by adding this to /etc/rc.local, in addition to the xsets in my original post:

xset dpms force on

TL;DR:

xset dpms force on
xset s noblank
xset s 0
xset s off

From man xset:

The force flags forces the server to immediately switch to the DPMS state specified. The DPMS state can be one of standby, suspend, off, or on.

Now the HyperPixel no longer goes to bed, which was the desired behavior. Will i end up with an overwork lawsuit on my hands from the Back Light Lawyers? We'll see.

@Gadgetoid If you believe this is valuable enough information to add to the HyperPixel README.md i can send a PR.

Gadgetoid commented 6 years ago

@snobu glad you found a solution in the end! I, and I'm sure future users of HyperPixel, would appreciate a PR. Thank you!