Giter VIP home page Giter VIP logo

eink-display-server's Introduction

eInk Display Server

A small NodeJS based server to serve local or public images optimized for common eInk Displays (e.g. from Waveshare) in combination with a WiFi-enabled microcontroller (e.g. esp32, esp8266).

Important: This is only the server part. You will need to program your microcontroller yourself so it fetches images from this server using TCP/IP.

Images are converted to BMP and translated into black and white "grayscale" using Floyd Steinberg dithering.

Support for Docker is available and the recommended way of deploying.

Supported services / sources

1. Local files

This service picks a random picture from a local folder (including subfolders). Supported image types are: bmp, jpeg, png, tiff and heic.

Endpoint: /local.bmp or /local.png

Usage (Docker)

Configuration

The server listens on port 3000 and individual configuration is done using environmental variables, all of which are optional and have reasonable defaults. You probably want to adapt EINK_WIDTH and EINK_HEIGHT to match your specific display. The following options are available:

Environmental Variable Required Default Description
EINK_WIDTH false 800 Display width in pixels. Used to scale the original image up or down to this width.
EINK_HEIGHT false 480 Display height in pixels. Used to scale the original image up or down to this height.
LOCAL_FOLDERS false /images Comma separated list of folders to include in local image list
LOCAL_EXCLUDE false empty Comma separated list of (sub-)folder names to be excluded from LOCAL_FOLDERS
LOCAL_SHOW_HIDDEN false false Wether to use hidden files (=starting with a dot) in LOCAL_FOLDERS.

Run Docker container

Run with defaults

This will make the server available on port 3000 on the host machine.

docker run -d \
    -p 3000:3000
    --name eInkServer \
    tfohlmeister/eink-display-server:latest

You can then load an eInk-optimized version of a random wallpaper at http://$HOST_IP:3000/wallpaper.bmp.

Advanced examples

This command will mount a local image folder /path/to/local/images:

docker run -d \
    --name eInkServer \
    -p 3000:3000 \
    -v /path/to/local/images:/images \
    tfohlmeister/eink-display-server:latest

The following command will mount two local image folders and excludes all folders called PrivatePictures:

docker run -d \
    --name eInkServer \
    -p 3000:3000 \
    -v /path/to/local/images1:/images/images1 \
    -v /path/to/local/images2:/images/images2 \
    -e LOCAL_FOLDERS=/images/images1,/images/images2 \
    -e LOCAL_EXCLUDE=PrivatePictures \
    tfohlmeister/eink-display-server:latest

You should now be able to also display eInk-optimized versions of your mounted images at http://$HOST_IP:3000/local.bmp.

Troubleshooting

If you see Watcher Errors in the log stating the system limit for number of file watchers reached, you need to increase the amount of inotify watchers on your (host) system. Restart the application afterwards.

If you found a bug or find this project is missing a feature please create an Issue.

Development

1. Install dependencies

npm install

2. Develop with auto-compiling and debugging enabled

npm run watch-debug

3. Build server and container

npm run build
docker build --tag eink-display-server:latest .

eink-display-server's People

Contributors

dependabot[bot] avatar tfohlmeister avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eink-display-server's Issues

Height declaration not working

Hi,

There is an error in the "Environmental Variable" declaration:
The "height" is not copied correctly.

const EINK_WIDTH = Number(process.env.EINK_WIDTH) || 800; const EINK_HEIGHT = Number(process.env.EINK_WIDTH) || 480;

Kind regards,
Ivan.

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.