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

Esquilo time and daylight savings

JefferyS

How does the Esquilo deal with Daylight savings?

I'm not getting the correct time on my Esquilio's, One of them is ahead a hour and right now the other one is ahead like 6 hours, have no idea what's up with that but It's being used so can't do any checking.

The one hour ahead is using a time-a-g-nist.gov sntp server and the other one is using sntp.esquilo.io. For some reason the first one didn't want to get the time from sntp.esquilo.io.

Any ideas?

When their done being used I'll be able to check them out better.

Thanks,

Jeffery

robertjensen

I have often had trouble with ntp on the Esquilo Air. Sometimes after reboot, the date will be nowhere close to being right and never get corrected. I've had better luck when I replace the URL of the time server with a numerical address.

I have other issues that I think are due to problems with DNS. The DSN on the Air is 192.168.1.1, my router. If I change it to an external DNS, some things work better for a while until the DNS address reverts to 192.168.1.1 without my help.

JefferyS

Thanks Robert, I'll try using the IP address. I've noticed issues with DNS and having the NTP work too.

I have this in my boot.nut to make sure it gets the date and time from the NTP server but can't tell if it is correct. I made some minor changes today to print the time too but don't have that code with me but simple to do. I was thinking about flashing a red led if it can't get the time in a certain amount of time though I usually can tell because the anodizing web interface doesn't work.

///////////////////////////////////////////////////////////////////////////////
// Welcome to the Esquilo boot nut!
//
// The Esquilo boot nut is a squirrel nut that your Esquilo can execute every
// time it boots.  It is stored in a special area of flash inside of the ARM
// processor so it is available even if there is no micro SD card.  You can
// change the boot nut setting either from the Esquilo IDE under the system
// menu or with the "sq boot <true|false> command from an EOS shell.
//
// What you do with the boot nut is up to you.  You can write your entire
// application in the boot.nut or you can use it as a springboard to a nut
// stored elsewhere.
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
// Run a nut on the micro SD card
///////////////////////////////////////////////////////////////////////////////
require("system");

delay(5000);

// Wait till the Date is updated with the time server
local t = date();
local today = (t.month +1) + "-" + t.day + "-" + t.year;

while(today == "7-5-2016") {
    delay(1000);
    t = date();
    today = (t.month +1) + "-" + t.day + "-" + t.year;
}
print(today + "\n");

dofile("sd:/AnodizingController/AnodizingController.nut");
robertjensen

I have put these lines into boot.nut and things seem to work. The delay seems necessary.

delay(1000);
system("netcfg sntp server 17.253.20.253");
system("netcfg sntp query 17.253.20.253");

The address is time.apple.com. I just executed these lines with these results.

system("netcfg sntp query time.apple.com");
Unable to query SNTP server
system("netcfg sntp query 17.253.20.253");
SNTP query succeeded

When I execute system("netcfg"), the results include

DNS Address : 192.168.1.1

As I said before, I have changed the DNS and found that it changed back.

JefferyS

That is simpler than mine lol. Didn't think about doing that, though I knew you could query the NTP server.

I found that my time zone had not been set on one Esquilo, must have been when I had one that broke and replaced it and the other one was off by 1 though now thinking about it I might have done that to be correct with daylight savings because I know my time zone is -6 but it was set to -5.

It would be nice if the time zone setting was in the Esquilo configuration in the IDE.

Just have to be mindful of that.

Thanks for your help.

Jeffery