Skip to content

About

A ESP32 + E-ink display for my thermostat

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Lorx Display - ESP32 E-ink Monitor

A Rust embedded application for ESP32 that fetches room data from an API and displays it on a connected e-ink display.

Features

  • 🌐 WiFi connectivity with automatic reconnection
  • 📡 HTTP API data fetching with TLS support
  • 🖥️ E-ink (e-paper) display support (Waveshare 2.13" v2)
  • ⚡ Deep sleep mode for power efficiency (10-minute intervals)
  • 🛡️ Robust error handling with graceful degradation
  • 📝 Clear error messages displayed on screen

Hardware Requirements

  • ESP32 microcontroller
  • Waveshare 2.13" e-ink display (v2)
  • Proper wiring for SPI communication (see pin configuration below)

Pin Configuration

Function GPIO Pin
SPI SCK GPIO 18
SPI MOSI GPIO 23
SPI CS GPIO 33
EPD BUSY GPIO 22
EPD DC GPIO 17
EPD RST GPIO 16
LED GPIO 2

Setup

1. Environment Configuration

Copy the example environment file:

cp .env.example .env

Edit .env and set your values:

SSID="YourNetworkName"
PASSWORD="YourNetworkPassword"
API_URL="http://192.168.0.30/api/current"

⚠️ Important: Never commit your .env file with real credentials!

2. Build and Flash

# Build the project
cargo build --release

# Flash to ESP32
cargo espflash flash --release --monitor

Project Structure

src/
├── bin/
│   └── main.rs          # Main application entry point
├── api.rs               # Network and API communication
├── config.rs            # Configuration constants
├── display.rs           # E-ink display functions
├── error.rs             # Error types and handling
└── lib.rs               # Library root

Configuration

All configuration values are centralized in src/config.rs:

  • WiFi: SSID, password, scan settings
  • API: URL, buffer sizes, room limits
  • Pins: GPIO assignments
  • SPI: Bus frequency and mode
  • Display: Layout, margins, line spacing
  • Power: Deep sleep duration
  • Network: Retry delays, timeouts

Operation

The device operates in a cycle:

  1. Wake from deep sleep
  2. Initialize hardware (SPI, display)
  3. Connect to WiFi
  4. Fetch room data from API
  5. Display data on e-ink screen (or error message)
  6. Enter deep sleep for 10 minutes
  7. Repeat

Error Handling

The application includes comprehensive error handling:

  • Network failures are logged and displayed
  • API errors show on the screen before sleep
  • Display errors are logged but don't prevent operation
  • WiFi connection errors trigger automatic retry
  • The device continues to sleep cycle even on errors

Development

Dependencies

Key dependencies include:

  • esp-hal - ESP32 hardware abstraction
  • embassy - Async runtime for embedded
  • epd-waveshare - E-ink display driver
  • reqwless - HTTP client
  • embedded-graphics - Graphics primitives

Building

This project uses the xtensa-esp32-none-elf target. Make sure you have:

  1. Rust nightly toolchain
  2. ESP32 toolchain installed
  3. espflash for flashing

License

[Add your license here]

Contributing

[Add contribution guidelines here]

About

A ESP32 + E-ink display for my thermostat

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages