This tuturial talk about how to setup sleeping function for your raspberry pi 3

Setup Steps(OS: Raspbian)

1.Please get root right,if not, please follow the belew steps:

1).In「LXTerminal」, run the follow command and then set root password(enter your password twice)。

sudo passwd root

2). In「LXTerminal」 run the follow command and then unlock the root right:

sudo passwd --unlock root

3). In「LXTerminal」run the follow command and then enter your password as step 1 to get root right:

su root

The「LXTerminal」will show as following

2. Create and edit the file “Screen.sh”:

1). In「LXTerminal」,enter the follow command to create the file “Screen.sh”

sudo nano /etc/profile.d/Screen.sh

2).Please copy the following text and paste this text in the “Screen.sh” file,press「Ctrl」+「X」and then press「Y」to save the file:

xset dpms 0 0 0

xset s off

3).After saving the file, please press「Enter」to return the Terminal window

3.Reboot raspberry pi and the sleep function will be closed。

You can use the following commands to replace the command 「xset s off」 to change the sleep function:

xset s 3600 3600 #sleep after 1 hours standby

xset -dpms #close DPMS

xset s off -dpms #Disable DPMS and prevent standby

xset dpms force off #force off monitor at once

xset dpms force standby #force to standby

xset dpms force suspend #force to suspend