Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DisplayProxy

DisplayProxy runs an HTTP server to which you can send images and it will display them on an attached Inky display, or in a pygame window. This enables you to separate the generation of the images from the display of the image. It also allows images to be pushed to the display from a remote location.

This module was created to run on a Raspberry Pi connected to an Inky display, and the Pygame option was added for development purposes. With the same API you can point the same client code at a real Inky display or a Pygame window of equivalent dimensions.

Requirements

Installation

Install with pip or pipx. Note that it's not yet in pypi. Both methods will install the displayproxy command, or it can be run directly with python3 -m displayproxy.server.

$ pip install git+https://github.com/stut/displayproxy.git
$ pipx install git+https://github.com/stut/displayproxy.git

Usage

All configuration is done using command line options. The default values are:

  • host = "localhost"
  • port = 8000
  • buttons = ""
  • options = ""
$ python3 -m displayproxy.server [<display-type>] [--host <HOST>] [--port <PORT>] [--buttons <BUTTONS>] [--options <OPTIONS>]

Inky displays

The display will not be updated until an image is received, so don't expect anything to happen on startup.

The process can be run as a daemon as it does not need access to a desktop environment. It can be run on a headless Raspberry Pi.

Important: The image supplied must be the correct size for the display, otherwise the request will return a 400 error and the display will not be updated.

Pygame

Pygame requires a desktop environment to run. The easiest way to achieve this at startup on a Raspberry Pi is to use an autostart script.

See the docs for more information.

Display type aliases

The display-type option can be set to one of the following aliases to set default buttons and options. These can be overridden with the buttons and options CLI arguments.

  • inky-impression-5.7: Inky Impression 5.7" display.
  • pygame-inky-impression-5.7: Pygame window with the same dimensions and buttons as the Inky Impression 5.7" display.

PRs to add more aliases are welcome.

TODO

  • Add documentation on setting it up as a systemd service with an Inky display, and using an autostart script for Pygame.
  • Add a webhook option for button presses.
  • Switch to using a configuration file for the complex options. Retain command line options for display-type, host, port.
  • Implement buttons for the pygame display mode.
  • Add display-type aliases for specific devices. For example, specifying inky-impression-5.7 would set width=600, height=448, and the buttons config to A=5u;B=6u;C=16u;D=24u.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages