MIT License

项目介绍

AbnormalDistributions/e_paper_weather_display 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 449 个 Star、35 次 Fork。

仓库全名
AbnormalDistributions/e_paper_weather_display
开源许可证
MIT License
Star 数
449
Fork 数
35
未关闭 Issue
3

README 摘要

E-paper Weather Display This project uses a Raspberry Pi to show weather updates and trash reminders on a Waveshare 7.5-inch e-paper display. It fetches weather data from OpenWeatherMap and refreshes the display at set intervals. Minimal energy consumption makes this setup ideal for continuous display without frequent updates. If you find this project useful, consider buying me a coffee ☕️. Table of Contents What’s…

完整内容见 GitHub 原始 README 或本页 。

常见问题

e_paper_weather_display 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 449 个 Star。

e_paper_weather_display 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 e_paper_weather_display 的源码?

可以直接克隆仓库:git clone https://github.com/AbnormalDistributions/e_paper_weather_display.git,默认分支为 master;安装与运行步骤见仓库 README。

e_paper_weather_display 最近还在维护吗?

仓库最近一次更新为 2024年11月4日,当前有 3 个未关闭 Issue;Star 数为 449,可作为社区活跃度的参考。

关于

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

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
541
价值分
281
活跃状态
活跃

语言占比

Python

Release

  • v2.02024年11月4日
  • v1.72020年10月8日
  • v1.62020年9月29日
  • v1.52020年9月28日
  • v1.42020年9月26日

README

E-paper Weather Display

This project uses a Raspberry Pi to show weather updates and trash reminders on a Waveshare 7.5-inch e-paper display. It fetches weather data from OpenWeatherMap and refreshes the display at set intervals. Minimal energy consumption makes this setup ideal for continuous display without frequent updates.

Display Photo 1 Display Photo 2

If you find this project useful, consider buying me a coffee ☕️.


Table of Contents

What’s New (Version 2.0)

  • Upgraded to OpenWeatherMap One Call API 3.0: This update now uses the latest version of the OpenWeatherMap API (3.0), which may require users to update their subscriptions if they were previously using version 2.5. See the OpenWeatherMap One Call Migration Guide for details on the API changes and subscription requirements.
  • Automatic Log Management: Logs now rotate when they get too large, making maintenance easier.
  • User-Friendly Settings: All essential settings are grouped together for quick customization.
  • More Reliable Error Handling: Logs network and API errors for easier troubleshooting.
  • Improved Directory Handling: The script finds the right directories automatically, without manual path adjustments.
  • Trash Day Reminders: Customize specific days to get reminders on the display.

Parts List

  • Waveshare 7.5-inch e-Paper HAT: Available on Amazon (affiliate link).
  • Raspberry Pi (tested on a Pi 3; any model should work except the Pi Zero without soldered headers).
  • SD card (at least 8 GB).
  • Power supply for the Raspberry Pi.
  • 5 x 7 inch photo frame (thrift store find recommended).

Note: If you use this affiliate link, it helps support this project at no additional cost to you. Thank you!

Setup Instructions

Installation

  1. Clone the Project: Open a terminal and run:

    git clone https://github.com/AbnormalDistributions/e_paper_weather_display.git
    cd e_paper_weather_display
    
  2. Install Python Libraries:

    pip install pillow requests
    

Configuration

  1. Add Your OpenWeatherMap API Key: Sign up on OpenWeatherMap for an API key, then open weather.py and add your API key where it says API_KEY = 'XXXXXXXX'.

  2. Customize Your Settings: Edit the following user-defined settings at the top of weather.py:

    • API_KEY: Your OpenWeatherMap API key.
    • LOCATION: Name of the location to display (e.g., New Orleans).
    • LATITUDE and LONGITUDE: Coordinates for weather updates (use Google Maps to find these).
    • UNITS: Choose 'imperial' (Fahrenheit) or 'metric' (Celsius).
    • CSV_OPTION: Set this to True if you’d like to save a daily log of weather data in records.csv.
    • TRASH_DAYS: Add the days for trash reminders as numbers (0=Monday, 6=Sunday).

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 the appropriate version from Waveshare’s e-Paper library. Adjustments will be required for other screen sizes.

Running the Script

  1. To Run Manually: From the e_paper_weather_display directory, run:
    python weather.py
    
    This will fetch the weather data and update the display immediately.

Setting up Automatic Updates (Optional)

You can set up a scheduled update every 15 minutes using crontab. This will make sure your display updates automatically.

In the terminal, type:

crontab -e

Then, add the following line at the end of the file:

*/15 * * * * /usr/bin/python /home/pi/e_paper_weather_display/weather.py >> /home/pi/e_paper_weather_display/weather_display.log 2>&1
  • This command updates the display every 15 minutes.
  • Be sure to replace /home/pi/e_paper_weather_display/ with the path where the project is stored, if different.

Files in This Repository

  • weather.py: Main script file that fetches weather data and updates the display.
  • lib/: Contains display drivers for the Waveshare e-paper display.
  • font/ and pic/: Folders with fonts and images used by the display.
  • photos/: Sample images of the display in action.
  • records.csv: Optional log file for weather data if CSV_OPTION is enabled.

Troubleshooting

  • Make sure the API_KEY is correct and has permissions for OpenWeatherMap’s One Call API.
  • Confirm that required Python libraries (pillow and requests) are installed.
  • Double-check any custom paths used in crontab if the automatic updates aren’t working as expected.

Credit and License

评论

暂无评论