Notifications
Clear all

InqWeather - Forecasting Weather Station

68 Posts
8 Users
24 Likes
3,343 Views
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

"Prob' bly rain" Eeyore talking to Winnie-the-Pooh

For your project building enjoyment and to keep you out of the rain... I would like to offer, InqWeather.  It is an ESP8266 web-server that you can connect to your home router.  From any device on your LAN, you can get the current Temperature, Humidity and Atmospheric Pressure.  It now has a twelve hour weather forecasting ability based on the Zambretti algorithm, reputed to be better than 90% accurate if properly calibrated to its location.

Electronic Components Required

  • ESP8266 - Preferably a WeMos or NodeMCU
  • BMP180 - Pressure / Temperature Sensor.  With minor program changes a BMP280 can be substituted.
  • AHT10 - Humidity / Temperature Sensor.  I no longer recommend the DHT11 or DHT22.  My students seemed to have an extremely bad record using these.  Not to mention, the AHT10 is more accurate and cheaper than either.
  • A power supply like an old Micro USB adapter for your phones.

 

I usually buy in batches of 10pcs and all the above can be had for under $6 on Amazon.  In singles, somewhat more.

image
N
z
History 100 AHT10

The server is written in Arduino INO and C++.  The clients are written in generic HTML, CSS and JavaScript.  The server spits out metric units as that is the standard used by these sensors.  The canned client that comes with the example is configured for Imperial units as you can see above. 

Personal Customizations

  • It is simply a matter of commenting out a few lines in a JavaScript file and replacing some unit descriptions and you'll have a metric version. 
  • All labels and weather forecast descriptions are written in the same JavaScript file and can easily be changed for localization in any language of your choice. 
  • The Zambretti weather forecasting algorithm calculates 1 of 26 different weather conditions.  Images of your own creation can be uploaded for any or all of the 26 conditions as long as they'll fit on the 3MB file system available on your ESP8266 server.  The project and libraries also support the WeMos Mini Pro which allows a more generous 15MB file system, if you feel your creative juices are being constrained.  
  • The text can also be color-coordinated to your images for each of the 26 different weather conditions.

 

I hope you like my weather station and possibly give it a try for yourself. 

VBR,

Inq

 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Duce robot and Valerio reacted
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6930
 

@inq I will definitely be building that, my store bought unit suffered a big old fat hand on it's screen and it broke.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  
Posted by: @zander

@inq I will definitely be building that, my store bought unit suffered a big old fat hand on it's screen and it broke.

InqWeather isn't "big-old-fat-hand" proof.  But... they are cheap, so you can have backups.  🤣 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Ron reacted
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@inq

Posted by: @inq

"Prob' bly rain" Eeyore talking to Winnie-the-Pooh

For your project building enjoyment and to keep you out of the rain... I would like to offer, InqWeather.  It is an ESP8266 web-server that you can connect to your home router.  From any device on your LAN, you can get the current Temperature, Humidity and Atmospheric Pressure.  It now has a twelve hour weather forecasting ability based on the Zambretti algorithm, reputed to be better than 90% accurate if properly calibrated to its location.

Electronic Components Required

  • ESP8266 - Preferably a WeMos or NodeMCU
  • BMP180 - Pressure / Temperature Sensor.  With minor program changes a BMP280 can be substituted.
  • AHT10 - Humidity / Temperature Sensor.  I no longer recommend the DHT11 or DHT22.  My students seemed to have an extremely bad record using these.  Not to mention, the AHT10 is more accurate and cheaper than either.
  • A power supply like an old Micro USB adapter for your phones.

 

I usually buy in batches of 10pcs and all the above can be had for under $6 on Amazon.  In singles, somewhat more.

image
N
z
History 100 AHT10

The server is written in Arduino INO and C++.  The clients are written in generic HTML, CSS and JavaScript.  The server spits out metric units as that is the standard used by these sensors.  The canned client that comes with the example is configured for Imperial units as you can see above. 

Personal Customizations

  • It is simply a matter of commenting out a few lines in a JavaScript file and replacing some unit descriptions and you'll have a metric version. 
  • All labels and weather forecast descriptions are written in the same JavaScript file and can easily be changed for localization in any language of your choice. 
  • The Zambretti weather forecasting algorithm calculates 1 of 26 different weather conditions.  Images of your own creation can be uploaded for any or all of the 26 conditions as long as they'll fit on the 3MB file system available on your ESP8266 server.  The project and libraries also support the WeMos Mini Pro which allows a more generous 15MB file system, if you feel your creative juices are being constrained.  
  • The text can also be color-coordinated to your images for each of the 26 different weather conditions.

 

I hope you like my weather station and possibly give it a try for yourself. 

VBR,

Inq 

Question... Do you expect to profit off your library advertisements here?
If not, then why is your code not open source?


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

I volunteer in my community in several ways.  One, is to teach classes in IoT, smart device type projects at my local library and community college.  I do it mainly to find peers of common interest.  I, like many engineers and software developers, am rather introverted.  I also do it to push myself out of my comfort zone.

 

I only use the ESP8266 in my classes.  I have several main reasons for this.

  1. Besides it being more powerful, more memory, more this or that, it is inexpensive.  Where I live now, where many students can't afford a computer, this is paramount to entry.  I know just how lucrative a career in software development is and how easy that path is to achieve.  It opens doors to a certain group of students that have no other avenues in this area.
  2. The WiFi opens more possibilities - for projects and for career opportunities.  IoT is what games were in '80s.
  3. Simplification and Price (again) - Any project with a true Arduino is hamstrung.  To see what it is doing, you either have to keep the IDE tied to it or use some complex (and expensive) set of wires, components and drivers to change things and see results.

That is what forced me to start the InqPortal library in 2017.  I was tired of writing boiler-plate and wiring for pid'ln 4x20 displays, LED's, pots and buttons on-every-single-project.  Doing it with a web interface is easier, cheaper, frees up valuable limited resources on the controller and is instantly reproducible. 

Since retirement and and later, Covid, I've had plenty of time to refine it.  At some point, I felt it was good enough to share with my local Maker's Group and see how beginners learned with it.  I was encouraged to open it to a broader audience.  Again, it pushed my boundaries learning how to get and publish a website, learn Wordpress and write English (which I loathe - as opposed to C++).  I've started opening it to several forums of more seasoned programmers.  Again, I try to focus on the beginners as I feel it will simplify and empower them and their projects to reach for the next rung.  

InqWeather

In my introductory class, I wanted something more advanced.  Let's face it, no light-bulbs go off with the LED blink project.  The InqWeather project has all the basics in one project that are necessary to master.

  1. Uses secondary components.
  2. Simple wiring - It only has four wires.  That is very hard to screw up.  But it still happens.
  3. Protocols - I2C
  4. Connectivity - Routers are alien to this group.  Explaining SoftAP vs StationAP is a challenge.
  5. Client/Server, Web development and generalities applicable to IoT
  6. Variables - working variabls versus persisted variables, versus published variables.  Published is the term I use to explain a variable that is usable and/or changeable from the browser client.  InqPortal takes all the pain of dealing with the logistics of making the browser "feel" like it is directly changing the variable in the Sketch.
  7. It creates data.  
  8. It stores data.
  9. It uses old time-based data stored to make current calculations.
  10. It self adjusts to its conditions - IOWs it is a very rudimentary learning program.
  11. It introduces web development - HTML, CSS and JavaScript.
  12. It introduces topics for decisions like where to put logic - server or client.  Metric vs Imperial units, Localization.
  13. Its allows me to do all the above at a high-introductory-level without having to teach down in the details - Like programming in C++ or JavaScript. 
  14. But most importantly, at the end of the project - the student has a project that can go home and actually be useful.

 

I think it is the perfect educational project.

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@inq I volunteer in my co

Posted by: @inq

I volunteer in my community in several ways.  One, is to teach classes in IoT, smart device type projects at my local library and community college.  I do it mainly to find peers of common interest.  I, like many engineers and software developers, am rather introverted.  I also do it to push myself out of my comfort zone.

 

I only use the ESP8266 in my classes.  I have several main reasons for this.

  1. Besides it being more powerful, more memory, more this or that, it is inexpensive.  Where I live now, where many students can't afford a computer, this is paramount to entry.  I know just how lucrative a career in software development is and how easy that path is to achieve.  It opens doors to a certain group of students that have no other avenues in this area.
  2. The WiFi opens more possibilities - for projects and for career opportunities.  IoT is what games were in '80s.
  3. Simplification and Price (again) - Any project with a true Arduino is hamstrung.  To see what it is doing, you either have to keep the IDE tied to it or use some complex (and expensive) set of wires, components and drivers to change things and see results.

That is what forced me to start the InqPortal library in 2017.  I was tired of writing boiler-plate and wiring for pid'ln 4x20 displays, LED's, pots and buttons on-every-single-project.  Doing it with a web interface is easier, cheaper, frees up valuable limited resources on the controller and is instantly reproducible. 

Since retirement and and later, Covid, I've had plenty of time to refine it.  At some point, I felt it was good enough to share with my local Maker's Group and see how beginners learned with it.  I was encouraged to open it to a broader audience.  Again, it pushed my boundaries learning how to get and publish a website, learn Wordpress and write English (which I loathe - as opposed to C++).  I've started opening it to several forums of more seasoned programmers.  Again, I try to focus on the beginners as I feel it will simplify and empower them and their projects to reach for the next rung.  

InqWeather

In my introductory class, I wanted something more advanced.  Let's face it, no light-bulbs go off with the LED blink project.  The InqWeather project has all the basics in one project that are necessary to master.

  1. Uses secondary components.
  2. Simple wiring - It only has four wires.  That is very hard to screw up.  But it still happens.
  3. Protocols - I2C
  4. Connectivity - Routers are alien to this group.  Explaining SoftAP vs StationAP is a challenge.
  5. Client/Server, Web development and generalities applicable to IoT
  6. Variables - working variabls versus persisted variables, versus published variables.  Published is the term I use to explain a variable that is usable and/or changeable from the browser client.  InqPortal takes all the pain of dealing with the logistics of making the browser "feel" like it is directly changing the variable in the Sketch.
  7. It creates data.  
  8. It stores data.
  9. It uses old time-based data stored to make current calculations.
  10. It self adjusts to its conditions - IOWs it is a very rudimentary learning program.
  11. It introduces web development - HTML, CSS and JavaScript.
  12. It introduces topics for decisions like where to put logic - server or client.  Metric vs Imperial units, Localization.
  13. Its allows me to do all the above at a high-introductory-level without having to teach down in the details - Like programming in C++ or JavaScript. 
  14. But most importantly, at the end of the project - the student has a project that can go home and actually be useful.

 

I think it is the perfect educational project.

VBR,

Inq

I am assuming that you are addressing me, however I am not sure, as you have not referenced me directly.  If you are however, can you please answer my question as to why your code is not open source?

What do you expect to achieve by presenting your code here?
I.e:- What is your goal?


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

@frogandtoad 

Actually you assume wrong.  I was writing that post when yours came in.  I am in the process of addressing your question and it will be placed in the appropriate InqPortal thread.  This InqWeather project is open-source.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

The last lengthy post (of mine) was mainly to explain how I write.  I am writing for people that have never touched an IDE.  Understand, I am not talking down to you, but things obvious to you are totally alien to my common student.  I try to tell them why something is the way it is... not just handing them a cookbook.

Hardware Assembly

The hardware is easy.  I use a picture to avoid the discussion of schematics or Fritzing.  There are many pressure and humidity sensors out there.  You can substitute anything you like knowing you'll likely need some code changes.  The BMP280 seems to now be cheaper than the BMP180 used here.  The BME280 senses all three items (Temperature, Pressure and Humidity) and you can eliminate the AHT10 sensor if you're using one.  As mentioned above, my class has lots of troubles with DHT11 and DHT22 sensors, but they do work some of the time.  If your using anything different, I or someone else here will be able to help you.

InqWeatherWiring

Before wiring up your parts, it is very IMPORTANT to note the positions of the two sensors.  The locations as shown in the picture show that each wire is going to the same labeled pin on both sensors.  This is only possible because the sensors I sourced happen to be mirrored.  If yours are not, you may need to use more wires and set them up in different sections of the breadboard.

We are taking advantage of the fact that the protocol (I2C) we are using to talk to these sensors allows us to talk to each one independently even though they are on the same pair of wires (network).

ESP8266 3v pin => VIN pins of both sensors.  (red wire in picture)
ESP8266 G pin => GND pins of both sensors.  (black wire)
ESP8266 D1 pin => SCL pins of both sensors. (yellow wire)
ESP8266 D2 pin => SDA pins of both sensors. (orange wire)

 

 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech and Ron reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Libraries

All libraries needed for this project are available on the Arduino IDE Library Manager.  If you are using the same sensors listed above, you need to download the following libraries for the Sketch to compile.  If you are using different sensors, you'll need to get the appropriate ones.  Just put the sensor in the search box and the library given below.

  1. BMP180 - Adafruit BMP085 Library
  2. AHT10 - Adafruit AHTX0
  3. InqPortal - InqPortal

The InqPortal library uses a feature in the Arduino Core library that will be available in version 3.1.0.  Unfortunately, they have only published 3.0.2, but there is a patch for this.  I will not affect any other functionality of you IDE.  You will find directions here: https://inqonthat.com/arduino-ide-configuration-for-windows/#Patchhttps://inqonthat.com/arduino-ide-configuration-for-windows/#Patch

Arduino IDE Settings

Probably don't need to elaborate on these, you probably already know how to set up you board, but for completeness.

  • InqPortal is small enough so you can use the Flash Size that gives you the maximum file system size:  4MB (FS:3MB OTA:~512KB).  - You will still be able to use the built-in OTA ability of InqPortal.
  • Erase Flash should be set to All Flash Contents so that you clear the flash regions where the file system and configuration data will go.  
image

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@inq 

If someone doesn't want to use it because they can't easily look into the black-box, they are welcome to move to some other solution or write their own.

Risky business to use code that only one person can maintain or modify. What if they die?

 


   
Ron reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Loading the Project

InqWeather is one of the examples that comes with the library.  Use the IDE menu item:  File / Examples / InqPortal / InqWeather - it is down near the bottom.

ChangesYou may need or might want to make

  • If you have different sensors, you'll need to change out their includes and possibly the logic.  If you need specific help, give a shout.
  • YOUR_SSID and YOUR_PW - Around line 21, you can enter your SSID and password for your home router.  If you use this method it will make it easier to just connect, but if you leave it NULL, you will need to configure it in the Admin. - Full instructions for connecting to the Built-In access point are given here: https://inqonthat.com/inqportal-bare-essentials/

Ready to Compile

  1. Open up you Serial Monitor and set its baud rate to 74880 baud
  2. And press the Upload button

... and this is what you should see in your Serial Monitor.

image

This shows a configure InqPortal based project up and running.  Follow the directions on the screen to connect to the Built-In router OR if you configured your home router, go directly to browsing the using: http://InqWeather/Admin.html

You'll be opening the Admin and will see something like this:

SetTab

This is your webserver.  You can load any web content you like (as long as it fits on the 3MB file system).

Upload Your Client Applications

  1. Click on the Files tab of the Admin.
  2. This is your server's File Manager.
  3. Open your Windows (or equivalent) File Explorer and find your Sketch folder, you'll find a data folder under it with all your client application files... the front-end GUI at the top of this thread.
  4. Select them all and drag and drop them on your server's File Manager.
  5. You'll see them upload and finally, you should see...
image

Run the Client

The way you will normally access a web page in your browser is by it address and filename.  The most common one to use in this project is: http://InqWeather/changing.hml

N

Calibration

All the above is related to building and managing your InqPortal based project.  InqPortal doesn't need Calibration.  That is totally for the InqWeather weather portion of the project and is specific to where you live.  Here is the instructions for calibrating your InqWeather to get it working for you altitude and normal conditions. - https://inqonthat.com/inqweather/

Let me know if you need clarification on anything or if we need to go into more details about any aspect... server management, other tabs, capabilities, limitations, or InqWeather and what calibration is all about or the Zambretti algorithm... 

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  
Posted by: @robotbuilder

@inq 

If someone doesn't want to use it because they can't easily look into the black-box, they are welcome to move to some other solution or write their own.

Risky business to use code that only one person can maintain or modify. What if they die?

 

Well, if you already have the library and it works and you get used to using it, it will continue to work.  There are no expiration clauses in it.  But, I'll put it in my Will and my son can put it in Open-Source.  🙂 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Ron and Inst-Tech reacted
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@inq

Posted by: @inq

@frogandtoad 

Actually you assume wrong.  I was writing that post when yours came in.  I am in the process of addressing your question and it will be placed in the appropriate InqPortal thread.  This InqWeather project is open-source.

OK, thanks for clarifying... I will check it out.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@inq

Posted by: @inq
Posted by: @robotbuilder

@inq 

If someone doesn't want to use it because they can't easily look into the black-box, they are welcome to move to some other solution or write their own.

Risky business to use code that only one person can maintain or modify. What if they die?

Well, if you already have the library and it works and you get used to using it, it will continue to work.  There are no expiration clauses in it.  But, I'll put it in my Will and my son can put it in Open-Source.  🙂 

I'm a little confused now, as in answer to my earlier question, you stated:

@frogandtoad 

Actually you assume wrong.  I was writing that post when yours came in.  I am in the process of addressing your question and it will be placed in the appropriate InqPortal thread.  This InqWeather project is open-source.

Is there another library specific to InqWeather where one can see the code?

Otherwise, how do we interpret your answer?


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  
Posted by: @frogandtoad
 
Is there another library specific to InqWeather where one can see the code?  Otherwise, how do we interpret your answer?

In five years and four forums, you are the ONLY person who has ever had troubles with this concept, so you might take the "we" out of your posts.  You do not speak for the majority of people.  Any program everyone writes (especially any WiFi based) on an ESP8266... is based on libraries.  Espressif is closed-source.  lwIP is mostly open-source, however, Espressif has taken it and modified it with changes they needed to make it work on the hardware.  That is not published.  The Arduino Core rides on top of the Espressif libraries.  WiFi, various web servers, file systems, and other libraries ride on top of the Arduino Core or Espressif libraries directly.  

InqPortal - Is a closed-source web server library written using Espressif libraries.  It does not use the Arduino Core libraries such as ESP8266WiFi.h, ESP8266WebServer.h, LittleFS.h, and EEPROM.h.  It is a web server with integrated, browser based GUI Admin.  InqPortal also provides a WiFi connections manager, file system, file manager, logging sub-system and application API that incorporates web sockets communications.  The app API abstracts away the communications so the library user can simply change Sketch variable in their Sketch code  and they propagate to their client-side, browser-based apps.  Changes made on the client-side app transparently change the Sketch variables.

InqWeather - Is an open-source project that uses InqPortal and other open and closed libraries.

In the amount of time you have spent writing your inflammatory jabs, you could have easily tried InqPortal out and see if it is useful to you... or not.  https://inqonthat.com/inqportal-the-three-line-promise/

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech, byron and Ron reacted
ReplyQuote
Page 1 / 5