How often does ntp on the Linino connect to the ntp server?
It obviously connects at boot, but when it is running, does it connect
Once an hour
Once a day
Some other schedule
Every time a 'date' command is executed
Some combination of the above
The reason I ask is, that in my sketch I query time with the 'date' command in every iteration of loop(). Today where we switched to PDT, I noticed that it immediately was aware of the new time at 2:00 am, so either it queries very often, or it computationally know when PDT starts.
So I got to think that in 4 above, I would be hitting the ntp server several times a second, and I think that is not very polite
On a related subject, I have noticed that after boot of the Linino and until the first successful ntp query, the 'date' command returns a specific date every time (in my case 2013-10-20). I use that in my sketch getTime() routine to determine if the time is valid, and block until I get a valid time. I call this in setup() to wait for ntp to have synced since my loop() processing is time based. I know it is somewhat of a hack, but it seems very reliable, even I don't know where the specific date comes from, maybe the build date of the Linino image?
How often does ntp on the Linino connect to the ntp server?
The ntp update interval :600 Seconds (default value) to pause between measurements, i.e. 10 minutes. It is usually neither necessary not helpful to reduce this number.
Today where we switched to PDT, I noticed that it immediately was aware of the new time at 2:00 am, so either it queries very often, or it computationally know when PDT starts.
On a related subject, I have noticed that after boot of the Linino and until the first successful ntp query, the 'date' command returns a specific date every time (in my case 2013-10-20). I use that in my sketch getTime() routine to determine if the time is valid, and block until I get a valid time. I call this in setup() to wait for ntp to have synced since my loop() processing is time based. I know it is somewhat of a hack, but it seems very reliable, even I don't know where the specific date comes from, maybe the build date of the Linino image?
The getTime is widely use at datalogger, if logger is database based. Neither Arduino nor Linono should provide date/time . Correct way should be database time stamp. It is not application layer job but database layer job.
Sorry if I confused the issue, getTime() is my own routine, which uses the 'date' command to get the time via a process. Now that I realize that there is a system function getTime(), I might rename my own function to avoid confusion.
I am using time both for scheduling tasks in my loop(), and for time stamping entries in a csv file.
Edit: After searching, I have not been able to find the getTime sonnyyu is talking about, am I missing something?