Go Down

Topic: Rain Gauge with Data Logger and more... (Read 4032 times) previous topic - next topic

Techno500

#15
Sep 30, 2019, 09:21 pm Last Edit: Mar 05, 2020, 08:22 pm by Techno500
9/30.2019

Finished "variableInput.h;" which is a new include file with options requiring editing are available in one file!  No more hunting occurrences throughout the code.  Be sure to copy "variableInput" folder to your library folder!

Upload "Rain_Gauge_Two.zip" contains:  Sketch "Rain_Gauge_Two.ino," library folder, "variableInput", PHP file for use on a Domain hosted website "dataCollector.php," and "README.TXT."

ESP32 Project; ESPAsyncWebServer based 

ESP32 Project; ESPAsyncWebServer, Domain Hosted web site 



William

zoomx

Hello William,

you can put variableInput.h in the sketch folder, I believe that it's more simple since you can edit the file inside the IDE.

rockwallaby

Hello William,

I notice on your rain gauge two project a few things I thought to comment on.
On the main page, you have temperature in degrees Celsius, whereas on the graph it is something else with no units.

The Humidity should be stated as Relative Humidity and again on the graph as well together with % as units.
Generally and typically, relative humidity sensors are not so accurate to less than ±1%, within the typical operating band, and worse outside than band. So little point in showing fractional parts for % rh.

On the main page, you have barometric pressure as metric, well sort of, it is hPa, not hpa, but not on the graph page. Generally, with barometric pressure in hPa, you only need to represent whole units. Check the resolution of the sensor being used as a guide.

For the rain, you should express it as mm per unit time, so for example, it should read 5mm/day, not 5 day/mm.

With your latitude and longitude, is it north or south and east or west ?
I notice your elevation changes with updates, that's interesting. I imagine that should be fixed.

The link you provide in post #8 does not work: ESP32 Server
And again in your post #12: Website for ESP32 project

Will be looking forward to seeing the project progress.
Paul - VK7KPA

Techno500

#18
Oct 31, 2019, 01:09 am Last Edit: Mar 03, 2020, 04:04 pm by Techno500
Quote
Hello William,

I notice on your rain gauge two project a few things I thought to comment on.
On the main page, you have temperature in degrees Celsius, whereas on the graph it is something else with no units.

On main page temperature now reads in degrees Fahrenheit.  Graphs have been re-labeled to match units on main page.

Quote
The Humidity should be stated as Relative Humidity and again on the graph as well together with % as units.
Generally and typically, relative humidity sensors are not so accurate to less than ±1%, within the typical operating band, and worse outside than band. So little point in showing fractional parts for % rh.
Did not like the graphing with whole units. 

Quote
On the main page, you have barometric pressure as metric, well sort of, it is hPa, not hpa, but not on the graph page. Generally, with barometric pressure in hPa, you only need to represent whole units. Check the resolution of the sensor being used as a guide.
Change Barometric Pressure units to inches of Mercury (inHg.).   Corresponding units on BP graph are inHg.   Graphing is for visualization of observer weather data; not intended for precise measurements.  Data only gets updated every fifthteen minutes; using few digits to left of decimal produced an undesirable graph IMHO.

Quote
For the rain, you should express it as mm per unit time, so for example, it should read 5mm/day, not 5 day/mm.
Rain measurement readings are taken for Day, Minute, and Five Minute interval.

Quote
With your latitude and longitude, is it north or south and east or west ?
I notice your elevation changes with updates, that's interesting. I imagine that should be fixed.
GPS Data is presented the same as it comes off the NEO m8n module.  Decimal coordinates may be used directly in "Google Maps"

Quote
The link you provide in post #8 does not work: ESP32 Server
And again in your post #12: Website for ESP32 project
Links have been corrected:

ESP32 Project, ESPAsyncWebServer based 

ESP32 Project, Domain Hosted web site

Appreciate the feedback rockwallaby.

William



Techno500

#19
Nov 10, 2019, 02:01 pm Last Edit: Mar 03, 2020, 04:05 pm by Techno500
Will soon be posting a new, version of "Rain_Gauge_Two_.zip."  ESP32, Open Source project. 

I am in the testing stage of my project.  Would like to see how it responds to visitors, before posting the code.   

ESP32 Project, ESPAsyncWebServer based 

ESP32 Project, Domain Hosted web site
 

Project is a conversion of "Rain_Gauge_Two.zip"; WiFi Client/ Server, to an Async Web Server using: 

https://github.com/me-no-dev/ESPAsyncWebServer.


William

Techno500

#20
Nov 14, 2019, 11:29 pm Last Edit: Mar 05, 2020, 08:23 pm by Techno500
11/14/2019, Version 2.3

Project has now been coded to use the AsyncWebServer library while retaining all but one feature of the earlier versions.  OTA will now be become a standalone sketch; if needed.  All editing to setup project on your network is done in small, short configuration file:  "variableInput.h," located in the Sketch folder.

ESP32 Project, ESPAsyncWebServer based 

ESP32 Project; ESPAsyncWebServer, Domain Hosted web site

Project is Open Source.  I could not have completed this code without the help of others, commented sections of the code with reference to those that have helped with the project.    Special thanks to Pavel for his help and patience with my questions.


William

Techno500

#21
Nov 18, 2019, 07:07 am Last Edit: Mar 03, 2020, 04:07 pm by Techno500
AsyncWebServer Library

Why should you care:

Using asynchronous network means that you can handle more than one connection at the same time
You are called once the request is ready and parsed

When you send the response, you are immediately ready to handle other connections while the server is taking care of sending the response in the background

Speed is OMG

Easy to use API, HTTP Basic and Digest MD5 Authentication (default), ChunkedResponse

Easily extendible to handle any type of content

Supports Continue 100

Async WebSocket plugin offering different locations without extra servers or ports

Async EventSource (Server-Sent Events) plugin to send events to the browser

URL Rewrite plugin for conditional and permanent url rewrites

ServeStatic plugin that supports cache, Last-Modified, default index and more

Simple template processing engine to handle templates

____________________________________________

Project supports all previous features except OTA firmware updates; which if needed can be a stand alone sketch using the example from:

AsyncElegantOTA

There are six files in "Rain_Gauge_Two.zip:" index1.h, index2.h, index3.h, index4, variableInput.h, and Rain_Gauge_Two.ino.  Unzip to folder on Desktop; double click "Rain_Gauge_Two.ino" after editing "variableInput.h" for you networking requirements/credentials.  All files are required.  Index files are "templates for web pages" and contain "Placeholders" referenced in sketched "processor" functions.

New  feature; we can now restart the sketch remotely!  To restart server; send a URL request of "publicIP:LISTEN_PORT/Restart"    example URL request:  "xx.xx.xx.xx:yyyy/Restart"

ESP32 Project, ESPAsyncWebServer based 

ESP32 Project, Domain Hosted web site

Note, there is a correction factor for Barometric Pressure in the "getWeatherData" function.  Correction factor is coded in the "getWeatherData" function; correction Factor Formula is:  Relative Pressure (in millibars) equals Absolute Pressure (BME280, in millibars) plus (elevation in meters divided by 8.3).

"Rain_Gauge_Two.zip" is in the above POST.

William

mortenx

it would be nice option to send all data also to a weather serve like Weathercloud
https://www.instructables.com/id/Arduino-Weathercloud-Weather-Station/

Techno500

#23
Nov 18, 2019, 11:18 pm Last Edit: Mar 05, 2020, 08:24 pm by Techno500
mortenx

Sketch supports a dynamic web page on a Domain, hosted web server with the function "webInterface;" to use this function "dataCollector.php" needs to be uploaded to your web page files on the Domain server.  This file will create a Dynamic web page, once it has the updated Weather data.  Code "webInterface() in the loop, 15 minute routine will need to be uncommented.  

Perhaps this will inspire you to add the suggested additional feature.


ESP32 Project, ESPAsyncWebServer based  

ESP32 Project; ESPAsyncWebServer, Domain Hosted web site
Adding some addition files that should have been included in the "Rain_Gauge_Two.zip."


William

Techno500

#24
Nov 19, 2019, 12:43 am Last Edit: Mar 05, 2020, 08:25 pm by Techno500
11/23/2019

Found SPIFFS was getting corrupted; I believe by writes to the log file, while Server was sending request.  Added a flag to give priority to logging to SPIFFS.  So far, responses have been good.

Added login and OTA support; see comments in "variableInput.h."

Additional files are included in the "Rain_Gauge_Two.zip."  Files for sending data to Domain hosted web page ("dataCollector.php"),  Schematic for optocoupler ("Rain Gauge 4N25 Circuit.jpg"), Schematic for beep function ("Sonalert circuit.png"), and a couple of read me files.

ESP32 Project, ESPAsyncWebServer based 

ESP32 Project; ESPAsyncWebServer, Domain Hosted web site


William

Techno500

#25
Feb 17, 2020, 07:50 pm Last Edit: Mar 05, 2020, 08:25 pm by Techno500
02/26/2020

All links verified to be working now!

ISP forced another WAN, ip address change; so previous web links are no longer valid.   Signed up with Noip.com for "Hostnames" that hopefully will eliminate this issue.

ESP8266 Base Wifi Client/Server 

ESP32 Project, ESPAsyncWebServer based 

ESP32 Project; ESPAsyncWebServer, Domain Hosted web site
 

My apologies for the inconvenience this caused.   

Many thanks to everyone that have visited Project web pages! 



Observations-II, Hosted, Domain web page; screen capture, sketch feeding web page:  "Rain Gauge Two.ino"

Attached, "Project --Upload  Ver 2.7.zip"  current, online version of Sketch; running ESPAsyncWebServer on ESP32. "dataCollector2.php" included for sending data from project to Hosted domain web site.  Also, included Serial Monitor output confirming operation of project.

William

zoomx

Hello, William,

First link doesn't work, I get "ERR_EMPTY_RESPONSE"

Techno500

Thank you zoomx.

I think it has been remediated.  Tried it now on my cell phone and it is working.

Please try it again.  Thank you for your interest in the Project.


William

Techno500

#28
Mar 13, 2020, 06:26 am Last Edit: Mar 13, 2020, 06:34 am by Techno500 Reason: Add image
Domain Hosted web site, WiFi Client.Server Based --ESP8266 and ESPAsyncWebServer Based --ESP32  

Menu option "Observation-I" is "fed" by ESP8266, running Sketch "NTP_Web_Interface_Data_Logger.ino"

Menu option "Observation-II" is "fed" by ESP32, running Sketch "Rain_Gauge_Two.ino"

ESP32 Server is built on "Strip board" and consists of HiLetGo ESP32, BME280 senor, and NEO m8n GPS Module:



William

Go Up