Git Product home page Git Product logo

esp8266-weather-station-color's Introduction

ThingPulse ESP8266 Weather Station Color

ThingPulse logo

ESP8266 Weather Station Color using ILI9341 240x320 TFT display

Hardware Requirements

The code in this project supports an ILI9341 240x320 TFT display with code running on an ESP8266. To get you up and running in no time we created a kit which contains all the necessary parts including a custom PCB to connect display and WiFi chip: https://thingpulse.com/product/esp8266-wifi-color-display-kit-2-4/

Buy the kit from us to support future development of this application. Thank you!

ThingPulse ESP8266 Color Display Kit

Service level promise

This is a ThingPulse prime project. See our open-source commitment declaration for what this means.

Step-by-step tutorial

A complete step-by-step tutorial/guide is available at https://docs.thingpulse.com/guides/wifi-color-display-kit/.

Licensing, contributions and maintenance

The code in this repository is licensed under MIT, a short and simple permissive license with conditions only requiring preservation of copyright and license notices. Thus, you're free to fork the project and use the code for your own projects as long as you keep the copyright notices in place.

ThingPulse is committed to open-source development and will continue to maintain this code. We welcome contributions from the community given they are roughly in line with our guidelines. However, please understand that we primarily developed this application to be run on our own hardware kit mentioned above. It's the only platform we regularly test the code against. You are of course free to run the code on any hardware you think is compatible but you have to rely on community support should you run into problems.

ThingPulse runs a support forum for its customers that is better suited to answering user questions than the issues list here.

Wiring

The wiring diagram is only needed when you do not buy the self-contained kit from ThingPulse but rather assemble the components yourself. The kit provides a custom PCB that solidly connects microcontroller and display.

Operation

See "Operation" in the official documentation.

esp8266-weather-station-color's People

Contributors

afreisinger avatar cxandy avatar david-robson avatar lovebootcaptain avatar marcelstoer avatar reiyawea avatar squix78 avatar tivohomeuser avatar wjcarpenter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266-weather-station-color's Issues

Additional Unicode Blocks in Oleddisplay tool

Would it be possible to have additional Unicode Blocks (e.g. Latin Extended-A/B, Arabic, Cyrillic, etc. subsets) in your oleddisplay.squix.ch tool? I understand that not all fonts have all subsets, but at least the ones that have (Roboto, opensans, Noto, etc have full subsets) would help to localize the weather tool. Thanks!

4-color weathericons round width to next byte

Is it necessary in weathericons.h to add/round picture width pixels to /8 and append extra "black" bit rows to the end of the array instead of just round to /4 - still full byte?
Example, a10px X 2px. picture containing totaly 20 points can be converted to 8 or 6 bytes with same display result:

 //8 bytes for 10 to 16px width rounding as per weathericons.h, do we really need the last 2 bytes ?
  0xe4, 0xe4, 0xe0,
  0xe4, 0xe4, 0xe0,
  0x00, 0x00 

vs. (as converted by this tool)

  //6 bytes, 10 to 12px rounding 
  0xe4, 0xe4, 0xe0,
  0xe4, 0xe4, 0xe0

Both arrays will be displayed exact same way on the screen by MiniGrafx ' drawPalettedBitmapFromPgm()

Reconnect Wifi after reset

For correct connect to WiFi after reset please add 2 string into

void connectWifi() {
WiFi.disconnect(); //must be added
WiFi.mode( WIFI_STA ); //must be added

thanks!

No information

Hello Guys,
I made the project with ESP8266 (NodeMcu) and 2.4 inch display but I don't have any information regarding the weather forecast on the display.
I change the setting.h, API key,
but nothing.
Anybody a solution?
Thank you

img_20180214_154256

Displaying of actual indoor data from DHT22

Just thought that it might be useful to attach a DHT22 sensor to still free D0 (GPIO16) port in order to measure an actual room temperature and humidity and to display it at 3rd carousel frame for example. Or to add a still reserved touch screen functionalty (XPT) in order to trigger in between carousel forecast frames and fixed indoor conditions frame. It might be also good to indicate a city name somewhere on the screen in order to know which place weather it is. Also miss bmp moonphases in the new release, The present graphic ones look quite simple.... I think that all of above will increase functionality and look and feel. Is it possible to update the code this way? Many thanks!

doesn't display any icons any more

Hi,

thanks for this great project! I built a weather station a couple of months ago and it's been working great until about 4 days ago. Now it doesn't display any icons. The text is fine, but no bmps. On the serial terminal I see that they get downloaded and also load from the file system, but they don't get displayed. Any hints?

thanks,
-Christian

Program loss on power loss

I'm not sure if this is an "issue" or that I do not understand something.

When uploading code via Arduino IDE, weather station Color works fine, connects to my network and pulls down data, displays great. Works great.

I am only connecting via micro USB - no battery. When I unplug, and replug, unit loses memory and requires re-uploading the program via Arduino IDE.

Do I need to always keep a li-po cell on the unit? Or is there a setting that I just do not see to keep the settings after power down?

Thanks

U/L-case font include file problem

Daniel,

Thanks for publishing this neat project. I used it as a quick test for a 320x240 ILI9341 connected to an ESP12 and was very impressed.
Like you, I'm now also a great fan of PlatformIO and use it for all my (mostly unfinished) projects. I'm running under Linux, so there was/is one small problem with the build. The Arial font library files are named inconsistently. This probably doesn't affect Windows, but will cause builds under Unix or on Macs to fail. The problem is with the small (14-point) filename, where the filename is written "Mt", but referred to in the #includes as "MT".
It's easy enough for users to change the filename, but I just wanted to flag it, in case it trips up some novice maker somewhere.

Many thanks from Japan and my best wishes for a happy and prosperous 2017,

                         -John-

getPoint return values and Calibration

Hi all

I'm trying to adapt the code to the touch controller STMPE610.
I got it mostly to work.
Actually I'm trying to solve an issue regarding the area where the touch is touched.
I do not really understand what is going on during calibration process and what is beeing calculated in the getPoint function.
Can be someone give a short explanation of the calibration process and on the calculation in the getPoint function?

Regards,
Marcos

Please add pin description, top and bottom in the silkscreen layer for U2

There is plenty of room and if this had been present, along with the 'square pin 1' contention, I could have avoided mis-assemlbing my kit [I soldered the connectors and will need to be de-soldering to re-assemble properly]

Not urgent, but a good think to keep in mind for the next run of boards

adding a revision date and version indicator comes to mind as good practice as well

Time Font Artifacts?

I was seeing a vertical line to the left and right of the time on some numbers. It was only one pixel wide, but it was annoying.

My totally amateur fix... I added leading and trailing spaces, and the artifacts are gone.

String time = " " + timeClient.getHours() + ":" + timeClient.getMinutes() + ":" + timeClient.getSeconds() + " ";

I know it's not a proper solution, but it's an easy workaround.

Can't compile

esp8266-weather-station-color:524: error: 'class MiniGrafx' has no member named 'drawStringMaxWidth'

   gfx.drawStringMaxWidth(15, 265, 240 - 2 * 15, ESP.getResetInfo());

       ^


exit status 1
'class MiniGrafx' has no member named 'drawStringMaxWidth'

converting to non-pointer type 'int' from NULL in GfxUi.cpp

It seems, that SPIFFS.open(filename, "r") returns 0 and not NULL, if it can't find the file.

At least my compiler gives me a WARNING:

src\GfxUi.cpp: In member function 'void GfxUi::drawBmp(String, uint8_t, uint16_t)':
src\GfxUi.cpp:107:49: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
if ((bmpFile = SPIFFS.open(filename, "r")) == NULL) {
^

and when I change it to:

if ((bmpFile = SPIFFS.open(filename, "r")) == 0){
Serial.print(F("File not found"));
return;
}

the compiler is happy and shows no WARNING.

Maybe it helps, to get the code with a warning less...

wake up from sleep

how to wake up from sleep. Actually only reset works - by intention? Tapping on display would be nice.

Software Requirements/ Libraries

Please add Json Streaming Parser (by Daniel Eichhorn) to the list of required libraries in the esp8266-weather-station-color project.

Please continue your awesome work. I have some personal projects based on them I use everyday.

touch calibration

I have some issue with the calibration of the touch screen. it appear that x and y are reverse. hardware or software issue ?

2.2tft/No touch

I've been using your old .ino on a 2.2tft for a year at least now and its been great. I noticed all these new updates, and in the new settings there is "define HAVE_TOUCHPAD". Does this mean we can use it without a touchpad? So far it seems to just cycle through the screens.

Also, I had to remove the D from the pin designations in the settings file for it to compile.

Date not updated immediately after midnight

Short time after midnight, let's say 00:05 or even 00:20 the date is not updated and shows still the date of the previous day. Short while after it is updated as expected.

Timezone

Hi There,

Just wanting to find out if India timezone can work on this device. That is UTC +5.30 hrs. I did a bit research across posts, it seems like the +30 mins is not supported by the library. Has there been any update to this.
This is a really interesting project and would like to gift the project to a friend from India.
Thanks

Time shows 00:00:00 for short time after forecast update

configTime(UTC_OFFSET * 3600, 0, NTP_SERVERS); can take several seconds to update the system clock.
If time / date is displayed during this period, it will be zero-ed.

Suggestion, in drawTime() prevent the display unless the date is correct

if (timeinfo->tm_year > 116) { // valid, if the year is > 2016

See here

Carousel not smooth

First i build weather station with with small OLED display. Nice.
Now i build weather-station color. Great. Thanks a lot!
But the carousel from weatherstation color change pages with jumps and is choppy while at the small device it runs very smooth. That gives problems with the WAF :-)
Is there an error i made or an option to optimize the page-change?
Where i can set the time used for page change?

Private Settings

I read your description of the Continuous Delivery Pipeline, and noticed how WiFi Manager allowed the router password to be removed from code. Moreover, it looks like the router information is stored in flash, so it can be reused.

Have you thought about acquiring Weather Underground, ThingSpeak, and DST settings via browser connection (once WiFi is configured) and storing that information in flash too? This would make the code completely portable. I'm going to look into it, but it may take awhile with my coding skills (new).

Sketch does not run

Hello, after installing on your WiFi Color Display Kit the sketch hangs her:

[HTTP] GET... code: 200
start document
[HTTP] GET...
[HTTP] GET... code: 200
start document

DST Rules Updated:
DST Start: Sun Mar 12 02:00:00 2017
DST End:   Sun Nov 05 01:00:00 2017

Screen displays nothing has a slight flicker ( also when plugged in to adequate power supply)
Any ideas would be welcomed..

Great project though!!

Please combine WU API calls

The 3 API calls can be combined into one by catenating the requests into one URL like this /conditions/forecast10day/astronomy/

WiFi credentials

Hi Daniel

It seems that in the process of enhancing your program one of the basics may have slipped through the cracks.

Just curious why the WiFi credentials (SSID and Password) aren't specified in settings.h or by definitions at the top of the .ino file?

To get connected I had to scroll down to line 166 of the .ino file and enter those credentials. Did I miss something?

Don

Save images locally

Hello, the display ILI9341 has a slot for an SD card. If you can not use this option,
To put the images for the weather and the moon phases there?
Then they do not need to be loaded from the Internet every time.

greeting
Dirk

deprecated conversion from string constant to 'char*' in esp8266-weather-station-color.ino

My compiler shows me the same warnings for the following lines: 92, 148, 149, 153, 299, 306

Example (line 92):
ui.drawString(120, 160, "Connecting to WiFi");

WARNING:
.../src/main.ino: In function 'void setup()':
.../src/main.ino:94:47: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] ui.drawString(120, 160, "Connecting to WiFi");

When I change it to:
ui.drawString(120, 160, (char*) "Connecting to WiFi");

No WARNINGS at all.

It seems, that drawString() needs a pointer and not a string.
It is still working with the string, but the cleaner solution with the pointer.

Maybe it helps for a cleaner code.

Info screens go too fast

Got it working, but it seems the script is not retrieving the info from wunderground, since the weather shows 0°C and the screens cycle super fast. API key was set and manual requests from my browser display all the info needed (eg http://api.wunderground.com/api/MY API KEY/conditions/q/USA/NEW_YORK.json).

'D1' was not declared in this scope

I checked out latest version(#e71c540).
And I got this error while building.
How can I fix this?

(I upgraded libraries on arduino library manager, and removed Adafruit ILI9341 library in arduino libraries folder)

`
In file included from D:\Projects\ESP8266\esp8266-weather-station-color\esp8266-weather-station-color.ino:46:0:

settings.h:26: error: 'D1' was not declared in this scope

#define TFT_CS D1

            ^

D:\Projects\ESP8266\esp8266-weather-station-color\esp8266-weather-station-color.ino:58:41: note: in expansion of macro 'TFT_CS'

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

                                     ^

settings.h:25: error: 'D2' was not declared in this scope

#define TFT_DC D2

            ^

D:\Projects\ESP8266\esp8266-weather-station-color\esp8266-weather-station-color.ino:58:49: note: in expansion of macro 'TFT_DC'

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

                                             ^

D:\Projects\ESP8266\esp8266-weather-station-color\esp8266-weather-station-color.ino: In function 'void setup()':

settings.h:27: error: 'D8' was not declared in this scope

#define LED_PIN D8

             ^

D:\Projects\ESP8266\esp8266-weather-station-color\esp8266-weather-station-color.ino:90:11: note: in expansion of macro 'LED_PIN'

pinMode(LED_PIN, D8);

       ^

exit status 1
'D1' was not declared in this scope`

ESP32

Any plans to tweak the code for the esp32?

Display Problem....

Did setup everything today....seems to work as the BMPs are uploaded and I can see day+time....

But icons are not recognizeable at all....i can see the Temp correctly...I also can see SUN 5/15 MON 7/17 and TUE 7/17.....so very strange.....the dates look strange....but the TOP date with time is correct...

At the bottom i can see SUN and Rise/set time....also MOON and two values....but no icon for both of them....reset does not change anything.....

Any idea what is wrong....

WiFi Access Point - broadcasting SSID

Weather Station was found to be broadcasting its SSID unnecessarily

Resolved by adding WiFi.mode(WIFI_STA); to turn off the Access Point Broadcast, see below.
Also added WiFi.hostname(WIFI_Hostname); to provide a recognizable network host name, this requires the addition of #define WIFI_Hostname "Weather Station" in the settings.h file

void connectWifi() {
  if (WiFi.status() == WL_CONNECTED) return;
  //Manual Wifi
  WiFi.mode(WIFI_STA);
  WiFi.begin(WIFI_SSID,WIFI_PASS);
  WiFi.hostname(WIFI_Hostname);
  int i = 0;
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    if (i>80) i=0;
    drawProgress(i,"Connecting to WiFi");
    i+=10;
    Serial.print(".");
  }
}

is_metric for forecasts

I finally got around to installing your touch update today. Very nice.

The IS_METRIC setting works as expected for the current temperature, but the forecast temperatures always seem to be in C regardless of that setting.

Generating icons

Hello,
I just want to ask if there is some way for generating images and icons to progmem palleted arrays, so it will be correctly displayed by minigrafx library.

thanks

Screen Rotation

How do you go about rotating the screen to landscape? I have looked and I am not really seeing where to configure that.

Screen brightness

Hi,

I experienced some problem with screen brightness appeared due to direct connection of the display LED pin to the GPIO of ESP8266. Obviously the current of the GPIO is not enough to make a screen bright enough especially in the natural light environment. Moreover the particular GPIO15 (D8 at D1 Mini) might be overloaded and killed as a result with an excessive current consumption. Therefore I propose a simple schematics to avoid this situation and to make a screen much brighter. The only thing is that relevant code should be changed a little as now this port works in reverse logic:

// The LED pin needs to set LOW // Use this pin to save energy // Turn on the background LED pinMode(TFT_LED, OUTPUT); digitalWrite(TFT_LED, LOW);

led pin

Also in case of energy saving requirement it might be good to use an ADC (A0) pin at ESP to connect an LDR (light dependent resistor) to adjust the screen brightness in such a way that it goes brighter with natural light presence and dims out in the twilight or darkness. A calibration of LDR is needed to provide the necessary voltage readings at ADC pin and set up of the corresponding brightness levels of the screen.

Alerts Causing Crash

There have been sever weather alerts in my area the last two days and my weather station color will not boot. It crashes and reboots when it gets to the updating alerts section of the updates.

I commented out that portion of the code, and it boots fine.

/* drawProgress(90, "Updating alerts..."); WundergroundAlerts *alertClient = new WundergroundAlerts(); alertClient->updateAlerts(alerts, MAX_ALERTS, WUNDERGRROUND_API_KEY, WUNDERGRROUND_LANGUAGE, WUNDERGROUND_COUNTRY, WUNDERGROUND_CITY); delete alertClient; alertClient = nullptr; */

I downloaded the json file from wunderground and it is 24KB in size. I have MAX_ALERTS set to 1.

Let me know if any additional info will help.

Time source

After reviewing the code, am I correct in you are using Weather Underground as the time source for the clock being displayed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.