ESP2866 - RTC update

First timer…
Built a little project, ESP2866 LED clock that links to get time from an NTP server - all works OK.
Next, is to try the same project, but with a DS3231 RTC. This is easy enough, but, I would like to update (correct) the time ( when the DS3231 drifts over a period of time) from an Android based cell phone - (Samsung).
Possible via Blynk??
Hope you can assist!


Not exactly possible as you describe, but you can get the current UTC time from the Blynk cloud server.
Using the Time library and a time zone library you can easily convert that to your current local time.


It is not clear to me, what do you mean. If your device with RTC module can connect to internet, you definitely can correct your RTC any time you want, either with or without Blynk. Please, explain your idea, how your Samsung would be involved.

Thanks for the replies.
As the project currently is, there is continuous internet access, and the time is updated constantly, and it works fine!
If I give the clock as a gift to somebody else, my sister who stays at a University res, I need to know the SSID and the password, and due to internet security at University, they change the password very often. This leads to the clock either to stand still, or if it has a RTC standby, it will continue running until the time eventually goes out of synch with the real time.
Therefore, the need to update the time from a mobile phone (android) to kick the clock in synch every now and then. Because the clock only display hours and minutes, it requires update every few months!
That is why I wondered if Blynk can do this.
Is there any other app, that you suggest I try to achieve this - if Blynk as suggested by PeteKnight, can’t do this.
Thanks for the info thus far.

The solution could be to set up WiFi AP (share internet from your phone) for predifined value. Such as AP name = “clock”, password = 12345. In setup of your device you can add possibility to check, whether this AP is turned on, and if so, correct RTC via NTP. So, to correct your time you should turn on your mobile phone the same AP, reset your clock (turn off/on), wait few seconds to correct RTC, then turn off mobile phone AP. Not a great problem to do it once a month. Disadvantage - you have do this correction manually.

Simply use a RTC DS3231. The onboard 3.3v cell will keep the time ticking. The cell will eventually die ! In about 5yrs or so.

As you have stated above the time does not drift as much as you think. Its almost precise. I have been using it for many years for now, without having to set time.

If you use Blynk IoT with the Edgent WiFi provisioning functionality then it’s very easy to update the WiFi credentials whenever they change.

As @Alegz suggested, you could also use the phone’s hotspot to access an NTP server, so Blynk wouldn’t be required at all.


Thanks guys.
I played with a led matrix clock using a Huidu Technology, Single-dual Color Controller HD-W03 - a really cheap controller card that drives a dot matrix led display.
They also have an App - called LEdArt, whereby you can send the time with a click on the cellphone, or dim the clock, etc.
I was just looking for something similar, using Blynk.
I am aware that I can use the cell as a hotspot (tether) to access the a NTP server, but this takes a bit of data continuously which is not ideal.
I suppose I can do this NTP update once a day, but then the phone has to be there at that specific time, which is not guaranteed.
I suppose I can do the update on the hour, to save data.
Sorry about the advert for Huidu tech though - I am in no way connected to them.
Regarding the battery back-up, I thick these units are extremely accurate, but if for some reason seconds are added (which is not required for the project), it will drift quicker!
Thanks guys - appreciate your replies and input.

But you’d only need to do it once per month at the most, then only for a few seconds.

You could do an NTP update whenever a WiFi connection is established, and you don’t need to do it every day!

Have you actually looked in to the accuracy of clocks in MCUs and hardware RTCs?

Personally, I think you’re creating problems where there are non. You don’t need Blynk, unless you want to use it to set alarms etc, but then you’d need a constant WiFi signal.


Thanks all - at least I learn something about Blynk - switch an LED on and off with the ESP2866 via the app.
Now for a bit of a deeper dive in the Blynk mysteries.

I have played with the RTC - best accuracy was 28 seconds in a month - without temperature control - amazing accuracy for the price!