Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌦️ E-Paper Weather Station (LilyGo T5-4.7 S3)

A high-contrast, low-power weather dashboard built on the LilyGo T5-4.7 S3 E-Paper display. This project fetches real-time weather data and forecasts via MQTT, displays them using a custom 16-level grayscale UI, and enters deep sleep for extended battery life.

Dashboard Preview


✨ Features

  • Hardware: LilyGo T5-4.7 inch E-Paper Display (ESP32-S3, 960x540px)
  • Deep Sleep Architecture:
    • Active time: ~5 seconds per update
    • Sleep current: ~20Β΅A
    • Battery Life: Pretty long
  • Smart Forecast Window:
    • Morning (< 6:00): Shows today's 6:00, 14:00 & tomorrow's forecasts
    • Day (6:00-14:00): Shows today's 14:00 & full tomorrow
    • Evening (> 14:00): Shows full tomorrow & day after tomorrow
  • Custom Icons: 16-level grayscale weather icons optimized for E-Ink
  • Weather Data: Powered by BrightSky API (DWD Open Data)

πŸ—οΈ System Architecture

This is a two-part system:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  BrightSky API  │─────>β”‚ Python Script│─────>β”‚  MQTT Broker    β”‚
β”‚  (DWD Data)     β”‚ JSON β”‚(Home Server) β”‚ JSON β”‚  (Mosquitto)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                        β”‚
                                                        β”‚  Subscribe
                                                        ↓
                                                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                                β”‚  LilyGo T5-4.7 β”‚
                                                β”‚  ESP32-S3      β”‚
                                                β”‚  E-Paper       β”‚
                                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Part 1: Backend (Home Server)

Prerequisites

  • Python 3.x
  • Libraries: paho-mqtt, requests
  • A 24/7 device (Raspberry Pi, NAS, home server)

JSON Data Contract

Your Python script must publish a retained message to topic home/weather/display:

{
  "update_ts": "2026-02-06T08:00:00",
  "current": {
    "ts": "2026-02-06T08:00:00+01:00",
    "temp": 4.5,
    "humi": 80,
    "wind": 15.0,
    "wind60": 14.2,
    "rain": 0.0,
    "rain_probability": 0,
    "cloudco": 20,
    "dew_point": 2.0,
    "icon": "partly-cloudy-day"
  },
  "forecast": [
    {
    "ts": "2026-02-06T08:00:00+01:00",
    "temp": 4.5,
    "humi": 80,
    "wind": 15.0,
    "wind60": 14.2,
    "rain": 0.0,
    "rain_probability": 0,
    "cloudco": 20,
    "dew_point": 2.0,
    "icon": "partly-cloudy-day"
    }
  ]
}

Key Points:

  • Use ISO 8601 timestamps
  • Include at least 6 forecast items (mix of 6:00 and 14:00 preferred)
  • Set retain flag to true on MQTT publish

Weather Data Source

This project uses the BrightSky API (free, open-source, DWD weather data for Germany):

import requests

# Example: Fetch weather for Munich
url = "https://api.brightsky.dev/weather"
params = {
    "lat": 48.1351,
    "lon": 11.5820,
    "date": "2026-02-06"
}

response = requests.get(url, params=params)
data = response.json()

Documentation: https://brightsky.dev/docs/

Automation

  • Use cron to run your script every 60 minutes:
*/60 * * * * /usr/bin/python3 /path/to/main.py

πŸ“Ÿ Part 2: ESP32 Firmware

Hardware Required

  • LilyGo T5-4.7 S3 (E-Paper V2.3+)
  • LiPo Battery (3.7V, PH 2.0 connector)
  • USB-C Cable

Installation

1. Clone the Repository

git clone https://github.com/christianhermann/weatherDisplay.git
cd weatherDisplay

2. Install PlatformIO

Install the PlatformIO extension for VS Code.

3. Configure Secrets

Create source/secrets.h:

#ifndef SECRETS_H
#define SECRETS_H

const char* WIFI_SSID     = "YourWiFiName";
const char* WIFI_PASS     = "YourPassword";
const char* MQTT_SERVER   = "192.168.1.X";
const int   MQTT_PORT     = 1883;
const char* MQTT_USER     = "mqtt_user";
const char* MQTT_PASS     = "mqtt_password";
const char* MQTT_TOPIC    = "home/weather/display";

#endif

4. Upload Firmware

  • Connect via USB
  • If upload fails: Hold BOOT β†’ Press RST β†’ Release BOOT
  • Click PlatformIO: Upload

Dependencies (Auto-installed)


🎨 Customizing Icons

Icons are stored as 4-bit grayscale bitmaps in weather_icons.h.

Supported Icons

  • clear-day, clear-night
  • partly-cloudy-day, partly-cloudy-night
  • cloudy, fog, wind
  • rain, sleet, snow, hail, thunderstorm

Adding New Icons

1. Place 256x256 transparent PNGs in assets/icons/

2. Run processing scripts:

python3 /python/Icons/addPadding.py  # Adds 15px padding
python3 /python/Icons/convertToGrayscale.py  # converts to grayscale
python3 /python/Icons/createHeaders.py  # Converts images to C header

3. Update weather_icons.h


πŸ”‹ Battery Life

Update Interval Consumption/Day Battery Life (2000mAh)
30 minutes ~8.4 mAh ~7.5 months
60 minutes ~4.5 mAh ~14.5 months

Based on 5-second wake time, 20Β΅A sleep current


πŸ“‚ Project Structure

weatherDisplay/
β”‚
β”œβ”€β”€ assets/ # Documentation & icon assets
β”‚ β”œβ”€β”€ preview.jpg # Screenshot of the display
β”‚ └── icons/ # Weather icon source files
β”‚ └── Grayscale/ # Processed 16-level grayscale versions
β”‚ 
β”‚
β”œβ”€β”€ Python/ # Backend scripts
β”‚ β”œβ”€β”€ Icons/ # Icon processing tools
β”‚ β”‚ β”œβ”€β”€ addPadding.py # Adds 15px padding to icons
β”‚ β”‚ β”œβ”€β”€ convertToGrayscale.py # Converts transparent PNGs to E-Ink format
β”‚ β”‚ └── createHeaders.py # Generates C header files from images
β”‚ β”‚
β”‚ └── WeatherData/ # Weather fetching & MQTT publishing
β”‚ β”œβ”€β”€ main.py # Main entry point for weather fetch script
β”‚ β”œβ”€β”€ exportWeatherData.py # Fetches data from BrightSky API
β”‚ β”œβ”€β”€ importWeatherData.py # Publishes JSON to MQTT broker
β”‚ └── .env # MQTT credentials
└── LilyGo-EPD47/ # ESP32 firmware
└── src/
  β”œβ”€β”€ main.cpp # Entry point, setup, loop & deep sleep
  β”œβ”€β”€ network_management.cpp # WiFi, MQTT subscribe & JSON parsing
  β”œβ”€β”€ network_management.h # Weather data structs & prototypes
  β”œβ”€β”€ ui_layout.cpp # E-Ink drawing functions
  β”œβ”€β”€ weather_icons.h # Icon bitmaps
  β”œβ”€β”€ icon_display.h # Icon lookup helpers
  β”œβ”€β”€ firasans.h # FiraSans font
  β”œβ”€β”€ opensans8b.h # OpenSans 8pt Bold font
  β”œβ”€β”€ opensans10b.h # OpenSans 10pt Bold font
  β”œβ”€β”€ digits_48pt.h # Large digit font for temperature
  └── secrets.h # WiFi/MQTT credentials

Key Components

Component Purpose
Python/WeatherData/ Backend scripts that fetch weather from BrightSky API and publish to MQTT
Python/Icons/ Tools to process icon PNGs into E-Ink compatible C headers
LilyGo-EPD47/src/ ESP32 firmware that subscribes to MQTT, renders UI, and sleeps
assets/icons/ Source PNG files and processed grayscale versions

Workflow

  1. Icon Processing: addPadding.py β†’ convertToGrayscale.py β†’ createHeaders.py β†’ weather_icons.h
  2. Data Pipeline: exportWeatherData.py β†’ importWeatherData.py β†’ MQTT Broker β†’ ESP32
  3. Display Update: ESP32 wakes β†’ fetches MQTT β†’ ui_layout.cpp renders β†’ deep sleep

πŸ“œ License

MIT License - Free to use, modify, and distribute.

About

E-Paper Weather Station

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages