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

Blynk RTC widget with RTC module


#1

I have a project running where there is a hardware RTC module. It was designed to cope with wi-fi failures and blynk outages as current time in the project is important.

The issue is that the RTC module after a few days goes a few minutes off. The more it runs, more it drifts from the actual time.

My thinking is to synch the time with Blynk widget once in a while (may be once a day) but I don’t want to remove the hardware for the reasons listed above.

The challenge is that I am already using the following code with the RTC hardware module. It syncs the RTC hardware module with the ESP board.

setSyncProvider(RTC.get);
setSyncInterval(10 * 60);

Seems like Blynk RTC widget also wants to use these and I am unsure how I can use both. Is there a way to get the time from the widget manually without the default synch with the board first and then using global hour() and minute() functions?


#2

You could try to set a different name for the Blynk RTC…

WidgetRTC rtc2;

rtc2.begin();

setSyncProvider(RTC2.get);

The timelib command setSyncInterval() might automatically work with both??

All untested… give it a try and see.