I think it would be very handy to have something like device.ontime(yr,mo,da,hr,min,sec) to trigger an event at an entered time. If the more significant date parts are left blank the function would assume the current value of those parameters. For instance device.ontime(12) would trigger on second 12 of the current minute (if it hasn’t already passed). Whereas device.ontime(27,36) would trigger at minute 27, second 36 of the current hour (if not already passed). It would be a variation of imp.wakeup that is tied to a fixed time rather than an elapsed time.
Of course, depending on time stamps would limit to +/- 1 sec. which would generally be okay for the type of applications I envision.
This functionality can be implemented in code, of course. But it would be a nice feature.
The limitation of using cron (for my application) just occurred to me. I need to run a job on my device. The cron can only communicate with the agent. That introduces a (sometimes significant) delay to get the agent to in turn message the device. So it’s a bit more involved than it first seemed.
My request for device.ontime(yr,mo,da,hr,min,sec) stands.
Yes, I’m using a separate RTC in other applications. But it adds another chip and increases board density. It seems to me that it should not be a difficult item to add to the imp/squirrel capabilities. The chip is certainly capable of the task. And it impresses me as being useful to many. I’ve also written some code which approximates the function. But it isn’t very precise and wastes processor resources.