-->
Page 1 of 1

Arduino Mega + ESP8266-01 How to get Date via AT commands?

PostPosted: Mon Jul 09, 2018 8:47 am
by mobzero
Hi everyone.

I'm using the analog Pins of Arduino Mega to read voltage, current and power values. Next step is to save this information in a SD Card (done) and also send it to a webserver, with an ESP8266-01, via AT commands (also done).

Now i wanna save the timestamp of each readed value so i can analyse the data if the wi-fi signal is lost, without using any external clock.

My idea: ask a website for the time and receive a string with the date and hour like: Mon, 09/07/2018, 14:40. Any suggestion for this problem? I've tried to find similar problems but can't find any solutions.

Thanks.

Re: Arduino Mega + ESP8266-01 How to get Date via AT command

PostPosted: Wed Jul 11, 2018 12:09 pm
by mobzero
Hello again everyone,

I found in the latest ESP8266 Instruction Set that there are 2 AT commands to get the time via NTP (Network Time Protocol).

After upgrading my ESP, it finally recognizes both commands: "AT+CIPSNTPCFG" and "AT+CIPSNTPTIME". The problem is that the returned data is always:
Code: Select all+CIPSNTPTIME:Thu Jan 01 00:00:00 1970


Any suggestion? Thanks.

Re: Arduino Mega + ESP8266-01 How to get Date via AT command

PostPosted: Fri Jul 13, 2018 10:12 am
by QuickFix
And you are sure you were able to configure the time-zone and servers before querying the time?
Eg.:
Code: Select allAT+CIPSNTPCFG=1,2,"nl.pool.ntp.org ","cn.pool.ntp.org ","us.pool.ntp.org"


And what does it tell you when you query the configuration:
Code: Select allAT+CIPSNTPCFG?