1. Are you ready for the Galaxy S20? Here is everything we know so far!

[Tasker] How to wake the CPU (not screen) awake using Tasker?

Discussion in 'Android Apps & Games' started by ldm1417, Oct 6, 2018.

  1. ldm1417

    ldm1417 Member
    Thread Starter

    Hi All,

    How to keep the CPU (not screen) awake using Tasker?

    Thank you!
     

    Advertisement

  2. Hadron

    Hadron Smoke me a kipper...
    VIP Member

    You want to run the battery down by preventing the phone from sleeping? Like your own, personal wakelock?

    Sorry, slightly flippant, but I am wondering what you are trying to achieve? Any app that is allowed to and forced to run in the background will keep the cpu aware, but to what end? Presumably you are actually wanting to keep some specific process from being optimised to sleep, rather than just burning cpu cycles for the sake of it, so a task that merely stops the device sleeping may not solve your actual problem.
     
    Thom likes this.
  3. Yes … what is the objective?

    … Thom
     
  4. ldm1417

    ldm1417 Member
    Thread Starter

    You want to run the battery down by preventing the phone from sleeping" - my phone is continuously connected to power, so don't warry about the battery discharging...
    what you are trying to achieve" - keeping the CPU alive.
    task that merely stops the device sleeping may not solve your actual problem" - what task? what the task should to? I can write a loop in the task what does something each 1sec. Is this enough? What task would you suggest to write?

    "what is the objective?" - I use the phone as a phome security camera, which should be triggered by a motion event. But ...the camera misses events. One of the possabilites why this happens is because the phone (cpu) goes to sleep (my guess). This is a reason why I want to keep my phone always alive (no sleep at all).

    So, what's the solution?
     
  5. Hadron

    Hadron Smoke me a kipper...
    VIP Member

    If you think that's what's happening you need to ensure that the app you want to stay alive is excluded from any battery optimisation. My concern would be that the phone might keep Tasker running but put the app that's generating or checking for your "motion event" to sleep, which would be no help (one app staying awake doesn't mean that others necessarily will).

    Can you just set it to keep the screen on when on charge? That should keep the phone awake (you can turn the brightness right down if you don't want it visible). If the system menus don't support that then I can see that one of Tasker's action options is Display > Stay On, which can be set to keep the screen on when on any combination of AC/USB/wireless charging..
     
  6. ldm1417

    ldm1417 Member
    Thread Starter

    the app you want to stay alive is excluded from any battery optimisation" - done... but it still happens (camera misses events)
    one app staying awake doesn't mean that others necessarily will" - understood ...
    "keep the screen on when on charge" - I can do this in Development Options... Keeping the screen ON will keep the WHOLE PHONE ON (no sleep at all)?
    "one app staying awake doesn't mean that others necessarily will" - good advice :) will do it :)
     
  7. On the Motorola Moto Z Force the brightness in Tasker set to zero …

    It dims at the end of the time that is set
    It never goes totally black

    I could set the timeout to 23h 58m 59s

    … Thom
     
  8. For timing I use …
    https://play.google.com/store/apps/details?id=com.ldroid.multistopwatchandtimer

    I started a timer running
    I switched to Tasker and ran a task with …
    System Lock
    … the screen went black.

    After a few minutes I went back to the timer and it was still running.

    (It should be noted that System Lock is not supported in an exported app (AKA kid) after Android 4.9. It is supported if run directly from Tasker.)

    … Thom
     
  9. lvt

    lvt Android Expert

    CPU usually have several cores, which one do you want to keep awake? ;)
     
Loading...

Share This Page

Loading...