milan-fabian / slideshow-support

Support and issue tracking for Slideshow software
https://slideshow.digital/
15 stars 1 forks source link

Get device sleep/wakeup state #59

Closed kamiKAC closed 1 month ago

kamiKAC commented 1 month ago

Hi

I'm working on digital signage "controller". I'd like to support sleep/wake-up functionality. At the moment I use following shell comands on Denver photo frames:

Unfortunately dumpsys does not work on tablet I use for testing - I got this error message after curl -X POST "http://tablet:8080/ajax/shell?command=dumpsys%20power" -H "accept: */*" -H "Authorization: Basic ***" request: {"success":true,"result":{"result":0,"stdout":"Permission Denial: can't dump PowerManagerService from from pid=28145, uid=10149 due to missing android.permission.DUMP permission\n","stderr":""}}

Is this spossible to support sleep/wake state checking inside Slideshow app? Any advice appreciated.

Thank you for efforts to make Slideshow great app :)

milan-fabian commented 1 month ago

Hello,

Unfortunately, "dumpsys power" command requires permission android.permission.DUMP, which is not possible to obtain for regular apps on non-rooted devices (https://slideshow.digital/documentation/root-on-android/).

The big issue with Android sleep mode is that the app might not be able to wake the operating system up. Could you please let us more about your use case?

kamiKAC commented 1 month ago

Hello

That's what I was afraid :) I have few Denver frames which has Frameo App installed. They run Android 6.0. I managed to install Slideshow there. I've created simple web app which shows frames state (off, sleep, on) and screenshot. I'd like to turn off displays on all frames remotely on the end of the day and turn them on in the morning. I have only one frame for testing and to test multiple devices I wanted also to use my old Nexus 7 II tablet with LineageOS 18.1 (android 11) installed but this one seems to have problem with state reporting and event sending via Slideshow API. Using adb shell I'm able to check state, put device sleep and wake my Nexus. I'll try to root device.

milan-fabian commented 1 month ago

At first, I suggest checking whether the network (Wi-Fi) stays on even if the tablet is sleeping for the entire night and if you are able to connect to it remotely. Android usually optimizes power options during sleeping.