Skip to content

A self‑contained Python 3 application that turns a Raspberry Pi Zero 2 W and a Waveshare 10.3″ IT8951 e‑paper HAT into an ultra‑low‑power framed weather dashboard.

License

Notifications You must be signed in to change notification settings

sjnims/rpi_weather_display

Repository files navigation

Ultra-Low-Power Weather Display

CI/CD codecov Python 3.11 License: MIT code style: ruff CodeQL Docker

A power-optimized weather display solution for Raspberry Pi Zero 2 W with e-paper display, designed to achieve 60-90 days of battery life on a single charge.

Weather Display Preview

Features

  • Ultra-low power consumption - 60-90 days battery life
  • E-paper display - Beautiful weather dashboard with current conditions and forecast
  • Async architecture - Non-blocking I/O operations for improved efficiency
  • Smart power management - Battery-aware scheduling and display updates
  • Server-client design - Offloads processing to server for minimal client power usage
  • Rich configuration - Highly customizable via YAML configuration
  • Modern Python - Type-safe code with 94%+ test coverage

Hardware Requirements

Client:

  • Raspberry Pi Zero 2 W
  • PiJuice Zero HAT
  • PiJuice 12,000 mAh LiPo battery
  • Waveshare 10.3″ 1872 x 1404 E-paper IT8951 HAT

Server:

  • Docker-capable Linux server (or Unraid)
  • ~500MB RAM, minimal CPU

Quick Start

# Client setup (Raspberry Pi)
git clone https://github.com/sjnims/rpi-weather-display.git
cd rpi-weather-display
sudo bash deploy/scripts/install.sh
sudo cp config.example.yaml /etc/rpi-weather-display/config.yaml
sudo nano /etc/rpi-weather-display/config.yaml  # Add your API key

# Server setup (Docker)
docker build -t rpi-weather-display-server .
docker run -d --name rpi-weather-display -p 8000:8000 \
  -v /path/to/config.yaml:/etc/rpi-weather-display/config.yaml \
  rpi-weather-display-server

Architecture

graph TD
    A[Raspberry Pi Zero 2 W] -->|Requests Image| B[Docker Server]
    B -->|Weather Data| C[OpenWeather API]
    A -->|Displays| D[E-Ink Display]
    A -->|Power Management| E[PiJuice HAT]
    B -->|Renders| F[Weather Image]
Loading

The server handles all computation-intensive tasks (API calls, rendering) while the client focuses on power-efficient display updates.

Configuration

Copy config.example.yaml to config.yaml and customize:

weather:
  api_key: "YOUR_OPENWEATHERMAP_API_KEY"  # Required
  city_name: "London"
  units: "metric"

display:
  refresh_interval_minutes: 30
  pressure_units: "hPa"  # or "mmHg", "inHg"

power:
  quiet_hours_start: "23:00"
  quiet_hours_end: "06:00"
  low_battery_threshold: 20

server:
  url: "http://your-server-ip"
  port: 8000

See config.example.yaml for all options.

Development

# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -

# Install dependencies
poetry install --with dev --extras server

# Run server
poetry run server --config config.yaml

# Run client
poetry run client --config config.yaml

# Run tests
poetry run pytest

# Preview in browser
http://localhost:8000/preview

Documentation

Project Structure

rpi-weather-display/
├── src/rpi_weather_display/
│   ├── client/        # Raspberry Pi client code
│   ├── server/        # FastAPI server code
│   ├── models/        # Pydantic data models
│   └── utils/         # Shared utilities
├── templates/         # Jinja2 HTML templates
├── static/           # CSS, fonts, icons
├── tests/            # Comprehensive test suite
└── deploy/           # Installation scripts

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Key requirements:

  • Python 3.11+
  • Type hints for all code
  • Tests for new functionality (maintain 94%+ coverage)
  • Follow existing code style

Acknowledgements

Special thanks to:

License

MIT License - see LICENSE file for details.

About

A self‑contained Python 3 application that turns a Raspberry Pi Zero 2 W and a Waveshare 10.3″ IT8951 e‑paper HAT into an ultra‑low‑power framed weather dashboard.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Languages