Giter Site home page Giter Site logo

ldritsas / inkyphat_weather Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 5.0 2.39 MB

python code to display current and near-term weather conditions on a an inky pHAT eInk screen

License: GNU General Public License v3.0

Python 100.00%
python3 raspberry-pi inkyphat weather darksky-api

inkyphat_weather's Introduction

inkyphat_weather

Python3 code to display current weather conditions on an Pimoroni Inky pHAT eInk screen using the OpenWeather API My installation is on a Raspberry Pi Zero W running headless. The screen will display the date, expected temperatures for the day, including the barometric pressure, dewpoint, wind speed, gusts and Beaufort scale numbers.

Note that this is not yet updated to the One Call API 3.0 I will do this soon.

UK units

Because I live in the UK, the units are a bit of a mix. Here we talk about temperature in Celcius, but windspeed in miles-per-hour. I've also incuded the temperature in Farhenheit units as well. The wind speed and directon are provided, then gust speeds. 'Bft.' refers to the Beaufort scale, and the wind description is also taken from the Beaufort Scale, this helps me plan activities on the water. 'dew' refers the dewpoint, which I prefer to relative humidity.

Acknowledgements

  • I took inspiration from Alan Cunningham's Inky pHAT Dark Sky weather display
  • The icons are based on Adam Whitcroft’s Climacons
    • I used Gimp to convert the Climacon images to the custom pallet that the inky pHAT requires and to make the sun icons yellow, which is a neat effect and why I bought a yellow Inky pHAT from Pimoroni
  • If you are new to the Inky pHAT, you should read the Pimoroni pages about it Getting Started with Inky pHAT

Dependencies and requirements

  • You will need to get an API key from OpenWeather and know your longitude and latitude
  • You will also need:
  • Inky pHAT library
  • Pillow imaging library
  • and the two resource folders, 'fonts' and 'weather_icons' need to be in the same directory as the main program.

Tips

  • On your own system you will need to edit the loction of the resource files (the fonts and icons) depending on where you put them). I found that I needed absolute links in the code to make it work properly.
  • I suggest creating a cron job that refreshes the screen every 10 minutes with new data. This is a lot simpler than it sounds, check here for guidance. I did not see any benefit to more frequent requests. OpenWeather updats every 10 minutes.

open_weather_today.py

image

License

GNU General Public License v3.0

inkyphat_weather's People

Contributors

ldritsas avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

inkyphat_weather's Issues

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.