Post topics, source code that relate to the Arduino Platform

User avatar
By mobzero
#76958 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.
User avatar
By mobzero
#76991 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.
User avatar
By QuickFix
#77025 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?