We have moved to a new Sailfish OS Forum. Please start new discussions there.
3

How to schedule the power on of my Jolla at 7AM

asked 2016-05-17 14:22:29 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2018-12-03 21:27:54 +0200

Tanghus gravatar image

Hi,

In question Howto schedule shutdown of the Jolla ?, the automatic shutdown at 11PM of the Jolla was solved.

Now, I'd like my Jolla to automatically power on at 7AM, is this technically possible ?

If so, how ?

edit retag flag offensive close delete

Comments

2

Just add a (recurring) alarm at 7:00, it will wake up phone from power-off.

kimmoli ( 2016-05-17 15:24:48 +0200 )edit

Is it maybe possible with Situations App?

PatsJolla ( 2016-05-17 15:45:30 +0200 )edit

if you use situations to go to airplane mode over night, jolla will consume 3-5% in my case from 22 to 7 am.

pawel ( 2016-05-17 16:33:24 +0200 )edit
2

@kimmoli Setting up an alarm is not enough. After choosing "Snooze" or "Dismiss" for an alarm, SailFish OS 2.0.1.11 puts the Jolla back to OFF. Is there a setting to tell the alarm to boot the device once the alarm acknowledged ?

SebM ( 2016-05-17 23:54:43 +0200 )edit

"if you use situations to go to airplane mode over night, jolla will consume 3-5% in my case from 22 to 7 am. pawel (May 17 '16"

I use Situation App for setting Jolla into flight mode from 23 to 6 am. The power consumption lies between 2 - 4 %. With 4G on the power consumption is 5-6% over same period, and with 2G on 4-5% , respectively. (Naturally all depends on the low/high magnitude fields of 2G to 4Gs).

N9Sailfish ( 2016-06-23 11:45:42 +0200 )edit

2 Answers

Sort by » oldest newest most voted
6

answered 2016-06-22 19:18:55 +0200

eatdirt gravatar image

updated 2016-06-22 19:21:00 +0200

Yes, in principle you can, if the phone is in S3 state. This is one of the purpose of a systemd timer. For instance, the timer should look like this (not tested on jolla, but runs fine on my linux desktop)

wakeup.timer

[Unit]
Description=Wake up my system daily

[Timer]
OnCalendar=*-*-* 07:00:00
WakeSystem=true

[Install]
WantedBy=timers.target

Such a timer will look for a "service" of the same name and will execute it after having woken up the system, here I start the clock, but anything you fancy is good.

wakeup.service

[Unit]
Description=Wake up command
Requires=dbus.socket
After=pre-user-session.target

[Service]
Group=nemo
Type=oneshot
ExecStart=/usr/bin/jolla-clock

[Install]
WantedBy=user-session.target

You may install these services in /usr/lib/systemd/user/ and activate them systemctl --user start wakeup.timer (or/and enable instead of start to make it automatic at each boot).

edit flag offensive delete publish link more
1

answered 2016-05-17 18:21:52 +0200

objectifnul gravatar image

updated 2016-05-17 18:27:41 +0200

I'm afraid the best you can do is to set a clock alarm, possibly with both PIN code and phone lock code empty (I don't want this option for myself).

For the shutdown part, I'm using Sailcron (https://openrepos.net/content/ade/sailcron) with this command:

bash -l -c "dsmetool -o"

Of course, the equivalent for wake-up (bash -l -c "dsmetool -u") doesn't work, as the daemon is not running when the phone is off.

Keep in mind the built-in weekly scheduled btrfs balance process (Tuesday 3 am).

edit flag offensive delete publish link more

Comments

Why using cron on a systemd-powered OS ? Wouldn't systemd times make more sense ?

(That's what I use on systemd-powered distributions)

DrYak ( 2016-05-17 20:55:24 +0200 )edit

And although cron doesn't work when the phone is down, the chipset it self is able to wake up and that's what alarms uses. Most smartphones are able to wake-up to fire-up an alarm even when powered down (as long as either battery and/or charger are there).

(That's also what MythTV uses on servers and workstations)

(Note in the man page that systemd.timer syntax has a provision for wake-up from suspend. So eventually, this might get ported to the Jolla too, one day...)

DrYak ( 2016-05-17 21:00:47 +0200 )edit

The shutdown part is treated by another question : How to schedule shutdown of the Jolla ?

For the power on part, setting up an alarm is not enough. After choosing "Snooze" or "Dismiss" for an alarm, SailFish OS 2.0.1.11 puts the Jolla back to OFF.

Is there a setting to tell the alarm to boot the device once the alarm acknowledged ?

SebM ( 2016-05-17 22:53:01 +0200 )edit

The real issue is: there is no way to schedule an unattended boot-up for a PIN and/or lock protected phone, unless you include those confidential codes in plain text in your script. They would no longer be confidential.

objectifnul ( 2016-05-18 00:00:57 +0200 )edit

@DrYak: you would use this (modified) cron because it wakes up every minute from deep sleep. Systemd timers are not reliable on the phone.

adekker ( 2016-05-18 00:29:05 +0200 )edit
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2016-05-17 14:22:29 +0200

Seen: 1,070 times

Last updated: Jun 22 '16