BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk RTC setSyncInteval

I have a question if you have the RTC widget and in your setup you have setSyncInterval(86400); what happens if the time has come for the sync and you are offline?

Nothing. The device is offline, so it can’t synchronise with the server.

Presumably you have a BLYNK_CONNECTED callback that handles RTC sync, so your device will synchronise the RTC again as soon as it comes back online.

Pete.

Yes. I do

I have rtc.begin(); in the BLYNK_CONNECTED. Is that what you mean or is there another command for rtc sync?

What you have is correct according to this:

Pete.

@PeteKnight just a quick question do we actually need the “setSyncInterval” ? In my case the internet drops at least once a day so the BLYNK_CONNECTED callback is called at least once a day which is more than enough for me anyway for syncing my RTC.

The internal clock on most MCUs is pretty accurate, at least to a few seconds per day. Unless you’re wanting super critical timing (and don’t forget that it’s the Blynk server time that is being used, so not guaranteed to be exactly the same as your local time) so you could probably go weeks without synchronising the RTC and never notice any difference.

Pete.

1 Like

I’ll mark this topic as closed, as I think your question is answered.

Pete.

Thanks