[Gta04-owner] using the gta04 as an alarm clock
t.munker at gmx.net
Fri Jul 27 13:29:38 CEST 2018
sounds great. I have an addition
Assuming there is already some Alarn application running (as you propose cron), there should be a check of it in the shutdown scripts. When the alarm is set, then an rtc call would only have to ensure that the phone is running before that and the rest will do the alarm software by itself (which has to be active right after system boot)
So a user of the alarm application will not notice that there was something special about turning off the phone. There should be a user interface defined for that shutdown script. I like the idea, of a file which has the timestamps at which point(s) in future the device should be up.
Am 27. Juli 2018 09:23:21 MESZ schrieb "H. Nikolaus Schaller" <hns at goldelico.com>:
>> Am 27.07.2018 um 09:14 schrieb H. Nikolaus Schaller
><hns at goldelico.com>:
>>> Am 26.07.2018 um 22:14 schrieb Andreas Kemnade
><andreas at kemnade.info>:
>>> I just stumbled upon the fact that the device can be started by rtc
>>> alarm. So you can use it as an alarm clock without having the
>>> current. So
>>> 1. turn off modem
>>> 2. rtcwake -m off -s seconds | -t time_t
>>> And then you have to make sure that the device starts an alarm after
>>> boot in that case. I do not know yet how to check that it was
>>> by rtc.
>> Interesting idea! I did know the rtcwake command only for measuring
>> suspend current but I wasn't aware that it also works for
>>> Maybe set file as a kind of flag before shutdown and then if
>>> remove it and start the alarm.
>> Yes, it is probably not possible to query the twl4030 through
>> boot to find out if it was started by button or event.
>> So this should be solved in user-space.
>> Maybe the best thing is to store the wakeup time in some file and
>> if it was passed. I.e. no alarm if you manually turn on before.
>>> Of course you should have a login with password, so you will not
>>> turn off the alarm.
>> We should probably put that into some script running during
>> Maybe we can simply set the modification time of some file to the
>> alarm time and then do a simple
>> touch /tmp/rtcwake
>> if [ /tmp/rtcwake -nt /root/rtcwake ]
>> then # alarm time has been passed
>> rm /root/rtcwake
>> aplay alarm
>> and triggering the alarm is like:
>> /root/wwan-off || exit 1
>> touch -t [[CC]YY]MMDDhhmm[.SS]] /root/rtcwake
>> rtcwake -m off -t time
>> Another option would be to mix this with cron, i.e. find out
>> when the next cron event is to be scheduled
>Python seems to have a library for doing that:
>> and make the device
>> boot 1 minute before. Then a simple
>> echo "aplay sound" | at -t time
>> would suffice.
>> Gta04-owner mailing list
>> Gta04-owner at goldelico.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gta04-owner