GithubHelp home page GithubHelp logo

fn-florian / epaper-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clausgf/epaper-server

0.0 0.0 0.0 4.34 MB

Epaper server written in Python based on FastAPI

Python 99.66% Dockerfile 0.34%

epaper-server's Introduction

Epaper Display with ESP32 and Linux Server

Overview

The Github repositories epaper-esp32 and epaper-server comprise a complete epaper system, consisting of a configurable and easily extensible server which renders PNG images and an ESP32 based client which displays these images on an epaper panel. Many of the popular Waveshare epaper displays should be supported through the widely used GxEPD2 library.

I use this project for my personal epaper displays at home and in my office based on the 4.2" 400x300 bw and the 7.5" 880x528 bwr raw panels, but larger deployments with different panels should also work.

The dockerized server can run on any Linux box like Raspberry Pi. It's written in Python/FastAPI and easily adaptable when the configuration options are not sufficient. Currently, there is support for OpenWeather data sources and for extracting information from arbitrary web sites. This information can be displayed in different ways using widgets.

For the epaper client, I use the Waveshare E-Paper ESP32 Driver Board with an AA size LiPo battery in a 3D printed case. For better battery life, the linear regulator on the driver board was replaced by an MCP1700 or an HT7833 in the solder friendly TO-92 package. The MCP1700 is not really recommended as it causes brownout stability problems. Despite a large capacitor, this was observed only during development with USB attached and. It is due to the high current spikes of the ESP32 when using WiFi.

The communication between the client and the server is based on HTTP. To conserve battery life, each request contains an HTTP If-None-Match header containing the version identifier of the image currently displayed. If the server image is still the same, the server just answers with the 304 Not Modified http status code. If the image has changed, the server answers with a full response containing the updated PNG image and the 200 OK HTTP status code. Both anwers contain the (new) version identifier in the Etag HTTP header and the time until the client should ask for an update again in the Cache-Control: max-age= HTTP header.

Epaper-Esp32

Installation

  1. Get PlatformIO if you haven't yet. I love the Visual Studio Code integration.
  2. Adapt src/settings.h based on src/settings-template.h.

Epaper-Server

This is a companion to the epaper display driver epaper-esp32 project. Realized as a FastAPI based web server running in a docker container, it provides images and management for epaper displays.

Images for the epaper displays are automatically updated. They can be freely configured with contents from the web. In addition to weather information which can be displayed in various forms, rendering of information collected from arbitrary web pages is supported. Together with epaper-esp32, this project forms a complete epaper display solution.

Installation

  1. Create a config.yml file based on the template.
    • define at least one display and arbitrary number of aliases - the client can query the display contents using the display name or any alias
    • You need a free OpenWeather API key for the Weather datas source.
    • Use the WebScraper data source to extract arbitrary information from web sources based on regular expressions. This should be quite flexible.
    • available widgets include Date, Text and WeatherNow, WeatherForecast and WeatherTemperature
  2. Review docker-compse.yml.
    • Redis-Commander should be activated only for debugging and in isolated, private networks. Deactivate it by commenting out the section.
    • The project works nicely in a private network. For use in public networks, appropriate authentication and encrpytion shall be added.
  3. Start the service using docker-compose up -d.
    • docker-compose logs shows logs
    • docker-compose downstops the service
  4. It shouldn't be too difficult to add custom widgets. Don't forget to add them to backend/core/widgets/__init__.py.

Technical notes

By default, epaper-server supports these endpoints:

Todos

Interesting extension might include (pull requests welcome!):

  • Calendar widgets and data sources - Exchange and iCloud calendars might be useful for me!
  • Traffic jam / travel time overview using Google Maps (the ugomeda project has one, but that impacts neither me nor my bike :-)
  • Some form of device management for the ESP32 fleet (any ideas?)
  • Web frontend for some form of management
    • current image/image shown
    • device status

Credits

epaper-server's People

Contributors

clausgf avatar

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.