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

sleep command stops working when phone in sleep mode (screen off).

asked 2015-11-14 00:39:25 +0200

Schturman gravatar image

Hi
My script use "sleep 30m" command and today I noticed that when phone in idle=sleep mode (screen off) more than this 30 min, script don't do what it should to do every 30 min. It continue working when I open screen.
Can I do something with this ?
Thanks

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
1

answered 2015-11-14 01:03:42 +0200

lakutalo gravatar image

updated 2015-11-14 01:07:42 +0200

I had a quite similar problem some months ago: https://together.jolla.com/question/102364/cli-paused-and-commands-stopped-when-device-locked/

In fact every interactive process changes to sleep mode when display is off. You can even notice that when you are connected with your PC to your Jolla via WLAN, your ssh session simply pauses. It resumes at the moment you open at least lock screen.

You may find a solution in the answer of above mentioned post. I did not have time yet to test it myself, though.

edit flag offensive delete publish link more

Comments

Thanks...
You mean to run my script from service (systemctl)? If yes, this exactly what I do, but what I need to add to the service file to prevent this deep sleep mode ? And how much battery it will eat ?

Schturman ( 2015-11-14 01:21:41 +0200 )edit

As mentioned, I haven't had time to find out myself, so I don't know yet. One comment in the referred thread also suggests that running from cron circumvented the deep sleep problem. Hence this might give us a clue where to search.

lakutalo ( 2015-11-14 01:58:18 +0200 )edit

Thanks... I don't know how to use cron. Will try to learn it...

Schturman ( 2015-11-14 02:07:40 +0200 )edit

@schturman you can get my vixie-cron port srpm from http://swagman.org/juice/vixie-cron-3.0pl1-1.src.rpm

When a script is started from cron, it will be executed regardless of the system sleep state. I use cron for example to schedule timed backups, mail lookups, opening ssh tunnel from device to my server, etc.

juiceme ( 2015-11-14 14:54:37 +0200 )edit

@juiceme, thanks. Will look at this...
For now I don't think I will going to change all my apps and will tell to users install cron.
But anyway thanks.

Schturman ( 2015-11-14 17:48:46 +0200 )edit
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2015-11-14 00:39:25 +0200

Seen: 241 times

Last updated: Nov 14 '15