0

Does anyone know why the seconds field would be about 30,000 different between a MAC and ESP32 (Arduino) synced to the same NTP server?

I have a group of ESP32 chips with NTP clients running, and they all sync from a local Windows10 NTP server, and do so correctly. The ESP32 chips all agree, but the Mac does not.

I have an OSX Mojave machine also set to use that Windows10 NTP server as it's time serer, and have requeted updates with 'sntp -sS' successfully.

My problem is that the 'gettimeofday' values are wildly different, by about 30,000 seconds, between the ESP32 and Mac platforms.

Timezone doesn't seem to matter. I am getting this value via time.time() in Python which is supposed to call 'gettimeofday' for me.

Dave
  • 1,521
  • 17
  • 31
  • 1
    Could you edit the question to include just a snippet of the code that shows which NTP library you're using on the ESP32s, and how your'e calling it? Does the time on the Mac agree with the time on Windows? – romkey Oct 13 '18 at 23:06

1 Answers1

2

It turns out the "standard" NTP impl on the ESP32 adds a fudge factor, combined with timezone shift, that accounted for it. I modified the library not to add those, and it's working as expected.

Dave
  • 1,521
  • 17
  • 31