loading

[ Play Video ]

Welcome to my new Weather Widget Project.

A weather widget is a application that can be downloaded on your PC, laptop or a mobile device and perform the job of providing easy access to weather information.But I was always trying to make something different.So I go through the internet to get some ideas.After few days of my work, finally I made it.I am sharing this so that any one can make it easily.

This is an ESP8266 based Weather Display unit which retrieve localized weather information from http://www.wunderground.com/ by WLAN and display it on a 128x64 OLED Display.

The Widget display following things

1. Current Time with Date

2. Current Day Weather Information like Temperature,Pressure,Humidity and Rain fall.

3. Future forecasting for 3 days

I would like to give credit to my friend Dani Eichhorn who did all of the programming parts.He is updating the software on his Github page regularly with new features.You can visit SquixTechBlog to see more projects on ESP8266.

Step 1: Parts and Tools Required

Parts Required :

1. ESP8266 -01 (eBay )

2. Optional NodeMCU ESP8266-12 ( eBay )

3. OLED Display (eBay )

4. Voltage Regulator AMS1117 ( eBay )

5.Tactile Switch (eBay )

6.Slide Switch ( eBay )

7.Resistors ( 10K and 330R )

8.Female Double Row Straight Pin Header ( eBay )

9. Male Double Row Right Angle Pin Header ( eBay )

9.Jumper Wires ( eBay )

10.Prototype Board ( eBay )

Tools Required :

1. Soldering Iron

2.Wire Cutter

3.Wire Stripper

4.Nipper

Step 2: Making the Circuit

Make the circuit on a prototype board as per the schematic shown above.

Important thing is that this Board can be used for programming the ESP8266 -01 module from Arduino IDE. You can use it for any of your project.

The whole Circuit is consists of ESP8266-01 module, OLED Display and few other components

1. AMS1117 : This is a voltage regulator which convert 5V to 3.3V required for ESP8266 module.

2. Tactile Switch ( S1) : Used for Resetting the ESP8266

3.Slide Switch (S2) : Used for changing the mode of ESP8266. There are two modes Normal and Program Mode.

4. Resistors : R1 is a pull up resistor and R2 is current limiting resistor.

5. Header CP2102 : Used for programming

6.Header Power : Provide power from a LiPo Battery.This is optional, because you can use the programming port's two pin for power.

7. Header OLED : Connection for OLED Display

Update as on 13/03/2016 : New PCB files

Thanks to my friend spilz who put his effort to make this nice PCB.Now you can make it by downloading the gerber files attached below.

PCB Components :

1. AMS : AMS1117-3.3

2. C1 : 100nF

3. C2 : 10uF

4. C3 : 100nF

5. C4 : 10uF

6. C5 : 100nF

Note : An additional resistor R2 is added in PCB to protect ESP8266 .

For any improvement please suggest .

Step 3: Download and Installed the Softwares

1. Arduino Code

ESP8266 Weather Station

2. Libraries :

Json Streaming Parser

ESP8266 Oled Driver for SSD1306 display

After downloading the library unzip it and installed it with your Arduino Library Manager in

Sketch > Include Library > Manage Libraries...

3. ESP8266 board on Arduino IDE :

To installed the ESP8266 board on your arduino IDE follow the following link.

https://github.com/esp8266/Arduino

Update on 2/1/2016 :

As per the feedback, lot of people facing problem in compiling the code.So I think it is better to share the code what I have used.You can download the .zip file attached below.

Step 4: Get Weather API Key

The Weather Station real-time data obtained from the Weather Underground (http://www.wunderground.com) website. So you have to get the Wunderground API Key. There is no cost to apply for a basic key, which is more than sufficient for our requirements.

Follow the steps below:


1. Go to http://www.wunderground.com/weather/api/d/login.h... a free Weather Underground account.

2.Enter your email address, a password , and a handle (a username), then click the “Sign Up” button.

3.Weather Underground will immediately send you an email with an activation link. You must click this link within the email to activate your account (you’ll be brought back to the login screen).

4. Login to Weather Underground using the account you just created and activated.

5.Click on the “Explore My Options” button.Click the “Purchase Key” button at the top or bottom of the page (you will not be asked for a method of payment).

6.Weather Underground will ask you to fill out a simple form in order to complete your request.

When asked where the API will be used, answer “Other”.

When asked if the API is for commercial use, answer “No”.

When asked if the API is for chip processing, answer “No”.

Step 5: Set Up the Software

After downloading the Arduino Code, you have to change the following things

1.Open the sketch in the Arduino IDE

2.Enter the Wunderground API Key

3.Enter your Wifi credentials

4.Adjust the location according to Wunderground API, e.g. India,Kolkata

5. Adjust UTC offset

Step 6: Upload the Code

Connect the FTDI Programmer as follows

ESP8266 --> CP2102

Vcc --> Vcc

GND--> GND

Tx --> Rx

Rx --> Tx

Slide the switch toward the Programming Mode

In Arduino IDE ,select the board as " Generic ESP8266 Module "

Then upload the code.

Step 7: Testing

Now remove the programmer and its connection.

Slide the switch to its normal position

Connect the Power Supply.I used a LiPo battery for it.

After few seconds the OLED will display all the weather parametrs.

Step 8: Make With Node MCU

If you are a not interested to make the circuit by using an ESP8266-01 module,then this is an alternative for you.You can make the same Weather Widget by using a Node MCU board. NodeMCU is an open source IoT platform.It includes firmware which runs on the ESP8266 Wi-Fi SoC, and hardware which is based on the ESP-12 module.You can still use your favourite Arduino IDE and Arduino code to program it.Another advantage is that you do not need a separate FTDI programmer to program it.A micro USB cable is enough for it.You can use your smart phone/tablet charger cable for it.

Follow the steps :

First update the NodeMCU to latest version firmware .You can see the video made by TornTech for reference.

1. Make the circuit on a bread board

Node MCU --> OLED

3.3V --->Vcc

GND -->GND

D5----> SDA

D6----> SCL

2. Connect the micro USB cable

3.Plug in to your laptop/PC USB port.

4.Set up the Software as stated in the earlier steps.

5.Set the board to " NodeMCU 1.0 (ESP-12E Module)"

6.Upload the code

You are done !!!

Step 9: Make the Enclosure

You can make your enclosure yourself with your own choice.

But I will suggest to look in to the beautiful 3D printed enclosure designed by smily77.I have printed my enclosure but still few works is left.I will update it once completed.Stay tuned...

Download the .STL files from Thingiverse.

Follow the instruction to print the Enclosure.

Then insert all the components inside.Now the Weather Widget is ready !!!

If you enjoyed this article, don’t forget to pass it along!

Follow me for more DIY projects and ideas. Thank you !!!

<p>Hey! i made it!</p><p>The first time i make it work but now i want to change some settings and maybe add more frames.</p><p>but i'm getting this error after change de city and country.:</p><p>void updateForecast(String apiKey, String language, String country, String city);<br><br> ^<br><br>sketch\WundergroundClient.h:108:10: note: candidate expects 4 arguments, 3 provided<br><br>exit status 1<br>no matching function for call to 'WundergroundClient::updateForecast(String&amp;, String&amp;, String&amp;)'</p><p>can you help me?</p>
<p>Hi, what a great little project. I am a relative newbie to the mcu world and this was very interesting and reasonably straight forward to get impressive results. My only drawback was that I was supplied OLEDs that were stated as being SSD1306 but they were SH1106 - I just got snow! Changed them out for a Sunfounder OLED but it was faulty - DOH! Sunfounder support was great and supplied a good OLED and I am now very happy indeed. Also tried the Moon/Sun version by Solar767 - also very happy. Please keep up the good work.</p>
<p>I made your version of the Weather Widget (Solar767) and it's a significant improvement over the earlier versions. I added the WiFi manager code to make configuring it even simpler without having to hard code your password and such into the flash. Combination of your code, WifiManager, and some code from Fowlerk. I'll try to post a copy in Github. </p>
<p>I MADE IT!!!! (And I little bit change the code.)</p><p><strong>You should copy and write in WeatherStationDemo.ino</strong></p><p><strong>and in underpart, you should copy and write in </strong><strong>WeatherStationImages.h</strong></p><p> OLED SDA -&gt; D3, OLED SCL -&gt; D4</p><p> This Code is added Moon and Sun Rise and set time and Moon Phase and UV Level, Humidity, Dew Point, Feel Like, Wind speed, Wind direction, POP, Moonlight!</p><p> Here is the code!</p><p><strong>=======================================================</strong></p><p><strong>=======================================================</strong></p><p><strong>===========================================================================================================================================================================</strong></p><p>/**The MIT License (MIT)</p><p>Copyright (c) 2016 by Daniel Eichhorn</p><p>Permission is hereby granted, free of charge, to any person obtaining a copy</p><p>of this software and associated documentation files (the &quot;Software&quot;), to deal</p><p>in the Software without restriction, including without limitation the rights</p><p>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</p><p>copies of the Software, and to permit persons to whom the Software is</p><p>furnished to do so, subject to the following conditions:</p><p>The above copyright notice and this permission notice shall be included in all</p><p>copies or substantial portions of the Software.</p><p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</p><p>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</p><p>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</p><p>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</p><p>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</p><p>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</p><p>SOFTWARE.</p><p>See more at <a href="http://blog.squix.ch" rel="nofollow"> http://blog.squix.ch</a></p><p>*/</p><p>#include &lt;ESP8266WiFi.h&gt;</p><p>#include &lt;Ticker.h&gt;</p><p>#include &lt;JsonListener.h&gt;</p><p>#include &lt;Wire.h&gt;</p><p>#include &quot;SSD1306.h&quot;</p><p>#include &quot;SSD1306Wire.h&quot;</p><p>#include &quot;OLEDDisplayUi.h&quot;</p><p>#include &quot;Wire.h&quot;</p><p>#include &quot;WundergroundClient.h&quot;</p><p>#include &quot;WeatherStationFonts.h&quot;</p><p>#include &quot;WeatherStationImages.h&quot;</p><p>#include &quot;TimeClient.h&quot;</p><p>/***************************</p><p>* Begin Settings</p><p>**************************/</p><p>// Please read <a href="http://blog.squix.org/weatherstation-getting-code..." rel="nofollow"> http://blog.squix.org/weatherstation-getting-code...</a></p><p>// for setup instructions</p><p>// WIFI</p><p>const char* WIFI_SSID = &quot;YOUR_WIFI&quot;;</p><p>const char* WIFI_PWD = &quot;PASSWORD&quot;;</p><p>const int I2C_DISPLAY_ADDRESS = 0x3c;</p><p>const int SDA_PIN = D3;</p><p>const int SDC_PIN = D4;</p><p>// Setup</p><p>const int UPDATE_INTERVAL_SECS = 10 * 60; // Update every 10 minutes</p><p>// TimeClient settings</p><p>const float UTC_OFFSET = 9;</p><p>// Wunderground Settings</p><p>const boolean IS_METRIC = true;</p><p>const String WUNDERGRROUND_API_KEY = &quot;cf3a39d550c0f2bb&quot;;</p><p>const String WUNDERGRROUND_LANGUAGE = &quot;EN&quot;;</p><p>const String WUNDERGROUND_COUNTRY = &quot;KO&quot;;</p><p>const String WUNDERGROUND_CITY = &quot;Seoul&quot;;</p><p>// Initialize the oled display for address 0x3c</p><p>// sda-pin=14 and sdc-pin=12</p><p>SSD1306Wire display(I2C_DISPLAY_ADDRESS, SDA_PIN, SDC_PIN);</p><p>OLEDDisplayUi ui( &amp;display );</p><p>/***************************</p><p>* End Settings</p><p>**************************/</p><p>TimeClient timeClient(UTC_OFFSET);</p><p>// Set to false, if you prefere imperial/inches, Fahrenheit</p><p>WundergroundClient wunderground(IS_METRIC);</p><p>// flag changed in the ticker function every 10 minutes</p><p>bool readyForWeatherUpdate = false;</p><p>String lastUpdate = &quot;--&quot;;</p><p>Ticker ticker;</p><p>//declaring prototypes</p><p>void drawProgress(OLEDDisplay *display, int percentage, String label);</p><p>void updateData(OLEDDisplay *display);</p><p>void drawDateTime(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);</p><p>void drawCurrentWeather(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);</p><p>void drawForecast(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);</p><p>void drawForecastDetails(OLEDDisplay *display, int x, int y, int dayIndex);</p><p>void drawMoon(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);</p><p>void drawSun(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);</p><p>void drawData1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);</p><p>void drawData2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y);</p><p>void drawHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state);</p><p>void setReadyForWeatherUpdate();</p><p>// Add frames</p><p>// this array keeps function pointers to all frames</p><p>// frames are the single views that slide from right to left</p><p>FrameCallback frames[] = { drawDateTime, drawCurrentWeather, drawForecast, drawMoon, drawSun, drawData1, drawData2};</p><p>int numberOfFrames = 7;</p><p>OverlayCallback overlays[] = { drawHeaderOverlay };</p><p>int numberOfOverlays = 1;</p><p>void setup() {</p><p>Serial.begin(115200);</p><p>Serial.println();</p><p>Serial.println();</p><p>// initialize dispaly</p><p>display.init();</p><p>display.clear();</p><p>display.display();</p><p>//display.flipScreenVertically();</p><p>display.setFont(ArialMT_Plain_10);</p><p>display.setTextAlignment(TEXT_ALIGN_CENTER);</p><p>display.setContrast(255);</p><p>WiFi.begin(WIFI_SSID, WIFI_PWD);</p><p>int counter = 0;</p><p>while (WiFi.status() != WL_CONNECTED) {</p><p>delay(500);</p><p>Serial.print(&quot;.&quot;);</p><p>display.clear();</p><p>display.drawString(64, 10, &quot;Connecting to WiFi&quot;);</p><p>display.drawXbm(46, 30, 8, 8, counter % 3 == 0 ? activeSymbole : inactiveSymbole);</p><p>display.drawXbm(60, 30, 8, 8, counter % 3 == 1 ? activeSymbole : inactiveSymbole);</p><p>display.drawXbm(74, 30, 8, 8, counter % 3 == 2 ? activeSymbole : inactiveSymbole);</p><p>display.display();</p><p>counter++;</p><p>}</p><p>ui.setTargetFPS(30);</p><p>ui.setActiveSymbol(activeSymbole);</p><p>ui.setInactiveSymbol(inactiveSymbole);</p><p>// You can change this to</p><p>// TOP, LEFT, BOTTOM, RIGHT</p><p>ui.setIndicatorPosition(BOTTOM);</p><p>// Defines where the first frame is located in the bar.</p><p>ui.setIndicatorDirection(LEFT_RIGHT);</p><p>// You can change the transition that is used</p><p>// SLIDE_LEFT, SLIDE_RIGHT, SLIDE_TOP, SLIDE_DOWN</p><p>ui.setFrameAnimation(SLIDE_LEFT);</p><p>ui.setFrames(frames, numberOfFrames);</p><p>ui.setOverlays(overlays, numberOfOverlays);</p><p>// Inital UI takes care of initalising the display too.</p><p>ui.init();</p><p>Serial.println(&quot;&quot;);</p><p>updateData(&amp;display);</p><p>ticker.attach(UPDATE_INTERVAL_SECS, setReadyForWeatherUpdate);</p><p>}</p><p>void loop() {</p><p>if (readyForWeatherUpdate &amp;&amp; ui.getUiState()-&gt;frameState == FIXED) {</p><p>updateData(&amp;display);</p><p>}</p><p>int remainingTimeBudget = ui.update();</p><p>if (remainingTimeBudget &gt; 0) {</p><p>// You can do some work here</p><p>// Don't do stuff if you are below your</p><p>// time budget.</p><p>delay(remainingTimeBudget);</p><p>}</p><p>}</p><p>void drawProgress(OLEDDisplay *display, int percentage, String label) {</p><p>display-&gt;clear();</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_CENTER);</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>display-&gt;drawString(64, 10, label);</p><p>display-&gt;drawProgressBar(2, 28, 124, 10, percentage);</p><p>display-&gt;display();</p><p>}</p><p>void updateData(OLEDDisplay *display) {</p><p>drawProgress(display, 10, &quot;Updating time...&quot;);</p><p>timeClient.updateTime();</p><p>drawProgress(display, 30, &quot;Updating conditions...&quot;);</p><p>wunderground.updateConditions(WUNDERGRROUND_API_KEY, WUNDERGRROUND_LANGUAGE, WUNDERGROUND_COUNTRY, WUNDERGROUND_CITY);</p><p>drawProgress(display, 50, &quot;Updating forecasts...&quot;);</p><p>wunderground.updateForecast(WUNDERGRROUND_API_KEY, WUNDERGRROUND_LANGUAGE, WUNDERGROUND_COUNTRY, WUNDERGROUND_CITY);</p><p>drawProgress(display, 80, &quot;Updating Astronomy...&quot;);</p><p>wunderground.updateAstronomy(WUNDERGRROUND_API_KEY, WUNDERGRROUND_LANGUAGE, WUNDERGROUND_COUNTRY, WUNDERGROUND_CITY);</p><p>lastUpdate = timeClient.getFormattedTime();</p><p>readyForWeatherUpdate = false;</p><p>drawProgress(display, 100, &quot;Done...&quot;);</p><p>delay(1000);</p><p>}</p><p>void drawDateTime(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_CENTER);</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>String date = wunderground.getDate();</p><p>int textWidth = display-&gt;getStringWidth(date);</p><p>display-&gt;drawString(64 + x, 5 + y, date);</p><p>display-&gt;setFont(ArialMT_Plain_24);</p><p>String time = timeClient.getFormattedTime();</p><p>textWidth = display-&gt;getStringWidth(time);</p><p>display-&gt;drawString(64 + x, 15 + y, time);</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_LEFT);</p><p>}</p><p>void drawCurrentWeather(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_LEFT);</p><p>display-&gt;drawString(60 + x, 5 + y, wunderground.getWeatherText());</p><p>display-&gt;setFont(ArialMT_Plain_24);</p><p>String temp = wunderground.getCurrentTemp() + &quot;&deg;C&quot;;</p><p>display-&gt;drawString(60 + x, 15 + y, temp);</p><p>int tempWidth = display-&gt;getStringWidth(temp);</p><p>display-&gt;setFont(Meteocons_Plain_42);</p><p>String weatherIcon = wunderground.getTodayIcon();</p><p>int weatherIconWidth = display-&gt;getStringWidth(weatherIcon);</p><p>display-&gt;drawString(32 + x - weatherIconWidth / 2, 05 + y, weatherIcon);</p><p>}</p><p>void drawForecast(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {</p><p>drawForecastDetails(display, x, y, 0);</p><p>drawForecastDetails(display, x + 44, y, 2);</p><p>drawForecastDetails(display, x + 88, y, 4);</p><p>}</p><p>void drawForecastDetails(OLEDDisplay *display, int x, int y, int dayIndex) {</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_CENTER);</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>String day = wunderground.getForecastTitle(dayIndex).substring(0, 3);</p><p>day.toUpperCase();</p><p>display-&gt;drawString(x + 20, y, day);</p><p>display-&gt;setFont(Meteocons_Plain_21);</p><p>display-&gt;drawString(x + 20, y + 12, wunderground.getForecastIcon(dayIndex));</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>display-&gt;drawString(x + 20, y + 34, wunderground.getForecastLowTemp(dayIndex) + &quot;|&quot; + wunderground.getForecastHighTemp(dayIndex));</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_LEFT);</p><p>}</p><p>void drawMoon(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {</p><p>String moonAge = wunderground.getMoonAge();</p><p>char ageNum[4];</p><p>moonAge.substring(0, 3).toCharArray(ageNum, 4);</p><p>display-&gt;setFont(Meteocons_Plain_21);</p><p>int moonAgeAndPhase = atoi(ageNum);</p><p>Serial.print(&quot;Moon Age is : &quot;);</p><p>Serial.println(moonAgeAndPhase);</p><p>if (moonAgeAndPhase == 1 || moonAgeAndPhase == 30) {</p><p>display-&gt;drawXbm (x + 10, y + 3, Moon_And_Sun_width, Moon_And_Sun_height, moon1);</p><p>Serial.print(&quot;The moon set moon 1&quot;);</p><p>} else if (moonAgeAndPhase &lt;= 7) {</p><p>display-&gt;drawXbm (x + 10, y + 3, Moon_And_Sun_width, Moon_And_Sun_height, moon2);</p><p>Serial.print(&quot;The moon set moon 2&quot;);</p><p>} else if (moonAgeAndPhase == 8) {</p><p>display-&gt;drawXbm (x + 10, y + 3, Moon_And_Sun_width, Moon_And_Sun_height, moon3);</p><p>Serial.print(&quot;The moon set moon 3&quot;);</p><p>} else if (moonAgeAndPhase &lt;= 14) {</p><p>display-&gt;drawXbm (x + 10, y + 3, Moon_And_Sun_width, Moon_And_Sun_height, moon4);</p><p>Serial.print(&quot;The moon set moon 4&quot;);</p><p>} else if (moonAgeAndPhase == 15) {</p><p>display-&gt;drawXbm (x + 10, y + 3, Moon_And_Sun_width, Moon_And_Sun_height, moon5);</p><p>Serial.print(&quot;The moon set moon 5&quot;);</p><p>} else if (moonAgeAndPhase &lt;= 22) {</p><p>display-&gt;drawXbm (x + 10, y + 3, Moon_And_Sun_width, Moon_And_Sun_height, moon6);</p><p>Serial.print(&quot;The moon set moon 6&quot;);</p><p>} else if (moonAgeAndPhase == 23) {</p><p>display-&gt;drawXbm (x + 10, y + 3, Moon_And_Sun_width, Moon_And_Sun_height, moon7);</p><p>Serial.print(&quot;The moon set moon 7&quot;);</p><p>} else if (moonAgeAndPhase &lt;= 29) {</p><p>display-&gt;drawXbm (x + 10, y + 3, Moon_And_Sun_width, Moon_And_Sun_height, moon8);</p><p>Serial.print(&quot;The moon set moon 8&quot;);</p><p>}</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_RIGHT);</p><p>display-&gt;setFont(ArialMT_Plain_16);</p><p>display-&gt;drawString(120 + x, 02 + y, &quot;MOON&quot;);</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>display-&gt;drawString(x + 120, y + 37, wunderground.getMoonPhase());</p><p>display-&gt;drawString(120 + x, 17 + y, &quot;Rise : &quot; + wunderground.getMoonriseTime());</p><p>display-&gt;drawString(120 + x, 27 + y, &quot;Set : &quot; + wunderground.getMoonsetTime());</p><p>}</p><p>void drawSun(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {</p><p>display-&gt;setFont(Meteocons_Plain_42);</p><p>display-&gt;drawString(55 + x, y + 02, &quot;B&quot;);</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_RIGHT);</p><p>display-&gt;setFont(ArialMT_Plain_16);</p><p>display-&gt;drawString(120 + x, 02 + y, &quot;SUN&quot;);</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>display-&gt;drawString(120 + x, 17 + y, &quot;Rise : &quot; + wunderground.getSunriseTime());</p><p>display-&gt;drawString(120 + x, 27 + y, &quot;Set : &quot; + wunderground.getSunsetTime());</p><p>display-&gt;drawString(120 + x, 37 + y, &quot;UV : &quot; + wunderground.getUV());</p><p>}</p><p>void drawData1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {</p><p>String day = wunderground.getDate();</p><p>char date[3];</p><p>day.substring(0,2).toCharArray(date, 3);</p><p>int today = atoi(date);</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_CENTER);</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>display-&gt;drawString(36 + x, y, &quot;Humidity&quot;);</p><p>display-&gt;drawString(95 + x, y, &quot;Windspeed&quot;);</p><p>display-&gt;drawString(36 + x, 24 + y, &quot;Windway&quot;);</p><p>display-&gt;drawString(95 + x, 24 + y, &quot;Rain%&quot;);</p><p>display-&gt;setFont(ArialMT_Plain_16);</p><p>display-&gt;drawString(35 + x, 10 + y, wunderground.getHumidity());</p><p>display-&gt;drawString(95 + x, 10 + y, wunderground.getWindSpeed() + &quot;Kph&quot;);</p><p>display-&gt;drawString(35 + x, 34 + y, wunderground.getWindDir());</p><p>display-&gt;drawString(95 + x, 34 + y, wunderground.getPoP(today) + &quot;%&quot;);</p><p>}</p><p>void drawData2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) {</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_CENTER);</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>display-&gt;drawString(35 + x, y, &quot;Presusure&quot;);</p><p>display-&gt;drawString(95 + x, y, &quot;DewPoint&quot;);</p><p>display-&gt;drawString(35 + x, 24 + y, &quot;FeelLike&quot;);</p><p>display-&gt;drawString(95 + x, 23 + y, &quot;Moonlight&quot;);</p><p>display-&gt;setFont(ArialMT_Plain_16);</p><p>display-&gt;drawString(35 + x, 10 + y, wunderground.getPressure());</p><p>display-&gt;drawString(95 + x, 10 + y, wunderground.getDewPoint() + &quot;&deg;C&quot;);</p><p>display-&gt;drawString(35 + x, 34 + y, wunderground.getFeelsLike() + &quot;&deg;C&quot;);</p><p>display-&gt;drawString(95 + x, 34 + y, wunderground.getMoonPctIlum() + &quot;%&quot;);</p><p>}</p><p>void drawHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state) {</p><p>display-&gt;setColor(WHITE);</p><p>display-&gt;setFont(ArialMT_Plain_10);</p><p>String date = wunderground.getDate().substring(0, 3);</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_LEFT);</p><p>display-&gt;drawString(0, 54, date);</p><p>display-&gt;setTextAlignment(TEXT_ALIGN_RIGHT);</p><p>String temp = wunderground.getCurrentTemp() + &quot;&deg;C&quot;;</p><p>display-&gt;drawString(128, 54, temp);</p><p>display-&gt;drawHorizontalLine(0, 52, 128);</p><p>}</p><p>void setReadyForWeatherUpdate() {</p><p>Serial.println(&quot;Setting readyForUpdate to true&quot;);</p><p>readyForWeatherUpdate = true;</p><p>}</p><p>//CODE END</p><strong><em>===============================================================================================================================================================================================================================================================================================================================================================================================================</em></strong><p>and you must add this part in ArduinoStationImage.h</p><strong><em>===============================================================================================================================================================================================================================================================================================================================================================================================================</em></strong><p>#define WiFi_Logo_width 60</p><p>#define WiFi_Logo_height 36</p><p>#define Moon_And_Sun_width 30</p><p>#define Moon_And_Sun_height 30</p><p>const char WiFi_Logo_bits[] PROGMEM = {</p><p>0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8,</p><p>0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00,</p><p>0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF,</p><p>0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00,</p><p>0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,</p><p>0xFF, 0x03, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,</p><p>0x00, 0xFF, 0xFF, 0xFF, 0x07, 0xC0, 0x83, 0x01, 0x80, 0xFF, 0xFF, 0xFF,</p><p>0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0C, 0x00,</p><p>0xC0, 0xFF, 0xFF, 0x7C, 0x00, 0x60, 0x0C, 0x00, 0xC0, 0x31, 0x46, 0x7C,</p><p>0xFC, 0x77, 0x08, 0x00, 0xE0, 0x23, 0xC6, 0x3C, 0xFC, 0x67, 0x18, 0x00,</p><p>0xE0, 0x23, 0xE4, 0x3F, 0x1C, 0x00, 0x18, 0x00, 0xE0, 0x23, 0x60, 0x3C,</p><p>0x1C, 0x70, 0x18, 0x00, 0xE0, 0x03, 0x60, 0x3C, 0x1C, 0x70, 0x18, 0x00,</p><p>0xE0, 0x07, 0x60, 0x3C, 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C,</p><p>0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00,</p><p>0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x8F, 0x71, 0x3C,</p><p>0x1C, 0x70, 0x18, 0x00, 0xC0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x08, 0x00,</p><p>0xC0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x0C, 0x00, 0x80, 0xFF, 0xFF, 0x1F,</p><p>0x00, 0x00, 0x06, 0x00, 0x80, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x07, 0x00,</p><p>0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0xFF, 0xFF,</p><p>0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00,</p><p>0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF,</p><p>0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00,</p><p>0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC,</p><p>0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,</p><p>};</p><p>const char activeSymbole[] PROGMEM = {</p><p>B00000000,</p><p>B00000000,</p><p>B00011000,</p><p>B00100100,</p><p>B01000010,</p><p>B01000010,</p><p>B00100100,</p><p>B00011000</p><p>};</p><p>const char inactiveSymbole[] PROGMEM = {</p><p>B00000000,</p><p>B00000000,</p><p>B00000000,</p><p>B00000000,</p><p>B00011000,</p><p>B00011000,</p><p>B00000000,</p><p>B00000000</p><p>};</p><p>const char PROGMEM moon1[] = {</p><p>0x00, 0xf8, 0x07, 0x00, 0x00, 0x07, 0x38, 0x00, 0x80, 0x00, 0x40, 0x00,</p><p>0x60, 0x00, 0x80, 0x01, 0x10, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x04,</p><p>0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x10,</p><p>0x02, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x20,</p><p>0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20,</p><p>0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20,</p><p>0x01, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10,</p><p>0x02, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04,</p><p>0x08, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x02, 0x60, 0x00, 0x80, 0x01,</p><p>0x80, 0x00, 0x40, 0x00, 0x00, 0x07, 0x38, 0x00, 0x00, 0xf8, 0x07, 0x00</p><p>};</p><p>static const char moon2[] PROGMEM = {</p><p>0x00, 0xf8, 0x07, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x7e, 0x00,</p><p>0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xe0, 0x07,</p><p>0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x80, 0x1f,</p><p>0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x3f,</p><p>0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f,</p><p>0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f,</p><p>0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x80, 0x1f,</p><p>0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0xe0, 0x07,</p><p>0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xfc, 0x01,</p><p>0x00, 0x00, 0x7e, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0xf8, 0x07, 0x00</p><p>};</p><p>const char PROGMEM moon3[] = {</p><p>0x00, 0xfc, 0x07, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xe0, 0x7f, 0x00,</p><p>0x00, 0xe0, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x07,</p><p>0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x1f,</p><p>0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0xfc, 0x3f,</p><p>0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f,</p><p>0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f,</p><p>0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xfe, 0x1f,</p><p>0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x07,</p><p>0x00, 0x80, 0xff, 0x07, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xe0, 0xff, 0x01,</p><p>0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xfc, 0x07, 0x00</p><p>};</p><p>const char PROGMEM moon4[] = {</p><p>0x00, 0xfc, 0x07, 0x00, 0x00, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0x7f, 0x00,</p><p>0xc0, 0xff, 0xff, 0x01, 0x80, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x07,</p><p>0x00, 0xff, 0xff, 0x07, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0xfe, 0xff, 0x1f,</p><p>0x00, 0xfc, 0xff, 0x1f, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0xfc, 0xff, 0x3f,</p><p>0x00, 0xfc, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0x3f,</p><p>0x00, 0xf8, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0x3f,</p><p>0x00, 0xf8, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0xfc, 0xff, 0x1f,</p><p>0x00, 0xfc, 0xff, 0x1f, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0xfe, 0xff, 0x07,</p><p>0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x01,</p><p>0xc0, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xfe, 0x07, 0x00</p><p>};</p><p>const char PROGMEM moon5[] = {</p><p>0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0xff, 0x3f, 0x00,</p><p>0x80, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0x03,</p><p>0xf0, 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0x07, 0xfc, 0xff, 0xff, 0x0f,</p><p>0xfc, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0xff, 0x1f,</p><p>0xfe, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x1f,</p><p>0xfe, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x1f,</p><p>0xfe, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0x0f,</p><p>0xfc, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x03,</p><p>0xf0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x01, 0x80, 0xff, 0x7f, 0x00,</p><p>0x00, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00</p><p>};</p><p>const char PROGMEM moon6[] = {</p><p>0x00, 0xf8, 0x0f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, 0x00,</p><p>0xe0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0xf8, 0xff, 0x7f, 0x00,</p><p>0xf8, 0xff, 0x3f, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0xfe, 0xff, 0x1f, 0x00,</p><p>0xfe, 0xff, 0x0f, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0xff, 0xff, 0x0f, 0x00,</p><p>0xff, 0xff, 0x0f, 0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00,</p><p>0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x07, 0x00,</p><p>0xff, 0xff, 0x07, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0xfe, 0xff, 0x0f, 0x00,</p><p>0xfe, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0xf8, 0xff, 0x1f, 0x00,</p><p>0xf8, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0x00,</p><p>0x80, 0xff, 0xff, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xf8, 0x1f, 0x00</p><p>};</p><p>const char PROGMEM moon7[] = {</p><p>0x00, 0xf8, 0x0f, 0x00, 0x00, 0xff, 0x07, 0x00, 0x80, 0xff, 0x01, 0x00,</p><p>0xe0, 0xff, 0x01, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00,</p><p>0xf8, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00,</p><p>0xfe, 0x1f, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,</p><p>0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,</p><p>0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00,</p><p>0xff, 0x1f, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00,</p><p>0xfe, 0x1f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00,</p><p>0xf8, 0x7f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00,</p><p>0x80, 0xff, 0x01, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0xf8, 0x0f, 0x00</p><p>};</p><p>const char PROGMEM moon8[] = {</p><p>0x00, 0xf8, 0x07, 0x00, 0x00, 0xff, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00,</p><p>0xe0, 0x0f, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00,</p><p>0xf8, 0x01, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,</p><p>0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,</p><p>0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,</p><p>0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,</p><p>0x3f, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00,</p><p>0x7e, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00,</p><p>0xf8, 0x01, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00,</p><p>0x80, 0x1f, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00</p><p>};</p><p>//CODE END</p><strong>======================================================================================================================================================================================================================================================================================================================================================</strong><p>P.S.</p><p>If your oled doesn't show Accurately Moon Image, Please try again or Re-conversion Moon Image.</p><p>Here is the list of moon</p><p>Moon1 : New Moon</p><p>Moon2 : Waxing crescent</p><p>Moon3 : Waxing halfmoon</p><p>Moon4 : waxing gibbous moon</p><p>Moon5 : Full moon</p><p>Moon6 : waning gibbous moon</p><p>Moon7 : waning halfmoon</p><p>AND PLEASE DO NOT DRAG ALL THIS COMMENT. THAT CAUSE OF ERROR</p><p>Moon8 : Waxind crescent</p>
<p>No errors when compiling display is however dark :(</p>
<p>'drawFrame1' was not declared in this scope</p><p>why?</p>
<p>I can&acute;t compile because of a library which isn&acute;t mentioned.. Can someone help?</p><p>missing esp8266-weather-station.ino:34:32: fatal error: WundergroundClient.h: No such file or directory</p><p>compilation terminated.</p>
<p>https://github.com/squix78/esp8266-weather-station</p>
<p>Hi.. I am Arbi.. Can i use my arduino for programming the code to EP8266? because i don't have the FTDI or another programming tool like you have..<br>Please Answer!</p><p>Thanks</p>
<p>When I tryed to verify the programming fonts.h library is missing. Where I can find this library?</p><p>Thank you!</p>
<p>In the mean time I solved!</p>
<p>hi limeg<br></p><p>how did you fixed it? I'm having the very same problem ...</p><p>Thanks!</p>
I think there's nothing wrong with that code. Because there is no 'fonts.h'! It just arduinoweatherfont.h! Am i right?<br>So, you can just change include parts. Umm. Can you help me please...my comment is under your comment.
<p>Hi solar767,</p><p>Sorry but I'm having a similar problem, trying to use 1,3&quot; OLED with ESP01, no luck for the moment, ... </p>
<p>sorry, cannot find arduinoweatherfont.h anywhere, may you please let me know the library name?</p><p>thanks!</p>
In the middle of this site, there is a link called &quot;Arduino code&quot; that links to github. View code&gt; Example&gt; WeatherStationDemoExtended In this way, you will see the h file I mentioned. Was this a solution?
Ah, you must set &quot;view all level&quot;
<p>Now I'm on the same page as you. I can see the Weather data downloaded but it is not shown in the Display. I have found this info:</p><p>http://www.waveshare.com/wiki/1.3inch_OLED_(A)</p><p>similar the adafruit link you posted below. I'm using SH1106 with I2C and ESP8266-01. As I understand</p><p>SDA - GPIO0</p><p>SDC - GPIO2</p><p>CS should go to Low</p><p>RES not sure </p><p>DC or SA0 not sure either</p><p>Rgds<br></p>
<p>Oh, I have same problem too. I donno why my board still not working. It worked even until yesterday ...</p>
<p>Finally managed to do it with a D1 Mini instead, with this connections taken from examples:</p><p>/* ######################################<br> * Hardware Wemos D1 mini SPI pins<br> D5 GPIO14 CLK - D0 pin OLED display<br> D6 GPIO12 MISO (DIN) - not connected<br> D7 GPIO13 MOSI (DOUT) - D1 pin OLED display<br> D1 GPIO5 RST - RST pin OLED display<br> D2 GPIO4 DC - DC pin OLED<br> D8 GPIO15 CS / SS - CS pin OLED display<br>#########################################</p><p>and the following libraries (just in case it helps):</p><p>#include &lt;Wire.h&gt;<br>#include &lt;SPI.h&gt;<br>#include &lt;SH1106Spi.h&gt;<br><br>#include &lt;OLEDDisplayFonts.h&gt;<br>#include &lt;OLEDDisplayUi.h&gt;</p><p>I also sorted out the icons issue. I was having quite a big mess with the libraries. It would be great to have SH1106 examples with ESP8266. </p><p>Many thanks to everybody!</p>
<p>Also tested with ESP-07, same connections as with the D1 Mini and</p><p>// Pin definitions for SPI<br>// ESP8266 -07<br>#define OLED_RESET 5 // RESET<br>#define OLED_DC 4 // Data/Command<br>#define OLED_CS 15 // Chip select</p><p>Just in case it helps!!!!!</p>
<p>The cause was simple. Just change the pin number. SDA is connected to D1, SCL is connected to D2, and if you change the pin setting of the code (the time display is strange and the weather is not displayed correctly). I live in Seoul and the quality of the service provided by Wunderground is not good.</p>
Yes, I solved! You must open all files in the arduino IDE. (ino, font.h, ...)
<p>thanks limeg, I got it thanks to solar767, now I do not get anything in the display, most probably because I'm using SH1106 together with ESP01, many thanks once more</p>
I'm glad you solved!
<p>I finally managed to make it work with the sh1106 library from Renemt</p><p><a href="https://github.com/rene-mt/esp8266-oled-sh1106" rel="nofollow">https://github.com/rene-mt/esp8266-oled-sh1106</a></p><p>and a D1 Mini but the icons do not look good even when using the WeatherStationfonts.h, any ideas why?</p><p>thanks once more</p>
How can i use &quot;adafruit 1.3&quot; SPI 128*64 oled&quot;? This oled can change controll interface. I just changed this controll interface SPI to I2C! But in adafruit use more pin. <br>https://learn.adafruit.com/monochrome-oled-breakouts/wiring-1-dot-3-128x64<br><br>This is url. That will be more help!<br>So, How can i connect with Nodemcu and that oled? And How to do I Change this code?<br>(Sorry, i can't speak english well)
<p>Cool, got it going.</p><p>Now for a cool custom case!</p><p>and a DS18b20...</p>
<p>Adding DS18B30 temperature device:</p><p>/*</p><p>Parts by Daniel Eichhorn</p><p>Permission is hereby granted, free of charge, to any person obtaining a copy</p><p>of this software and associated documentation files (the &quot;Software&quot;), to deal</p><p>in the Software without restriction, including without limitation the rights</p><p>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</p><p>copies of the Software, and to permit persons to whom the Software is</p><p>furnished to do so, subject to the following conditions:</p><p>The above copyright notice and this permission notice shall be included in all</p><p>copies or substantial portions of the Software.</p><p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</p><p>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</p><p>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</p><p>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</p><p>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</p><p>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</p><p>SOFTWARE.</p><p>*/</p><p>#include &lt;JsonListener.h&gt;</p><p>#include &lt;ESP8266WiFi.h&gt;</p><p>#include &quot;ssd1306_i2c.h&quot;</p><p>#include &quot;Wire.h&quot;</p><p>#include &quot;WundergroundClient.h&quot;</p><p>#include &quot;fonts.h&quot;</p><p>#include &lt;Ticker.h&gt;</p><p>#include &quot;TimeClient.h&quot;</p><p>#include&lt;stdlib.h&gt;</p><p>#include &lt;OneWire.h&gt;</p><p>#include &lt;DallasTemperature.h&gt;</p><p>// Initialize the oled display for address 0x3c</p><p>// sda-pin=14 and sdc-pin=12</p><p>// SSD1306 display(0x3c, D6, D5); // for Node MCU</p><p>SSD1306 display(0x3c, 0, 2); // for ESP8266-01 - [ADDRESS, SDA, SCL]</p><p>// Set to false, if you prefere imperial/inches, Fahrenheit</p><p>WundergroundClient wunderground(true);</p><p>float utcOffset = 9.5; // enter your UTC</p><p>TimeClient timeClient(utcOffset);</p><p>// Add your wounderground api key here</p><p>String apiKey = &quot;abcdefghijklmnop&quot;;</p><p>String country = &quot;AU&quot;;</p><p>String city = &quot;Adelaide&quot;;</p><p>// this array keeps function pointers to all frames</p><p>// frames are the single views that slide from right to left</p><p>///void (*frameCallbacks[])(int x, int y) = {drawFrame1, drawFrame2, drawFrame3, drawFrame4};</p><p>void (*frameCallbacks[])(int x, int y) {drawFrame1, drawFrame2, drawFrame3, drawFrame4};</p><p>int numberOfFrames = 4;</p><p>//void (*frameCallbacks[])(int x, int y) {drawFrame1, drawFrame2, drawFrame3, drawFrame4, drawFrame5};</p><p>//int numberOfFrames = 5;</p><p>// flag changed in the ticker function every x minutes: Adjust &quot;ticker.attach(x * 60, setReadyForWeatherUpdate);&quot; -line 109</p><p>bool readyForWeatherUpdate = false;</p><p>String lastUpdate = &quot;--&quot;;</p><p>Ticker ticker;</p><p>#define ONE_WIRE_BUS 2</p><p>// (try to avoid using pin D0, i faced some problems when i use pin D0)</p><p>// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)</p><p>OneWire oneWire(ONE_WIRE_BUS);</p><p>// Pass our oneWire reference to Dallas Temperature. </p><p>DallasTemperature sensors(&amp;oneWire); // constructor for our DS18B20 sensor to read temperature using DallasTemperature libary</p><p>//char buffer[10];</p><p>char buffer[5];</p><p>float temperatureDegC = -127;</p><p>void setup() {</p><p> Serial.begin(115200);</p><p> // initialize dispaly</p><p> display.init();</p><p> display.clear();</p><p> display.display();</p><p> WiFi.begin(&quot;SSID&quot;, &quot;Password&quot;);</p><p> sensors.begin(); // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)</p><p> int counter = 0;</p><p> while (WiFi.status() != WL_CONNECTED) {</p><p> delay(500);</p><p> Serial.print(&quot;.&quot;);</p><p> counter++;</p><p> }</p><p> display.setFrameCallbacks(numberOfFrames, frameCallbacks);</p><p> // how many ticks does a slide of frame take?</p><p> display.setFrameTransitionTicks(10);</p><p> // how many ticks should we wait until the next transition begins?</p><p> display.setFrameWaitTicks(150);</p><p> timeClient.updateTime();</p><p> wunderground.updateConditions(apiKey, country, city);</p><p> wunderground.updateForecast(apiKey, country, city);</p><p> lastUpdate = timeClient.getFormattedTime();</p><p> ticker.attach(120 * 60, setReadyForWeatherUpdate);</p><p>}</p><p>void loop() {</p><p> if (readyForWeatherUpdate &amp;&amp; display.getFrameState() == display.FRAME_STATE_FIX) {</p><p> timeClient.updateTime();</p><p> wunderground.updateConditions(apiKey, country, city);</p><p> wunderground.updateForecast(apiKey, country, city);</p><p> readyForWeatherUpdate = false;</p><p> lastUpdate = timeClient.getFormattedTime();</p><p> }</p><p> sensors.requestTemperatures(); // Send the command to DS18B20 to get temperatures</p><p> temperatureDegC = sensors.getTempCByIndex(0); </p><p> display.clear();</p><p> display.nextFrameTick();</p><p> display.display();</p><p>}</p><p>void drawFrame1(int x, int y) {</p><p> display.setTextAlignment(TEXT_ALIGN_CENTER);</p><p> display.setFont(ArialMT_Plain_10);</p><p> String date = wunderground.getDate();</p><p> int textWidth = display.getStringWidth(date);</p><p> display.drawString(64 + x, 10 + y, date);</p><p> display.setFont(ArialMT_Plain_24);</p><p> String time = timeClient.getFormattedTime();</p><p> textWidth = display.getStringWidth(time);</p><p> display.drawString(64 + x, 20 + y, time);</p><p> display.setTextAlignment(TEXT_ALIGN_LEFT);</p><p>}</p><p>void drawFrame2(int x, int y) {</p><p> display.setFont(ArialMT_Plain_10);</p><p> display.drawString(64 + x, 10 + y, wunderground.getWeatherText());</p><p> display.setFont(ArialMT_Plain_24);</p><p> String temp = wunderground.getCurrentTemp();</p><p> display.drawString(64 + x, 20 + y, temp);</p><p> int tempWidth = display.getStringWidth(temp);</p><p> display.setFont(Meteocons_0_42);</p><p> String weatherIcon = wunderground.getTodayIcon();</p><p> int weatherIconWidth = display.getStringWidth(weatherIcon);</p><p> display.drawString(32 + x - weatherIconWidth / 2, 10 + y, weatherIcon);</p><p> display.drawString(64 + tempWidth + x, 15 + y, &quot;*&quot;);</p><p>}</p><p>void drawFrame3(int x, int y) {</p><p> display.setTextAlignment(TEXT_ALIGN_CENTER);</p><p> display.setFont(ArialMT_Plain_10);</p><p> display.drawString(32 + x, 0 + y, &quot;Humidity&quot;);</p><p> display.drawString(96 + x, 0 + y, &quot;Pressure&quot;);</p><p> display.drawString(32 + x, 28 + y, &quot;Precipit.&quot;);</p><p> display.drawString(96 + x, 28 + y, &quot;Inside&quot;);</p><p> display.setFont(ArialMT_Plain_16);</p><p> display.drawString(32 + x, 10 + y, wunderground.getHumidity());</p><p> display.drawString(96 + x, 10 + y, wunderground.getPressure());</p><p> display.drawString(32 + x, 38 + y, wunderground.getPrecipitationToday());</p><p> display.drawString(96 + x, 38 + y, dtostrf(temperatureDegC,3,1,buffer));</p><p> //display.drawRect(64 + x, 0 + y, 0, 54);</p><p> //display.drawRect(0 + x, 27 + y, 128, 0);</p><p> //display.drawString(64 + x, + y, lastUpdate);</p><p>}</p><p>void drawFrame4(int x, int y) {</p><p> drawForecast(x, y, 0);</p><p> drawForecast(x + 44, y, 2);</p><p> drawForecast(x + 88, y, 4);</p><p>}</p><p>/*void drawFrame5(int x, int y) {</p><p> drawForecast(x, y, 2);</p><p> drawForecast(x+44, y, 2);</p><p> display.setTextAlignment(TEXT_ALIGN_CENTER);</p><p> display.setFont(ArialMT_Plain_10);</p><p> display.drawString(88 + x, 0 + y, &quot;Hello&quot;);</p><p>}</p><p>void drawFrame6(int x, int y) {</p><p> drawForecast(x, y, 4);</p><p>}*/</p><p>void drawForecast(int x, int y, int dayIndex) {</p><p> display.setTextAlignment(TEXT_ALIGN_CENTER);</p><p> display.setFont(ArialMT_Plain_10);</p><p> String day = wunderground.getForecastTitle(dayIndex).substring(0, 3);</p><p> day.toUpperCase();</p><p> display.drawString(x + 20, y, day);</p><p> display.setFont(Meteocons_0_21);</p><p> display.drawString(x + 20, y + 15, wunderground.getForecastIcon(dayIndex));</p><p> display.setFont(ArialMT_Plain_16);</p><p> display.drawString(x + 20, y + 37, wunderground.getForecastLowTemp(dayIndex) + &quot;/&quot; + wunderground.getForecastHighTemp(dayIndex));</p><p> //display.drawString(x + 20, y + 51, );</p><p> display.setTextAlignment(TEXT_ALIGN_LEFT);</p><p>}</p><p>void drawFrame7(int x, int y) {</p><p>}</p><p>void setReadyForWeatherUpdate() {</p><p> //Serial.println(&quot;Setting readyForUpdate to true&quot;);</p><p> readyForWeatherUpdate = true; </p><p>}</p>
Proof it is easy to overlook the obvious. you are 100 percent correct. i changed city to NC and it is perfect. this happens sometimes because i am 50 years a hardware guy and 5 years an arduino guy. i just kept propagating the error like a zombie. thank you for pointing out my error.<br>again thanks, the next pint is on me.<br>dave
ok i had a few on last post. what i was trying to say is no change. compile loads and same. i up graded to ide 1.8.1 and same. no data. my api number is good. the time data from NIST is perfect so i am on the net.<br>my serial mon info:<br><br>.16:27:04<br>16:27:4<br>59224<br>Requesting URL: /api/4251c2bfd51169f3/conditions/q/US/Charlotte.json<br>start document<br>Requesting URL: /api/4251c2bfd51169f3/forecast10day/q/US/Charlotte.json<br>start document<br>
So you are not getting what I posted (image with one of my precious posts) in serial monitor! <br>Does it work with AU and Adelaide, for example?<br>Also, for USA, you need to use YOUR state, NOT &quot;US&quot;. THIS HAS BEEN COVERED A FEW TIMES HERE ALREADY! So, the answer was here all along.
located correct onewire lib for esp8266. they removed it from the esp bundled core. now i compile with no errors, your original code, still no data. grrrrr<br>i got blisters on my brain cells<br>d
<p>Sorry. I cannot follow you logic:</p><p>&quot;now i compile with no errors&quot;, when 2 days ago; &quot;compiles great uploads and runs no errors&quot;,</p><p>&quot;the serial monitor never displays any data just a few numbers then something, 'start document, then something else, 'start document, then nothing more. no data no nothing&quot;, but 2 days ago; &quot;the serial monitor says starting document twice. conditions and forecast&quot;.</p><p>Post a picture of what you a saying. It will be much more clearer for us to help.</p><p>But, if you are not seeing the forecast in Serial Monitor similar to the attached image, your API is NOT working.</p>
thank you for replies.<br>the library seems to be fine. display works fine.<br><br>the 4 frames are:<br>1 correct updating time, no date, the left page dot is larger<br>2 N/A with C and degree symbol. 2nd page dot larger.<br>3 &quot;humidity, pressure, precipit. and inside&quot; displayed. no numbers or other data just the 4 words<br>frame 4, 3 evenly space &quot;NA: with a / below.. no sybols, numbers, 4th dot large.<br>sequence repeats..<br>the serial monitor never displays any data just a few numbers then something, &quot;start document, then something else, &quot;start document, then nothing more. no data no nothing.<br>thats it.<br>i did comment out the 2 libraries for the sensor and lines 71-88. i think i may have messed up the buffers by doing that.<br>i added them back but am getting bitmask errors from the onewire lib. more if i find something, <br>dave
<p>after 8 days i am out of ideas. i gave up on debas code 4 days ago. loaded your code compiles great uploads and runs no errors. time displays perfect. no other data but the frames are there, n/a where data is supposed to be. i know my api, state and city work because it works fine from browser inquiry. i am not using temp sensor yet. the serial monitor says starting document twice. conditions and forecast. i login to wunderground and analytics shows i am hitting it without error. ideas? </p>
<p>I wonder if the display library has changed?</p>
<p>Hmmm. You must be so close!</p><p>If you can display something and get the data via the serial monitor, then it should work. Does it show &quot;Humidity&quot;, &quot;Pressure&quot;, etc on frame 3?</p><p>Not using the temp sensor should not cause any problems, but will display &quot;inside&quot; temp as &quot;-127&quot;. Does it show -127?</p><p>When you spend so much time on something, it can get very frustrating and you might miss something simple. You need to &quot;walk away&quot; from it for a while and try it later on.</p><p>Keep us informed.</p><p>Good luck!</p>
<p>Congratulations !</p><p>Thanks for sharing the pics :)</p>
<p>Hi, I tried to compile your code after adding the library in the include library option..however I ended up with futile attempts of making it work...The Arduino 1.6.4 couldn't compile it at all..I have attached a pic of my Arduino editor...please reply at your earliest convenience... </p>
<p>It's the extra semi-colon after #include &quot;fonts.h&quot;</p>
<p>Hi Peter, thanks for your prompt feedback...however after the tweaking the problem I tried to make it compile but still it's not done... I haven't changed the original code except my WI-Fi router SSID, PASSWORD, my country and city name and of-course my API key...Please have a look at the photo attached with this comment </p>
<p>It would be better if you showed the compilation error of the IDE in your image.</p><p>One error that I can see is referred to by <a href="https://www.instructables.com/member/RodriC1" rel="nofollow">RodriC1</a> in the comments: Remove the = from void (*frameCallbacks[])(int x, int y) = {drawFrame1, drawFrame2, drawFrame3, drawFrame4};</p><p>to make it:</p><p>void (*frameCallbacks[])(int x, int y) {drawFrame1, drawFrame2, drawFrame3, drawFrame4};</p><p>Please check all the comments, as many of the issues have already been addressed. Good luck!</p>
<p>By the way, it is not my code, it is by <a href="https://www.instructables.com/member/deba168/" rel="nofollow">deba168</a>, although, I have added a DS18B20 to it in the comments.</p>
<p>I have SDA -&gt; GPIO0 and SCL -&gt; GPIO2</p><p>and lots of decoupling capacitance!</p><p>To flash: GPIO0 -&gt; GND and had to re-power &amp; &quot;Upload&quot; quite a few times before it worked. You get dots then info. in a Serial Monitor</p>
<p>Wow cool ! Congratulations :)</p><p>Thanks for sharing the pics.I am eagerly waiting for your custom case.</p>
<p>I cannot get API from the website.<br><a href="https://www.wunderground.com/weather/api?MR=1">https://www.wunderground.com/weather/api?MR=1</a><br><br>Please! help.</p>
<p>You must apply for the free API. Fairly easy to do. Once you have an account you can test it with this command:</p><p>http://api.wunderground.com/api/&lt;YOUR_API KEY&gt;/forecast10day/q/TX/Dallas.json</p><p>The state is TX and the city in this case is Dallas. It should return a fairly detailed JSON text file. </p>
<p>Look under the KEY SETTINGS TAB and PURCHASE KEY. The Free one is just that $0.00 but you still need to use the form to purchase it. </p>
<p>Thank!</p>

About This Instructable

144,372views

909favorites

License:

Bio: I am an Electrical Engineer.I love to harvest Solar Energy and make things by recycling old stuffs. I believe &quot;&quot;IF YOU TRY YOU MIGHT ... More »
More by deba168:Solar Powered WiFi Weather Station  3 Useful Things From an Old Laptop DIY Mobile Boombox 
Add instructable to: