Pine phone CPU sleep
#1
Hi,
Is it possible to put the pine phone CPU into some form of sleep mode programmatically?

There are many instances during a program where it is useful to put the main processor into some form of sleep mode e.g a time-lapse camera App that goes into sleep mode in between taking images.

Is this possible with the pine phone?

Cheers.
  Reply
#2
Yes - you can ask the OS to suspend. For time-lapse you probably want to tell it when to wake up first. Remember other things can wake it up before then too - the phone OS is normally configured to go into suspend after some idle interval.

https://wiki.pine64.org/wiki/Crust
https://gitlab.gnome.org/kailueke/wake-mobile
  Reply
#3
(09-08-2021, 08:53 AM)wibble Wrote: Yes - you can ask the OS to suspend. For time-lapse you probably want to tell it when to wake up first. Remember other things can wake it up before then too - the phone OS is normally configured to go into suspend after some idle interval.

https://wiki.pine64.org/wiki/Crust
https://gitlab.gnome.org/kailueke/wake-mobile

Hi,
And thanks for the reply.

When in sleep mode is there any information on the current draw of the pine phone?

I have tried (and so far failed) to programmatically do something similar on an android device i.e when an App pauses and then stops when the phone automatically goes into sleep mode, the App should automatically restart/resume after a user defined period of time. For Android this is achieved using the alarm manager and broadcast receivers that work in background but it is much more complex than it needs to be and it seems to me that the same thing would be much easier to achieve using the pine phone.

Any thoughts on this?

Cheers.
  Reply
#4
The https://wiki.pine64.org/wiki/Crust is a good start. It points to a rtcwake that you could use.

Example for a python app to wake you after 10 seconds and keep memory active:

import subprocess
[Your Code]
myProcess = subprocess.Popen(["rtcwake", "-m", "mem", "-s", "10", ""], stdout=subprocess.PIPE)
[More of your code]


rtcwake usually works but sometimes the Pine Phone gets into one of it's moods and stays asleep.

Side note: I find using man [command] to pull up a commands manpage to be very helpful when in Linux Land.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Looking for the "non-phone" OS wakyct 7 931 03-14-2024, 03:51 AM
Last Post: MTXP
  Writing apps/programs for pine phone katesfb 7 4,740 03-11-2024, 10:42 PM
Last Post: Emelia525
  How To Access the Pine Phone Auxillary microSD Without Removing Card pinephoneuser22 2 789 01-09-2024, 07:02 PM
Last Post: britelite
  Pine company idea aular 9 1,612 12-07-2023, 12:32 AM
Last Post: KC9UDX
  Can the Pine Phone be serviced and updated remotely? profileyourcity 3 989 10-02-2023, 05:19 PM
Last Post: Zebulon Walton
  UBports on pine phone? robb777 16 3,407 09-01-2023, 04:26 AM
Last Post: gregb49
  US Cell Phone Service Providers with prices and phone numbers - UPDATED jovval 0 680 07-01-2023, 01:25 AM
Last Post: jovval
  Loving my pine phone after about a year of not undata 0 655 05-11-2023, 02:23 PM
Last Post: undata
  New Phone Opening Issues LuluFrance 5 2,024 03-15-2023, 05:33 AM
Last Post: anonymous
  pine phone external speaker AnAbolitionist 9 3,203 02-08-2023, 01:11 AM
Last Post: robb777

Forum Jump:


Users browsing this thread: 1 Guest(s)