I am working with the integer version of a custom build from the custom build site. This is built against "master" and I believe it is from the 2.0 tree. Is there a way to tell exactly what version you are building?
In my lua script, I join the network, and get an IP address. I so a SNTP sync and the clock gets set. I set up SNTP with the 1 option to let it update itself. In the function to do that I have it stamp when it does an update so I can see it.
Next I set up 5 cron jobs. One to go off at 0 minutes, one to go off at 15, than 30, than 45, than 55. I started doing this with just one line but got weird results so I broke it up. Here are the lines..
cron.schedule("0 * * * *", function(e)
tm = rtctime.epoch2cal(rtctime.get())
print(string.format("*** Cron Job 0 *** %04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"]))
end)
cron.schedule("15 * * * *", function(e)
tm = rtctime.epoch2cal(rtctime.get())
print(string.format("*** Cron Job 15 *** %04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"]))
end)
cron.schedule("30 * * * *", function(e)
tm = rtctime.epoch2cal(rtctime.get())
print(string.format("*** Cron Job 30 *** %04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"]))
end)
cron.schedule("45 * * * *", function(e)
tm = rtctime.epoch2cal(rtctime.get())
print(string.format("*** Cron Job 45 *** %04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"]))
end)
cron.schedule("55 * * * *", function(e)
tm = rtctime.epoch2cal(rtctime.get())
print(string.format("*** Cron Job 55 *** %04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"]))
end)
Each time a cron job goes off it spits the time/date to the tty.
Initially I started with just 4 cron entries. 0, 15, 30, and 45. Things seemed to work pretty OK, except the 45 minute cron job would go off at 13 minutes. The rest were fine. Weird. After pulling a lot of hair out I added the 55 minute cron job, this one goes off at 23 minutes.
Here is one of the logs.
dofile(time.lua) Wednesday, March 22, 2017 15:22:24
dofile("time.lua")
Setting up Cron Jobs
> Time Sync 2017/03/22 19:22:33
*** Cron Job 55 *** 2017/03/22 19:23:00
*** Cron Job 30 *** 2017/03/22 19:30:00
*** Cron Job 0 *** 2017/03/22 20:00:00
*** Cron Job 45 *** 2017/03/22 20:13:00
*** Cron Job 15 *** 2017/03/22 20:15:00
*** Cron Job 55 *** 2017/03/22 20:23:00
*** Cron Job 30 *** 2017/03/22 20:30:00
*** Cron Job 0 *** 2017/03/22 21:00:00
So, is it my doing something stupid or are the 45 and 55 minute cron jobs not working as they should? Is this a bug in the code or is it me?