This project provides a simple way to display images from a remote Immich server on a Raspberry Pi using an Inky e-ink display. In its current form, the script fetches random images from the Immich server and displays them on the Inky display.
By default, it includes a filter on the persons present in the images when querying Immich. Since I have a Inky 7 colour display with 4 buttons, I included some basic button functionality to navigate through images:
- Button A: Display a new random image containing the persons listed in the
IMMICH_PERSON_NAMESenvironment variable - Button B: Display a new random image without any filter
- Button C: Not used yet!
- Button D: Shutdown the Raspberry Pi
You will need to ensure you have the following installed on your Raspberry Pi:
- Python 3
- Python dev headers: you can install them using
sudo apt-get install python3-dev - Python RPi GPIO library: install it using
sudo apt-get install python3-rpi.gpio
Other dependencies will be installed via pip (see Installation section).
Moreover, you need to generate an API key from your Immich server to allow the script to access the images. You can do this by logging into your Immich web interface, navigating to your user account settings, and generating a new API key. It only needs the following scopes:
- asset.read
- asset.download
- person.read
I would recommend setting up a virtual environment for this project. You can do this using venv:
python3 -m venv inky-immich-env
source inky-immich-env/bin/activate- Clone this repository to your Raspberry Pi:
git clone https://github.com/xamcost/rpi-inky-immich
cd rpi-inky-immich- Install the required Python packages:
pip install -r requirements.txt- Export the necessary environment variables. You can do this manually, or you can copy the
example.envfile to a.envfile and edit it accordingly. Then source the.envfile:
cp example.env .env
vim .env
source .env- Launch the script:
python main.pyA run.sh script is provided to facilitate running the program on startup. You can set it up using crontab, or by creating a systemd service. Here's how to do it with systemd:
- Make the
run.shscript executable:
chmod +x run.sh- Create a new service file from the provided example:
sudo cp example.service /etc/systemd/system/rpi-inky-immich.service- Edit the service file to point to your virtual environment and the project directory:
sudo vim /etc/systemd/system/rpi-inky-immich.service- Enable and start the service:
sudo systemctl enable rpi-inky-immich.service
sudo systemctl start rpi-inky-immich.serviceThere are a few important limitations to be aware of:
- this program won't work on Raspberry Pi Zero models since it uses
pillow-heifto decode HEIC images, which doesn't support ARMv6 architecture. If you don't have HEIC images and want to use a Pi Zero, you can perfectly removepillow-heif. - it has been tested only with Raspberry Pi Compute Module 4. It should work with any RPi 3, 4 or 5 model, but it may need some adjustments.
- it has been tested only with Inky 7 colour display with 4 buttons. Yet it uses the
autofunction from the Inky library to detect the display type, so it should work with other Inky models as well, but button functionality may vary.