Hi there,
if one is running a script without user interaction (e.g. picture frame, dashboard, weather-display ...) what is the best way to return to the ebook reader application without resetting the device?
Example "picture frame":
Current implementation is to have a "while true" loop that updates the image and then sends the reader to "suspend to ram" via rtcwake (e.g. for half an hour - so essentially the reader is in suspend to ram most of the time). What I noticed is that the reader wakes up from suspend to ram when the power button is pressed. I could use this to trigger the script to exit but I am not sure wether the wake up was due to power button press or just at the scheduled time.
I came up with the following ideas:
Which would be the recommended way to implement this? Any other ideas to implement this - is there a way to detect the reason for wake up (i.e. scheduled time reached or power button)?
To restart nickel could this script be used? https://github.com/koreader/koreader...kobo/nickel.sh
Kind regards
KristianR
if one is running a script without user interaction (e.g. picture frame, dashboard, weather-display ...) what is the best way to return to the ebook reader application without resetting the device?
Example "picture frame":
Current implementation is to have a "while true" loop that updates the image and then sends the reader to "suspend to ram" via rtcwake (e.g. for half an hour - so essentially the reader is in suspend to ram most of the time). What I noticed is that the reader wakes up from suspend to ram when the power button is pressed. I could use this to trigger the script to exit but I am not sure wether the wake up was due to power button press or just at the scheduled time.
I came up with the following ideas:
- remember the scheduled wake-up-time, compare to actual-wake-up-time. If it differs by more than say 5s assume wake up was due to press of power button -> exit script, restart nickel etc.
- Monitor /dev/input/event0 in some way Code:
cat /dev/input/event0 | hexdump
Which would be the recommended way to implement this? Any other ideas to implement this - is there a way to detect the reason for wake up (i.e. scheduled time reached or power button)?
To restart nickel could this script be used? https://github.com/koreader/koreader...kobo/nickel.sh
Kind regards
KristianR