0

I am trying to retrieve the current timestamp (or simply a date/time pair) using the ESP8266-01 WiFi module wired up with an Arduino Uno rev 3. To do this, I must not program directly the ESP8266, but instead I have to program the Arduino in order to communicate with WiFi module, send a request to a server (e.g. to nist.time.gov) and receive the response with the date and time value.

After many researches on the web, I am not able to achieve this stuff. Does anyone, please, could help me? Any suggestion or code snippet would be very appreciated.

Thanks in advance!!

Filippo

TomServo
  • 7,248
  • 5
  • 30
  • 47
  • What code have you tried exactly? 1 minute of googling leads me to NTP client examples like https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino, https://github.com/gmag11/NtpClient, which can be easily ported to the Arduino using an ESP8266. – Maximilian Gerhardt Jun 27 '17 at 21:24
  • First of all, thanks for the reply, I found many codes like the one you posted but they were all based on directly program the ESP8266 module and they used, for example like in the code you linked, the ESP8266WiFi.h or WiFiUdp.h libraries that strictly depends on the ESP8266. Since I must program the Arduino I cannot use them. – Filippo Damuzzo Jun 27 '17 at 21:28
  • You may want to look at the https://github.com/itead/ITEADLIB_Arduino_WeeESP8266 library. It does the serial communication to the ESP8266 and has nice handler functions for doing UDP connections. – Maximilian Gerhardt Jun 27 '17 at 21:32
  • At first sight, it seems exactly what I was looking for. I will test it very soon, thank you so much @MaximilianGerhardt!! – Filippo Damuzzo Jun 27 '17 at 21:41
  • If you write a working NTP client using that library you may want to publish the code and/or answer this stackoverflow question yourself. – Maximilian Gerhardt Jun 27 '17 at 21:54

0 Answers0