[Gta04-owner] using the gta04 as an alarm clock

Andreas Kemnade andreas at kemnade.info
Mon Apr 29 07:28:24 CEST 2019


On Fri, 27 Jul 2018 17:14:28 +0200
Andreas Kemnade <andreas at kemnade.info> wrote:

> Hi,
> 
> On Fri, 27 Jul 2018 13:29:38 +0200
> "T. Munker" <t.munker at gmx.net> wrote:
> 
> > Hi,
> > 
> > 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.
> >   
> hmm, afaik qtmoko already uses rtc to wake up from suspend (so you have at least 20mA suspend current) but I have to check. 
> So I think most logic is already there. Setting the rtc alarm for suspend or for power on is the same. the -m option just tells rtcwake
> what to do afterwards and -m off is simply an ordinary shutdown. twl4030 is
> configured by default to power on on rtc events. Keyword in the source:
> STARTON_RTC
> But what happens might be that e.g. qtmoko clears the rtc alarm setting
> on shutdown. At least it can save alarm settings
> in its settings file, so it has only to do the right thing after
> startup.
> 
> so, several things to check...
> 
ok, checked some things.
Setting an alarm clock in qtmoko, then shutdown will power on the gta04
automatically at alarm time. So that also means: if your gta04 boots per
default to another system without a decent power management, you might
end up with an empty battery if you set the alarm in qtmoko and do not
notice the gta04 to be powered on.

If you want to check for wakeup-via-alarm condition in uboot,
the following stanza might help:

i2c dev 0
i2c read 0x4b 0x2a 1 ${loadaddr}
if itest.b *${loadaddr} == 0x42
then
  alarm="alarm"
else
  alarm=""
fi

You can then add ${alarm} to your kernel commandline.

Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20190429/1ba25464/attachment.asc>


More information about the Gta04-owner mailing list