Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README Rework #204

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bafb9b1
Direct Links -> Link References
ElectronicsArchiver Apr 9, 2022
ebbf555
Formatted Header
ElectronicsArchiver Apr 9, 2022
51ed3c8
Moved Install Instructions Into Dedicated File
ElectronicsArchiver Apr 9, 2022
0d0eb17
Moved Modules Into Dedicated File
ElectronicsArchiver Apr 9, 2022
e01c31c
Moved Changelog Into Dedicated File
ElectronicsArchiver Apr 9, 2022
9eb1bee
Formatted Deprecation Notes
ElectronicsArchiver Apr 9, 2022
0c49c23
Moved Design Into Dedicated File
ElectronicsArchiver Apr 9, 2022
20ca00e
Formatted Kit Section
ElectronicsArchiver Apr 9, 2022
0bc3b3b
Adjusted Spacing
ElectronicsArchiver Apr 9, 2022
6c60ac3
Adjusted Style
ElectronicsArchiver Apr 9, 2022
56fff4f
Formatted Service Section
ElectronicsArchiver Apr 9, 2022
21c8777
Adjusted Style
ElectronicsArchiver Apr 9, 2022
55507c9
Adjusted Spacing
ElectronicsArchiver Apr 9, 2022
6d599a5
Added License Badge
ElectronicsArchiver Apr 9, 2022
c30bbd7
Formatted Changelog
ElectronicsArchiver Apr 9, 2022
6d014ba
Adjusted Spacing
ElectronicsArchiver Apr 9, 2022
c838bf6
Adjusted Style
ElectronicsArchiver Apr 9, 2022
b61d582
Formatted Design
ElectronicsArchiver Apr 9, 2022
5b7860b
Merge branch 'master' of https://github.com/ElectronicsArchiver/esp82…
ElectronicsArchiver Apr 9, 2022
87a4fc7
Formatted Modules List
ElectronicsArchiver Apr 9, 2022
eca0570
Adjusted Style
ElectronicsArchiver Apr 9, 2022
395a994
Formatted Install Instructions
ElectronicsArchiver Apr 9, 2022
01cce93
Merge branch 'master' of https://github.com/ElectronicsArchiver/esp82…
ElectronicsArchiver Apr 9, 2022
42c6fbb
Adjusted Spacing
ElectronicsArchiver Apr 9, 2022
f5a7f71
Merge branch 'ThingPulse:master' into master
ElectronicsArchiver Jan 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions Documentation/Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

# Changelog

<br>

## Version 2

**When:** `January 2020` <br>
**What:**     `Removes Wunderground Support`

<br>

### Wunderground ➞ OpenWeatherMap

*Weather Data Provider Replacement*

<br>

**Wunderground**, the weather information provider <br>
we used so far, [stopped their free tier][No Free] without notice <br>
on `May 15, 2018` .

This release adds support for `OpenWeatherMap.com` , an <br>
alternate provider with a free tier for weather information.

The `WeatherStationDemo` has been adapted to use <br>
this new **API** through the `OpenWeatherMapCurrent` <br>
and `OpenWeatherMapForecast` **REST** clients.

<br>

*Sadly **OpenWeatherMap** provides less* <br>
*information than **Wunderground** does.*

<br>

If you are missing attributes in the response docs <br>
then please contact the **[OpenWeatherMap]** team.

<br>
<br>

### OLED Library Upgrade

<br>

The **ESP8266 OLED Library** changed <br>
a lot with the latest release of `v3.0.0` .

We fixed many bugs, changed the **API** <br>
a little bit and improved performance.

This means that you might have to adapt <br>
your ***Weather Station Code*** if you created <br>
it using older `2.x.x` versions.

Either compare your code to the updated <br>
**WeatherStationDemo** or read the guide <br>
on how to **[Upgrade]**.


<!----------------------------------------------------------------------------->

[Upgrade]: https://github.com/ThingPulse/esp8266-oled-ssd1306/blob/master/UPGRADE-3.0.md
[OpenWeatherMap]: https://openweathermap.desk.com/customer/portal/emails/new
[No Free]: https://thingpulse.com/weather-underground-no-longer-providing-free-api-keys/
29 changes: 29 additions & 0 deletions Documentation/Design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

## Why A Library?

I realized that more and more the **Weather Station** <br>
was becoming a general framework for displaying <br>
data over **WiFi** to one of these pretty displays.

<br>

#### What Was Needed

However everyone would have different ways or <br>
sources for data and as such, the important part <br>
of the library would rather be the classes that <br>
fetch the data, than the main class.

<br>

#### Data Fetchers

In case you wrote a data fetcher that might be <br>
of interest to others and you would like it to be <br>
integrated in this library, simply contact me.

Otherwise you might also want to offer your code <br>
as extension library yourself and call it something <br>
like `ESP8266-Weather-Station-< Your Service >`

***We will gladly list it as third party library.***
89 changes: 89 additions & 0 deletions Documentation/Install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@

# Installation

<br>

## Arduino IDE

### Setup

Make sure you use a version of the **Arduino IDE** <br>
which is supported by the **ESP8266** platform.

Please follow the **[Tutorial]** on our website.

<br>

### Libraries

Please install the following libraries:

- `ESP8266 Weather Station`
- `JSON Streaming Parser by Daniel Eichhorn`
- `ESP8266 OLED Driver for SSD1306 display by Daniel Eichhorn`

*Please use `v3.0.0+`*

##### How To

<kbd>**Sketch**</kbd> <br>
 › <kbd>**Include Library**</kbd> <br>
 › <kbd>**Manage Libraries**</kbd>

<br>

### Preparation

1. *[Create An API Key][API Key]* for **OpenWeatherMap**.

2. Open the demo.

<kbd>**File**</kbd> <br>
 › <kbd>**Examples**</kbd> <br>
 › <kbd>**ESP8266 Weather Station**</kbd> <br>
 › <kbd>**Weather Station Demo**</kbd>

3. Insert the **OpenWeatherMap API Key**.

4. Insert your **WiFi Credentials**.

5. Adjust the location according to **OpenWeatherMap**.

`Zurich, CH`

6. Adjust the **UTC** offset.


<br>

---

<br>

## PlatformIO

### Setup

1. Choose one of the available IDE integration or the Atom based IDE.

2. Install libraries:
- `561`
- `562`
- `563`

With:

```sh
platformio lib install
```

3. Adapt the [`WeatherStationDemo.ino`][Example] file to your<br>
needs as show in the **Arduino** preparations.


<!----------------------------------------------------------------------------->

[Tutorial]: https://docs.thingpulse.com/how-tos/Arduino-IDE-for-ESP8266/
[API Key]: https://docs.thingpulse.com/how-tos/openweathermap-key/
[Example]: examples/WeatherStationDemo/WeatherStationDemo.ino

68 changes: 68 additions & 0 deletions Documentation/Modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

# Modules

*Modules Available In This Library*

<br>

## Time Client

A simple class that uses the header <br>
date and time to set the clock.

<br>

## NTP Client

A **NTP** based time class written by `Fabrice Weinberg`.

<br>

## OpenWeatherMap Client

A **REST** client for the `OpenWeatherMap.com` <br>
service, providing weather information.

<br>

## Aeris Client

A client for the service provided by `aerisweather.com`.

*Fully functional initial version.*

After the [Wunderground Incident][Changelog] we first targeted <br>
**Aeris** before we settled with **OpenWeatherMap**.

*This code is **unmaintained** but will,* <br>
*for now, remain part of this library.*

<br>

## Thingspeak Client

Fetches data from **Thingspeak** which you might have <br>
collected with another sensor node and posted there.

<br>

## Astronomy

Algorithms to calculate current lunar phase and illumination.

<br>

## SunMoonCalc

A calculator for sun / moon properties <br>
for a given date, time and location.

*This implementation is port of a* ***Java*** <br>
*class by [T. Alonso Albi] from :es: **OAN**.*


<!----------------------------------------------------------------------------->

[Changelog]: Changelog.md

[T. Alonso Albi]: http://conga.oan.es/~alonso/doku.php?id=blog:sun_moon_position
156 changes: 99 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,130 @@
# ThingPulse ESP8266 Weather Station

<div align = center>

[![ThingPulse logo](https://thingpulse.com/assets/ThingPulse-w300.svg)](https://thingpulse.com)
[![Logo]][Website]

#### A ESP8266 Weather Station

This code works best with the NodeMCU V2 ESP8266 module and an 0.96" OLED display.
To get you up and running in no time we created a kit which contains all the necessary parts:
[https://thingpulse.com/product/esp8266-iot-electronics-starter-kit-weatherstation-planespotter-worldclock/](https://thingpulse.com/product/esp8266-iot-electronics-starter-kit-weatherstation-planespotter-worldclock/)
</div>

By buying this and [other kits](https://thingpulse.com/shop/) from us you are funding maintenance and development of this library. Thank you!
<br>
<br>

[![ThingPulse ESP8266 WeatherStation Classic Kit](resources/ThingPulse-ESP8266-Weather-Station.jpeg)](https://thingpulse.com/product/esp8266-iot-electronics-starter-kit-weatherstation-planespotter-worldclock/)
<div align = right>
<img
src = https://img.shields.io/badge/License-MIT-yellow.svg
align = right
/>
</div>

### Build Status
**Development**     [![Badge Master]][Actions] <br>
**Master**    [![Badge Master]][Actions]

| Branch | Status |
| ------------- | ------------- |
| master | [![PlatformIO CI](https://github.com/ThingPulse/esp8266-weather-station/actions/workflows/main.yml/badge.svg)](https://github.com/ThingPulse/esp8266-weather-station/actions) |
| development | [![PlatformIO CI](https://github.com/ThingPulse/esp8266-weather-station/actions/workflows/main.yml/badge.svg?branch=development)](https://github.com/ThingPulse/esp8266-weather-station/actions) |

## Service level promise

<table><tr><td><img src="https://thingpulse.com/assets/ThingPulse-open-source-prime.png" width="150">
</td><td>This is a ThingPulse <em>prime</em> project. See our <a href="https://thingpulse.com/about/open-source-commitment/">open-source commitment declaration</a> for what this means.</td></tr></table>
---

## Install and configure Arduino IDE
<div align = center>

Make sure you use a version of the Arduino IDE which is supported by the ESP8266 platform. Follow the [tutorial on our documentation platform](https://docs.thingpulse.com/how-tos/Arduino-IDE-for-ESP8266/).
**⸢ [Shop] ⸥**  **⸢ [Install] ⸥**  **⸢ [Modules] ⸥**  **⸢ [Design] ⸥**  **⸢ [Changelog] ⸥**  

## Install libraries in Arduino IDE
</div>

Install the following libraries with your Arduino Library Manager in `Sketch` > `Include Library` > `Manage Libraries...`
* ESP8266 Weather Station
* JSON Streaming Parser by Daniel Eichhorn
* ESP8266 OLED Driver for SSD1306 display by Daniel Eichhorn. **Use Version 3.0.0 or higher!**
---

## Prepare the software
* [Create an API Key](https://docs.thingpulse.com/how-tos/openweathermap-key/) for OpenWeatherMap
* In the Arduino IDE go to `File` > `Examples` > `ESP8266 Weather Station` > `Weather Station Demo`
* Enter the OpenWeatherMap API Key
* Enter your WiFi credentials
* Adjust the location according to OpenWeatherMap API, e.g. Zurich, CH
* Adjust UTC offset
<br>
<br>

## Setup for PlatformIO
<div align = center>

If you are using the PlatformIO environment for building
## **[Kit][Kit]**

* choose one of the available IDE integration or the Atom based IDE
* install libraries 561, 562 and 563 with "platformio lib install"
* adapt the [WeatherStationDemo.ino](examples/WeatherStationDemo/WeatherStationDemo.ino) file to your needs (see details above)
</div>

<br>

## Available Modules
* **Time Client**: simple class which uses the header date and time to set the clock
* **NTP Client**: a NTP based time class written by Fabrice Weinberg
* **OpenWeatherMap Client**: A REST client for the OpenWeatherMap.com service, providing weather information
* **Aeris Client**: Client for the service provided by aerisweather.com. Fully functional initial version. After the Wunderground incident (see [upgrade notes](#upgrade-notes)) we first targeted Aeris before we settled with OpenWeatherMap. This code is unmaintained but will remain part of this library for the time being.
* **Thingspeak Client**: fetches data from Thingspeak which you might have collected with another sensor node and posted there.
* **Astronomy**: algorithms to calculate current lunar phase and illumination.
* **SunMoonCalc**: a calculator for sun and moon properties for a given date & time and location. This implementation is port of a [Java class by T. Alonso Albi](http://conga.oan.es/~alonso/doku.php?id=blog:sun_moon_position) from OAN (Spain).
<img
src = resources/ThingPulse-ESP8266-Weather-Station.jpeg
align = right
width = 240
/>

## Why Weather Station as a library?
This library works best with the **NodeMCU V2 ESP8266** <br>
module in combination with an `0.96"` **OLED** display.

I realized that more and more the Weather Station was becoming a general framework for displaying data over WiFi to one of these pretty displays. But everyone would have different ways or sources for data and having the important part of the library would rather be the classes which fetch the data then the main class.
So if you write data fetchers which might be of interest to others please contact me to integrate them here or offer your code as extension library yourself and call it something like esp8266-weather-station-<yourservice>.
We will gladly list it here as third party library...
To get you up and running in no time, we created <br>
this kit which contains all the parts you will need.

## Upgrade Notes
<br>
<br>
<br>
<br>

**Version 2, January 2020, removes WU support, see below**
<div align = center>

**Replace Wunderground with OpenWeatherMap as weather data provider**
## **Service Level Promise**

The weather information provider we used so far (Wunderground) [recently stopped their free tier](https://thingpulse.com/weather-underground-no-longer-providing-free-api-keys/) without previous notice on May 15, 2018. This release adds support for a new provider with a free tier for weather information: OpenWeatherMap.com. The basic demo (WeatherStationDemo) has been adapted to use this new API through the OpenWeatherMapCurrent and OpenWeatherMapForecast REST clients.
</div>

<br>

Sadly OpenWeatherMap provides less information than Wunderground did (or still does). If you are missing attributes in the response documents then please [contact the OpenWeatherMap team](https://openweathermap.desk.com/customer/portal/emails/new).
<table align = center>
<tr>
<td>
<img
src = https://thingpulse.com/assets/ThingPulse-open-source-prime.png
height = 140
/>
</td>
<td>
<div align = center>
<br>
This is a **ThingPulse Prime Project**.

See our open-source **[Commitment]**<br>
declaration for what this means.

</div>
</td>
</tr>
</table>

**ESP8266 OLED Library upgrade**
<br>
<br>
<br>

The ESP8266 OLED Library changed a lot with the latest release of version 3.0.0. We fixed many bugs and improved performance and changed the API a little bit. This means that you might have to adapt your Weather Station Code if you created it using the older 2.x.x version of the library. Either compare your code to the updated WeatherStationDemo or read through the [upgrade guide](https://github.com/ThingPulse/esp8266-oled-ssd1306/blob/master/UPGRADE-3.0.md)
<div align = center>

## Deprecation notes
## **Deprecation**

<br>

| Announcement | Module | Removal |
|:----------------:|:-----------------------:|:-------------------------|
| `2018 / 06 / 13` | **[Wunderground Code]** | `January 2020``v2.0.0` |

</div>

<!----------------------------------------------------------------------------->

[Badge Development]: https://github.com/ThingPulse/esp8266-weather-station/actions/workflows/main.yml/badge.svg?branch=development
[Badge Master]: https://github.com/ThingPulse/esp8266-weather-station/actions/workflows/main.yml/badge.svg

[Changelog]: Documentation/Changelog.md
[Install]: Documentation/Install.md
[Modules]: Documentation/Modules.md
[Design]: Documentation/Design.md

[Actions]: https://github.com/ThingPulse/esp8266-weather-station/actions
[Logo]: https://thingpulse.com/assets/ThingPulse-w300.svg

[Commitment]: https://thingpulse.com/about/open-source-commitment/
[Website]: https://thingpulse.com
[Shop]: https://thingpulse.com/shop/

[Kit]: https://thingpulse.com/product/esp8266-iot-electronics-starter-kit-weatherstation-planespotter-worldclock/

[Wunderground Code]: https://thingpulse.com/hello-openweathermap-bye-bye-wunderground/

| Announcement | Module | Removal |
|---------------|---------|----------|
| 2018-06-13 | all **Wunderground** related code, see [our blog](https://thingpulse.com/hello-openweathermap-bye-bye-wunderground/) for details | January 2020, version 2.0.0 |