Page 1 of 1

scheduled action works only every second day

Posted: 18 Mar 2019, 09:25
by Karesz
Hello all!

Few weeks ago I installed a kiosk with Porteus Kiosk 4.8.0 in a school to display teacher replacement.
Everything works fine with that.

For power saving reasons I scheduled automatic actions from remote TXT file management:
"scheduled_action=Monday-16:00 Tuesday-16:00 Wednesday-16:00 Thursday-16:00 Friday-16:00 Saturday-07:00 Sunday-07:00 action:echo mem > /sys/power/state"

The promlem is very interesting.
The scheduled actions written above works only on every second day...

So that means:
Monday goes to mem powersate succesfully
Tuesday DOESN'T go to mem powerstate :wall:
Wednesday goes to mem powersate succesfully
Thursday DOESN'T go to mem powerstate :wall:
Friday goes to mem powersate succesfully
Saturday DOESN'T go to mem powerstate :wall:
Sunday goes to mem powersate succesfully

What am I missing or doing wrong? :sos:

PS:
The machine is: Asus ET1611 AIO
The motherboard only knows "RESUME ON RTC ALARM", so thats why I set echo mem > /sys/power/state instead of poweroff.
And my timezone/NTP from remote TXT file management is:
"timezone=Europe/Budapest"

Thanks:
Karesz
Hungary

scheduled action works only every second day

Posted: 18 Mar 2019, 14:04
by fanthom
Suspend to RAM may confuse scheduled actions parameter.

Better do full power off and RTC wake as your motherboard supports it:
https://porteus-kiosk.org/parameters.html#rtc_wake

Thanks

scheduled action works only every second day

Posted: 18 Mar 2019, 14:27
by Karesz
Unfortunately the mobo supports only rtc resume.

Any advice instead of suspend to ram?
cat /sys/power/state indicates: standby not availalble

Maybe echo disk > /sys/power/state ? :hmmm:

scheduled action works only every second day

Posted: 18 Mar 2019, 15:31
by fanthom
In this case you would need to program cron daemon using 'run_command=' as explained here:
https://porteus-kiosk.org/faq.html#22

scheduled action works only every second day

Posted: 19 Mar 2019, 07:14
by Karesz
Thanks!

Is this correct, if I would like to send the machine to mem on weekdays at 16:00 and on weekends at 7:00? (bios only support every day or one day, so the rtc resume time is 6:55 am)

run_command=echo '0 16 * * 1-5 root su - -c "echo mem > /sys/power/state"' >> /etc/crontab; echo '0 7 * * SAT,SUN root su - -c "echo mem > /sys/power/state"' >> /etc/crontab :hmmm:

And my further questions are:
Should I remove the scheduled_action= line?
And, is there a specific place for run_command= line, or can I paste where I want in the config TXT file?

Thanks again Fanthom!

scheduled action works only every second day

Posted: 19 Mar 2019, 08:18
by fanthom
"Is this correct, if I would like to send the machine to mem on weekdays at 16:00 and on weekends at 7:00? "
Seems to be ok.

"Should I remove the scheduled_action= line?"
Yes

"is there a specific place for run_command= line, or can I paste where I want in the config TXT file?"
Anywhere in the config (unless you have nested configurations enabled, if yes then specific rules apply).

scheduled action works only every second day

Posted: 19 Mar 2019, 08:33
by Karesz
I upgraded the config file.
I'm going to inform you from the news : - )

Thx a lot!

scheduled action works only every second day

Posted: 19 Mar 2019, 08:55
by Karesz
Sorry, a last question:

One thing is not clear:
Do I need to put echo mem > /sys/power/state command between quotes " "?

Like:
run_command=echo '0 16 * * 1-5 root su - -c "echo mem > /sys/power/state"' >> /etc/crontab; echo '0 7 * * SAT,SUN root su - -c "echo mem > /sys/power/state"' >> /etc/crontab

Or without " ":
run_command=echo '0 16 * * 1-5 root su - -c echo mem > /sys/power/state' >> /etc/crontab; echo '0 7 * * SAT,SUN root su - -c echo mem > /sys/power/state' >> /etc/crontab

scheduled action works only every second day

Posted: 19 Mar 2019, 11:04
by fanthom
Do I need to put echo mem > /sys/power/state command between quotes " "?
Yes

scheduled action works only every second day

Posted: 21 Mar 2019, 19:40
by Karesz
Hello Fanthom!

Injecting into cron seems to work fine.
My kiosk goes to mem and wakes when it should.

Thanks again!
Lets develop this cool distro :celebrate3: