DS3234 module - Time setup

Hi,

I try to set up the hardware DS3234 time with the library “RtcDS3234.h”. The code follows below.

http://codepad.org/pxNNcHTK

Although there is a time setup on line 130, the time print on next lines print an outdated time. I can’t understand what is happening. Can you try to reproduce the error?

Best regards,
Bruno P.

In the code

    if (now < compiled) 
    {
        Serial.println("RTC is older than compile time! (Updating DateTime)");
        printDateTime(compiled);
        Rtc.SetDateTime(compiled);
    }

it’s printing the time at which the sketh was compiled, so that’s normal that it’s a bit behind real-time. Starting from the, the RTC should be primed and counting.

What output does it give fully? Are you using a breakout module? Does it have a battery connected?

I am currently afk and typing from my mobile phone. The output is indeed not the compile time but a DateTime of 2009. What do you mean by breakout module? The battery is connected.

Now, near to keyboard, the output follows:

RTC was not actively running, starting now
RTC lost confidence in the DateTime!
RTC is older than compile time! (Updating DateTime)
1/4/2021 : 20:10:26
165/85/2009 : 37:165:165

RTC lost confidence in the DateTime!
165/85/2009 : 37:165:165

Per FAQ #5 · Makuna/Rtc Wiki · GitHub that behavior is known if there are wiring issues.

DS3234 + ESP12F_Relay_X1 board: "RTC lost confidence in the DateTime!" · Issue #120 · Makuna/Rtc · GitHub also says the same.

Per Set RTC to compile time, but RTC not retaining time after power cycle. - #2 by mrburnette - Programming Questions - Arduino Forum this might be a hardware issue.

Ego booster: You are awesome and I can’t connect wires. Hahaha

The device is not mistrusted but datetime is wrong. The module gives the time below:

0/0/2000 : 0:0:0