An archive of community.esquilo.io as of Saturday January 26, 2019.

When does the Esquilo get the date and time from the time server?

JefferyS

The problem I'm having is when the Esquilo starts and runs my program, my code creates a log file with the date as part of the name of the file. PidLog_2016_10_23.log

It seems to me that the sync to the time server is happening after that so I'm not getting the current date for my file name.

Is there a way to check to see if the time has been synced then start my program?

Or should I just manually code that into my startup to sync the time before making my log file?

Does the Esquilo loose the date and time on a soft reset too? Like using the Reset menu in the IDE.

Any help would be most appreciated.

Thanks,

Jeffery

Scott_Shumate

The NTP client runs first thing at start but it could take several seconds to get the time depending on the network. If you want to guarantee it gets the current time prior to your program running, then check the date at the start of your program in a loop. If the date is less than a recent date, say 10-1-2016, then sleep for a few seconds and try again.

The Esquilo uses the firmware build date until it syncs with NTP. The time is lost after every reset since Esquilo does not have a battery.

JefferyS

Thanks a lot Scott, now it makes since why it would have the folder date of PidLog_2016_07_05.log a lot of the time. I'm guessing that is the build date of the EOS 0.6 firmware.

Thanks, that should be easy to make sure the date is after that before it starts the program.

Thanks,

Jeffery