Sleep mode on device android

How I can set sleep mode and power on again on android device by CMS. Example I have schedule layout play 05.00 to 22.00 then mean I want device go to sleep mode when this device don’t have schedule layout to play in 22.01-04.59 and Device power on when 05.00 - 22.00 to play schedule layout normally. How to config it.

Best regards

Quick search of the community shows several threads about this.

Try this one:

Thank you cslaughter. I try to use rtcwake -s 20 but error like this rtcwake: /dev/rtc0 not enabled for wakeup events Can you suggest me what I wrong.
Best regard.

Sorry to say I am no expert on this. I have looked into in powering the units on and off in regards to the units we use, but have not actually done it yet.

As far as I can tell, IF your hardware AND your Android kernel support the power management control then you should be able to get this working. I think you need to add the type of shutdown/standby.

rtcwake -m Standby -s 20 or rtcwake -m mem -s 20 might do the trick.

Please let me know if you do in fact get it working.

Well… thinking about this. I don’t think the rtcwake command is going to work based on the error. I think you need to look at using /dev/alarm, but even then that might not work.

Thank a lot cslaughter. I try your suggestion already (rtcwake -m Standby -s 20 or rtcwake -m mem -s 20) but It’s not work I think android can’t use rtcwake even I download app busybox to add rtcwake command in android and I don’t know how to use command from /dev/alarm. Now I use keyevent instead. Thank you again cslaughter. :grin:

Interesting. You have that working?

It’s working. Keyevent 26 it’s adb shell command send KEYCODE_POWER to android device for switch state wake up and sleep. Actually I don’t know it switch state wake up and sleep or not but device will swtich between screen_off and screen_on.It’s working similar sleep state of window.

1 Like


Thank you for sharing.

You can make it go to sleep mode by some methods above but you can not wake it up via command line because it has already been being sleep.
I have to use an application to schedule time to wake it up instead

Please what application have you used to wake it up? thanx.
I have android os7.1