[SOLVED] How long does it takes to get Time from RTC Widget?

Hello,
I am working on a complete Home Automation project.

I am doing 6 times “Blanc.syncAll()” in 1 minute, but it takes at least 5 to 6 minutes to get the time & date right…

Is it normal ?

Thanks for your help,

Alain

It depends a lot. I’ve seen it go in 2 seconds but also 5 minutes before synchronization. I haven’t found out why that is though.

The RTC widget uses Paul Stoffregen’s time library at https://github.com/PaulStoffregen/Time

He has the following function:

setSyncInterval(interval); // set the number of seconds between re-sync

Play around with this but ensure you are connected to the Blynk server first.

Blynk.begin(auth) should always be followed by a while statement to ensure you are connected before proceeding with your sketch.

1 Like

If it helps, I use something like to keep time activities from happening until RTC is right:

if (year() != 1970)
  {
    // This won't happen until RTC is set.
  }

The volume of things that you’re syncing might be an issue… if it’s more than 2. That issue affected RTC for me.

1 Like

Hello,

Well, actually, I hadn’t put the “While” Loop to wait for connection…

Now I made the correction, it is instantaneous…

Always RTFM !!!

Thank you all,

I will put the status as SOLVED…

Alain

actually the FM doesn’t really mention it and many of the stock (ethernet) sketches provided by Blynk don’t include the vital while statement.

Glad you got it running.

what is RTFM ? :slight_smile:

Read the F…ing Manual, (F for Fantastic in Blynk’s case).

:slight_smile: I can’t believe i missed that !