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.
- Python 3.6+
- (for Inky displays) Inky requirements (see Pimoroni's Inky documentation for more information)
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.gitAll configuration is done using command line options. The default values are:
host="localhost"port=8000buttons=""options=""
$ python3 -m displayproxy.server [<display-type>] [--host <HOST>] [--port <PORT>] [--buttons <BUTTONS>] [--options <OPTIONS>]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 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.
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.
- 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-typealiases for specific devices. For example, specifyinginky-impression-5.7would setwidth=600,height=448, and the buttons config toA=5u;B=6u;C=16u;D=24u.