Coder Social home page Coder Social logo

abnormaldistributions / e_paper_weather_display Goto Github PK

View Code? Open in Web Editor NEW
274.0 21.0 26.0 3.12 MB

Raspberry Pi weather display using Waveshare e-paper display and Open Weather Map API

License: MIT License

Python 100.00%
weather waveshare python raspberry-pi raspberrypi epaper eink e-ink e-paper

e_paper_weather_display's Introduction

E-paper Weather Display


Raspberry Pi weather display using Waveshare e-paper 7.5 inch display, Open Weather Map API, and Python.


If you like what you see, consider buying me a coffee.

Versions

Version 1.0

  • Initial Commit.

Version 1.1

  • Switched to more legible icons.

Version 1.2

  • Added support for connection errors.
  • Added support for HTTP errors.
  • Added "dispay_error" fuction to display respective errors if present.

Version 1.3

  • Added option to store retreived weather data in CSV file.

Version 1.4

  • Updated to use all 480 vertical pixels instead of just 450.

Version 1.5

  • Fixed error where "TAKEOUT TRASH TODAY!" was writing in incorrect font size.

Version 1.6

  • Increased size of fonts for "Humidity" and "Wind" for better legibility.

Version 1.7

  • Added clear screen function to reduce possibility of burn-in.
  • Changed refresh time from 300 to 600 seconds.

Setup

  1. The first thing you need is a free API key from https://home.openweathermap.org/users/sign_up.
  2. Open 'weather.py' and replace **Key Here** with your API key.
  3. **Location** can be left as it is unless you want to add it to your display.
  4. Get your **longitude** and **lattitude** using I used https://www.latlong.net and put that in as well.
  5. Set CSV_OPTION to False if you would not like weather data appended to 'records.csv' after every refresh.
  6. There is also a reminder for taking out the trash near the end of the script that you will want to change if your trash pickup doesn't come on Monday and Thursday like mine. :)

That's about it. Run the python file and you should see output on the display.

Note

If you are not using a 7.5 inch Version 2 display, you will want to replace 'epd7in5_V2.py' in the 'lib' folder with whichever one you have from https://github.com/waveshare/e-Paper/tree/master/RaspberryPi_JetsonNano/python/lib/waveshare_epd
Fairly extensive adjustments will have to be made for other sized screens.

Parts

  • https://www.waveshare.com/wiki/7.5inch_e-Paper_HAT
  • Raspberry Pi 3, but this will run on any of them except the Pi Zero that doesn't have soldered headers.
  • SD card for the Pi at least 8 GB.
  • Power supply for the Pi.
  • 5 x 7 inch photo frame from a thrift store.

Credit

Icon designs are originally by [Erik Flowers] (https://erikflowers.github.io/weather-icons/). Some icons have been modified.

Licensing

e_paper_weather_display's People

Contributors

abnormaldistributions avatar mattmatters avatar ssyyl 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

e_paper_weather_display's Issues

Stops Updating

The display stops updating and it does not appear to be at any specific time. The code is still running, but the display as stopped getting the information. A quick ctrl+c and then the up arrow, enter and the code starts all over again and the display updates.

Do you have any idea what might be happening?
Thanks

Touch input

Hello, love this - thank you for sharing and documenting. Have you explored the touch functionality of the display at all - for user input? I'm interested in using this but struggling to find any docs. Thanks!

Stops Updating at 0300

I started anew with Bullseye and reinstalled the program using Git. Updated all of the required info in weather.py and have been running the script for a bout 4 days and every morning, the last update is just before 0300. Terminal states

Attempting to connect to OWM.
Connection to OWM successful.
Connection to Open Weather successful.
Weather data appended to CSV.
Clearning screen to avoid burn-in. (I just see there is a spelling mistake)

I stop the script and and restart and off it goes.

Is there something I should be looking at to see why the script stops at 0300?

Trash Day Issue

I realize this has nothing to do with the weather and the Trash Day is an add-on, but could someone explain how this actually works?

Unfortunately, where I live, the city changes the trash day each month due to the holiday or holidays in that month. I can change the script to match the movement of the trash day manually if I know how it works. Does the weekday == x or weekday == x depend on the day one saves the script?

## Add a reminder to take out trash
    weekday = datetime.today().weekday()
    if weekday == 2 or weekday == 2:
        draw.rectangle((345, 13, 705, 55), fill =black)
        draw.text((355, 15), 'TAKE OUT TRASH TODAY!', font=font30, fill=white)

Error with CSV and Changing units to Metric

Hi,

Thanks so much for building this code. I have purchased the e-Paper HAT and installed the code, but I am getting two issues:

  1. Traceback (most recent call last): File "weater.py", Line 145, in with open('records.csv', 'a', newline='') as csv_file: TypeError: 'newline' is an invalid keyword argument for this function and;
  2. If I change line 80 to 'Metric' it still shows Fahrenheit. Do I need to change this to Metric, then go through and change all references to 'F' to 'C'?

Thank you!

FileNotFoundError

Hi!

I keep getting those Errors:

Traceback (most recent call last):
File "/home/pi/Downloads/e_paper_weather_display-master/weather.py", line 12, in
from waveshare_epd import epd7in5_V2
File "lib/waveshare_epd/epd7in5_V2.py", line 32, in
from . import epdconfig
File "lib/waveshare_epd/epdconfig.py", line 146, in
implementation = RaspberryPi()
File "lib/waveshare_epd/epdconfig.py", line 50, in init
self.SPI = spidev.SpiDev(0, 0)
FileNotFoundError: [Errno 2] No such file or directory

Can someone help? I am a bit lost :(

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.