RTC time in RTCTimeWidget seems skewed by ~53 seconds on esp8266

esp8266/nodemcu/Arduino + Blynk 0.5.1, http, wifi to Blynk cloud
I have not added code, as my sketch seems to work fine:


String currentTime = String(hour()) + ":" + minute() + ":" + second();
Serial.println(currentTime);

… yields a somewhat flat formatted timestring, but it works, as I have set up a rtc widget and added the widget to my project.

I can Serial.println it fine, and everything works… except that the time seems to be 53 seconds behind. I get fine responses if I change timezone in the widget on the phone, so it’s also connected fine.

I have my own ntp server, and comparing against that as well as some public, it seems that there’s a esp8266/Blynk problem with time Sync - or - that the timeserver responsible for the RTC sync in Blynk Cloud is lagging ~53secs behind.

Could you please verify that the time server for Blynk is in sync, or advise on why I might get this rather large skew?

1 Like

Darnit @Dmitriy did you forget to fuel up the atomic clock again? :atom_symbol::alarm_clock:

@nzdk You could be simply looking at the effects of internet lag with the cloud servers (yes, there are more than one in the world) and differing time zones, etc. If you need sub minute precision, then Local Server might be your best option.

I have 22-23 ms to Blynk cloud server I’m connected to.

I’ve never ever heard of a consistent, non fluctuating, ~53000 ms skew in time as a result of 23 ms rtt, and time zones are not 53 second adjusted. :slight_smile:

All other commands to/from the server happens within less than a second; based on me toggling a switch, receiving it on the esp8266, immediately writing it back to another virtual pin connected to a LED widget - it happens almost instantly. :slight_smile:

I’m guessing that ntpd/openntpd/timedatesyncd etc is not running on that server I’m connected to. :slight_smile:

The whole point for me was to get a somewhat reliable to within a few seconds, which are orders of magnitude larger than using NTPclient in Arduino, easily from Blynk.

Looking forward to Dmitriy’s response. :slight_smile:

Thanks,
Martin

@nzdk I’m guessing it’s simply a case of the Blynk server being 53s slow or fast.

Interested to know what kind of project is sensitive to 53s?

@nzdk thanks for reporting. This is actually the issue with one of our servers. I’ll check.

So… almost like this after all :stuck_out_tongue_winking_eye:

1 Like

That’s actually interesting. I have one clue about it.

@nzdk fixed. Could you please verify?

2 Likes

i can confirm it is ok now. i had the same issue, the rtc lagged behind some 50 seconds. but now it is within ~2 seconds, that is acceptable for me.

thanks!

it is clearly not about project sensitivity, just “good practice”. with the current technology and networks it is a basic expectation that the clocks should be in sync within 1-2 seconds precision.

nearly 1 minute difference clearly indicates some issue / not proper configuration. we had this problem on our local server too. there was some obscure linux settings.

@Dmitriy it is accurate now! Thank you very much!