ESP8266 Projects: Internet Connected WeatherStation with beautiful icons

Do you like this post? Writing posts, developing libraries and programming online font creators is actually hard work. I order most of my electronics from a Chinese website called Banggood. It is save and the items usually arrive in good quality. With every order you do there by following this link you are supporting the blog. Thank you!

Since I learned how to create pictures and display them on these wonderful OLED displays I wanted to build something useful with it. Once you know about all the pieces, putting them together is quite easy.
The icon, temperature and humidity are updated every 10 minutes from http://openweathermap.org/, then parsed into a JSON object.

SSD1306 128×64 with the web based weather station.
The data is fetched from openweatherchannel.com.
It also displays the last update time. 

Wiring

Source Code

By the way, the WeatherStation Kit is available at the shop: https://shop.squix.ch

Posted by squix78

22 comments

  1. Hi Dani

    Thanks for this nice little project and yes I agree with Mike great blog.

    Wiring up this project I had two problems I couldn't fix myself perhaps you can help:
    – The IP of the api.openweathermap.org is a fixed no in the script and not as a domain. This require always to change when they change there IP – Which had obviously happened since you published this project

    – The time runs over 24 and shows 24:xx:yy isntead of 00:xx:yy

    some hints would be warmly welcome

    Stefan

    • Hi Samuel

      Sure, just change these two parts in weatherStation.lua: "units=metric" to "units=imperial" and replace the "C" charachter with an "F" in the display function

    • Hi Dani

      Thanks for helping me! Also, when I tried to download ESPlorer, an error popped up saying that the file is invalid, and I cannot open it. Do you know how to work around this?

      Thanks, Samuel

  2. Hi,
    bin absoluter Anfänger, wollte das ganze aber mal probieren.
    Ich hänge jetzt allerdings bei "Save to ESP". Der Button ist bei mir ausgegraut. ESP ist per USB angeschlossen. Fehlt da ein Treiber?

    • Das ist möglich, dass ein Treiber fehlt. Hast Du auf der rechten Seite einen Com-Port aus der Drop-Down-Liste ausgewählt und danach "Open" gedrückt? Du musst Dich zuerst mit dem Device via Serielle Schnittstelle verbinden…

  3. Hello,

    I was working on the project today, and I got init.lua loaded to the NodeMCU, but I cannot get it to upload the .MONO and weatherStation.lua files. It prints out,
    PANIC: unprotected error in call to Lua API (cannot open weatherstation.lc)
    PANIC: unprotected error in call to Lua API (attempt to call a string value)
    And when I try to upload the .MONO and weatherStation.lua files, it says
    Waiting answer from ESP – Timeout reached. Command aborted

    Can anyone help?

    Thanks, Samuel

  4. I think the problem may be the order you are loading files into the ESP..

    You want to load init.lua last, so it doesn't start trying to run things that aren't there yet. Load all the .mono files first. Then I would probably rename init.lua to something like test .lua and load it. Then run test.lua to make sure everything works. Once your are sure then load init.lua

    • I did that and it seems to kind of be working, but the OLED has a bunch of tiny white dots all over it. Is there a problem with my OLED or something?

      Thanks, Samuel

  5. Hi.
    That's a very good idea you had.
    I thought that for me, a weather forecast would be more useful, so I implemented it.
    It has an AP mode for configuration and scrolls the forecasts on the OLED 3 at a time.
    You can find the code and Eagle schematics at https://github.com/DonJuanito99/ESP8266/tree/master/MeteoESP
    I had to use a custom build of NodeMCU to free enough heap.
    I borrowed most of the icons (converted to 30×30) and some of your code. I hope you don't mind 😉
    Thanks again for your idea and code…
    – Juan –

  6. Hi.
    That's a very good idea you had.
    I thought that for me, a weather forecast would be more useful, so I implemented it.
    It has an AP mode for configuration and scrolls the forecasts on the OLED 3 at a time.
    You can find the code and Eagle schematics at https://github.com/DonJuanito99/ESP8266/tree/master/MeteoESP
    I had to use a custom build of NodeMCU to free enough heap.
    I borrowed most of the icons (converted to 30×30) and some of your code. I hope you don't mind 😉
    Thanks again for your idea and code…
    – Juan –

  7. Mine displays upside down. IF I enable display.flipScreenVertically(); it only works for " display.drawString(64, 10, "Connecting to WiFi");" after that, it flips back

  8. Hi Dani,
    Thank you for your great work! I havn’t seen anything even close to what you have done on oled display.
    Just one question: is it possible to hide or remove the Indecator?

    Best regards

Leave a Reply