Ported my Arduino Mega project, “SdBrowse_CC3000_HTTPServer.ino” over to ESP8266EX based, WeMOS D1 R2 Development Board (Arduino compatible, with the exception of some libraries.)
During the porting of project martinayotte of the ESP8266 Community Forum converted two functions; listFiles and readFile functions. Along the way on the original projects there was help from Arduino.cc Forum, Adafruit Forum, Arduino Stack Exchange.
Project uses many reusable functions; logtoSD, lcdDisplay, listen, listFiles, readFile, ReadDS3231, getDateTime, getWeatherDate, updateDifference, newDay, and fileStore.
ESP8266 --Internet Weather Datalogger and Dynamic Web Server
March 30, 2017 Current Features of renamed project, "Oberservations_SPIFFS.ino". SPIFFS is the Flash meory system built-in the WiFi module on weMOS board.
Requires WeMOS D1 R2 Development Board, Real time clock (DS3231) and Barometric Pressure, Humidity/Temperature sensor (BME280).
-
Real Time Clock; used for 15 -minute time interval, date and time stamping and dayofWeek (every 0 day of the DS3231, log.txt file gets renamed to keep file size manageable. Every Saturday (0 day of week) log.txt gets renamed in the format "logxxyy" xx being the month and yy being the date; a new log.txt is created after every file renaming.
-
Dynamic web page of current observations for Last update time and date, Humidity, dew point, temperature, heat index, barometric pressure (both inches of Mercury and millibars.)
-
SPIFFS files are listed as web links; clicking link prompts for "Open with/Save as." "System~1/", "Favicon.ico", and "Access" are listed; however, they are for internal use and cannot "Opened with/Save as," result of clicking link produces "404 Page not found."
-
LOG.TXT file is appended every 15 -minutes with the latest update; storing data from Dynamic web page.
-
ACCESS.TXT restricted file that logs client IP address.
-
DIFFER.TXT stores the difference in Barometric Pressure for the last fifteen minutes. Only a difference of equal to or greater than .020 inches of Mercury are logged with difference, date and time.
-
URL file names other than ones defined in the Sketch produce "404 Page not found."
-
Audible alert from Piezo electric buzzer when there is Barometric Pressure difference of .020 inches of Mercury. I am interested in sudden drop of Barometric Pressure in a 15-minute interval. Serve weather more likely with a sudden drop. Difference of .020 inches of Mercury point is set for my observations to log and sound audible alert; not based on any known value to be associated with serve weather.
-
Two-line LCD Display of Barometric Pressure, in both inches of Mercury and millibars.
Server is a WeMOS D1 R2, Model 2.1.0 Development Board -- purchased on Ebay for ~ $ 9.00 and BME280 breakout board and DS3231 breakout board ~ $ 6.00; both are required for project. Sensor is located indoors, currently.
Experience with the WeMOS has been a very good; downloads are 15 times faster, WiFi connectivity is MUCH improved, reliability near 100% thanks to on-board watch dog timer (which, is enabled by default.), WiFi interference is a non factor --gone.
WiFi Client/Server Based --ESP8266
Domain Hosted, WiFi Client.Server Based --ESP8266
Check out the SPIFFS Files link; select a file and time the download!
Update: August 2, 2017
New update; RTC DS3231 replaced with NTP Time server and Timezones applied by "zoomx" of Arduino Forum.
William
Observations_SPIFFS.zip (8.83 KB)
NTP Observatons_SPPIFFS .zip (15.8 KB)