-->
Page 1 of 3

NTP, ESP8266 Time-Synced, Data Logging and Web Server

PostPosted: Sat May 05, 2018 12:12 am
by Sirquil
Updated 1/15/2019:

Obtained faster performance using sys/time.h and time.h libraries suggested by schufti of the ESP8266 Forum. Removed code related to earlier libraries and three functions related to NTP, Time keeping and UDP. Everything is working: time related functions, web pages, file listing, file downloading, and graphing! ESP8266 based website is averaging less than one second response times from client connect, serving the webpage, and client close! Response time is monitored with date/time stamping and viewing in the Serial Monitor.

More than a Data Logger; fast, downloading of files. Files are stored onboard in the SPIFFS memory. Files are listed and selectable for downloading. Both ESP8266, server and Domain, hosted website receive uploaded data every 15-minutes from the same sketch. Commented out are two features; a LCD display function and an experimental, audio beep function to alert for a predetermined difference in a 15-minute interval of barometric pressure. Have read references of serve weather associated with a sudden drop in barometric pressure; set point determined from observation and frequency of occurrences.

RobotDyn WiFi D1 ESP8266 based board that is online has been used for development of project coding; therefore, there may be gaps in the data logs! The 15-minute interval has been "spot on" every 15 minutes; awesome, since project has no RTC module!

ESP8266 based hosted website: https://bit.ly/2DDV5zV and ESP8266, Domain hosted website: https://bit.ly/2M5NBs0 no file browser added features

Restrictions of free, domain hosting service is reason there is no file browser or file downloading on the Domain hosted website.. Graphing of four, observations are available on both websites.

Thank you, for the forum and for all the help received with this Open-Source project!

William

Re: NTP, ESP8266 Time-Synced, Data Logging and Web Server

PostPosted: Sat May 05, 2018 1:12 am
by McChubby007
Sirquil wrote:...
RobotDyn WiFi D1 ESP8266 based board that is online has been used for development of project coding; therefore, there may be gaps in the data logs! The 15-minute interval has been "spot on" every 15 minutes; awesome, since project has no RTC module!
...
William

Why would it need an RTC module if it uses NTP? Without NTP the time will not be spot-on (as you call it) without an RTC module, so although your statement is correct, it is misleading (if the time drifted using NTP then the code is broken, so its awesomeness is a misnomer).
You don't have a licence statement in your code, and it still looks like something Dr. Frankenstein created, luckily 'awesome' is subjective.

Re: NTP, ESP8266 Time-Synced, Data Logging and Web Server

PostPosted: Sat May 05, 2018 8:10 am
by rudy
I downloaded it and saw that it was one long file so I didn't look at it any further. It really does help when the program is broken up into separate functional sections, each with it's own tab/file.

Re: NTP, ESP8266 Time-Synced, Data Logging and Web Server

PostPosted: Sat May 05, 2018 8:49 am
by Pablo2048
Well, this code can be easily improved - use webserver library instead of write your own (or (much better) use AsyncWebServer library). Strings can be (and has to be IMHO) moved to Flash using PROGMEM/F( decorators.