08-01-2021, 06:29 AM
(This post was last modified: 08-01-2021, 06:30 AM by DrPlamsa.
Edit Reason: user generalization
)
Here, I'll discuss what I've already accomplished. I found that systemd timers can wake up the PinePhone from suspend/crust. For testing purposes, I've used sytemd-run rather than making new .timer and .service files, because of its simplicity. Here's my one-line command which sets a wake timer:
sudo systemd-run --unit='WakeTimer' --on-active=1 --on-unit-active='30m' --timer-property='AccuracySec=1s' --timer-property='WakeSystem=true' /bin/sh -c "date >> /home/[user]/Desktop/MyWakeLog.txt"
So, what is supposed to happen?
1) After 5 minutes, the PinePhone goes into suspend/crust
2) After 30 minutes, the PinePhone wakes up, automatically checks email and chats, and serves any notifications
3) After 5 minutes, the PinePhone goes back into suspend/crust to save battery
Here's what actually happens:
1) After 5 minutes, the PinePhone goes into suspend/crust
2) After 30 minutes, the PinePhone wakes up!
3) The screen stays on, and it never goes back into suspend/crust
4) The battery runs down and it dies
So, does anyone know of either a way of fixing my existing incomplete solution, or a better way of implementing this behavior?
I've tried using xdotool to send a key press, in the hope that this will reset the idle timer and allow the phone to re-suspend after 5 minutes, but xdotool does not seem to actually produce any results on the PinePhone. I've tried using gdbus to call the org.gnome.Mutter.IdleMonitor.GetIdletime method, which works on my desktop but on the PinePhone returns "Not supported." I've tried using gdbus to call the org.gnome.Mutter.IdleMonitor.ResetIdletime method, but this method apparently requires a specific compiler directive to work.
Thanks for your attention and input
sudo systemd-run --unit='WakeTimer' --on-active=1 --on-unit-active='30m' --timer-property='AccuracySec=1s' --timer-property='WakeSystem=true' /bin/sh -c "date >> /home/[user]/Desktop/MyWakeLog.txt"
So, what is supposed to happen?
1) After 5 minutes, the PinePhone goes into suspend/crust
2) After 30 minutes, the PinePhone wakes up, automatically checks email and chats, and serves any notifications
3) After 5 minutes, the PinePhone goes back into suspend/crust to save battery
Here's what actually happens:
1) After 5 minutes, the PinePhone goes into suspend/crust
2) After 30 minutes, the PinePhone wakes up!
3) The screen stays on, and it never goes back into suspend/crust
4) The battery runs down and it dies
So, does anyone know of either a way of fixing my existing incomplete solution, or a better way of implementing this behavior?
I've tried using xdotool to send a key press, in the hope that this will reset the idle timer and allow the phone to re-suspend after 5 minutes, but xdotool does not seem to actually produce any results on the PinePhone. I've tried using gdbus to call the org.gnome.Mutter.IdleMonitor.GetIdletime method, which works on my desktop but on the PinePhone returns "Not supported." I've tried using gdbus to call the org.gnome.Mutter.IdleMonitor.ResetIdletime method, but this method apparently requires a specific compiler directive to work.
Thanks for your attention and input