RTCZero Lib working but with one day less (yesterday

Hello.

I'm using the proposed WiFi tutorial on RTCZero in https://www.arduino.cc/en/Tutorial/WiFiRTC

Everything works except the day which is yesterday ie some minutes ago 17/12/16 21:36:39 (GMT +1 =CET for me).

Before to modify the RTCZero.ccp (and my first rule is not to modify any lib at all):

1- does it happen only to me?
2- is related to leap year?
3- any suggestion?

Thx

Are you using the latest RTC as there seemed to be some issues with the earlier ones

See HERE for latest

Or make sure its up to date in your libs using "Manage Libraries"

Thx Ballscrewbob.

I confirm that I went to Sketch-->Include Lib --> Manage Lib and I installed RTCZero (vers 1.5.1)

My Arduino version is 1.6.13.

Now (19-12 14:28 ) it shows 18/12/16 14:28:22

Weird!! Isn't it? Any other suggestion welcomed before to enter and "damage" the libs :confused:

Thx

Thats all I have but you could also check the issues list on GIT (same page just open the issues tab) too see if there are any hints or outstanding items that match yours.

Cant test right now as my other MKR is hanging on the side of the garage doing basic weather data and the other is commissioned in a proto project elsewhere.

@valter:
this error always happens?
the library basically receive the NTP packet and then just format the date / hour correctly.
we've just tested now and works as expected.

@Andrea

Yes it happens always on that PC.
So tonight after your reply I went more curios and install Arduino 1.6.13 on an other PC available here at home and ....you are right it works as expected 20/12/16 23:11:xx.

So back to the other PC where I solved by adding +1 in the line of the day but it's not clearly the right solution :o .

Give you (if interested) some more details tomorrow afternoon...

valter

@Valter can you please post here the two binaries that the computers produce?
Sketch->Export Compiled Binay

@Arturo thx for your support...please find them attach.

Regarding to libs the only difference I can notice is on WIFI lib. Could be here the problem?

Details:

PC producing .hex with One day less

Using library SPI at version 1.0 in folder: C:\Users\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.9\libraries\SPI
Using library WiFi101 at version 0.11.1 in folder: C:\Users\Documents\Arduino\libraries\WiFi101
Using library RTCZero at version 1.5.1 in folder: C:\Users\Documents\Arduino\libraries\RTCZero

PC producing .hex Ok
Using library SPI at version 1.0 in folder: C:\Users\TestUser\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.9\libraries\SPI
Using library WiFi101 at version 0.11.2 in folder: C:\Users\TestUser\Documents\Arduino\libraries\WiFi101
Using library RTCZero at version 1.5.1 in folder: C:\Users\TestUser\Documents\Arduino\libraries\RTCZero

Attached with accepted extension .txt

thx

Epoch.ino.mkr1000Ok .txt (23.6 KB)

epoch.ino.mkr1000OneDayLess.txt (23.6 KB)

I have a similar problem, except that my date is one day ahead (19th of january, 2017, while it's the 18th today).

My setup:
PC: windows 7 64bit
Arduino: MKR1000
IDE: 1.8.1
Libraries:
RTCzero 1.5.1
WiFi101 0.12.0

The only change I've made is: const int GMT = 1;
(apart from of course SSID and password)

As I understand from the Wifi101 library reference the getTime() function fetches the date and time from the Wifi module. Is it possible that the date on our Wifi module is wrong?
The other question I have is: How does RTC.setEpoch() set the time and date in the RTC module? It must somehow calculate the date from the UNIX-time. Does it account for leap days over the years from 1970 on?

Any information is welcome. Thanks in advance.

I submitted a PR. Please try it with latest library